:root {
  --w: 720px;
  --h: 480px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: #111;
  color: #fff;
  font-family: "Yuji Syuku", serif;
  padding-bottom: 48px;
}

.app-wrap {
  width: 100%;
  max-width: var(--w);
  aspect-ratio: 720 / 480;
  position: relative;
  overflow: hidden;
}

.app {
  width: var(--w);
  height: var(--h);
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  border: 2px solid #333;
  overflow: hidden;
}

/* Auto-scale .app to fit .app-wrap */
@media (max-width: 740px) {
  .app-wrap {
    width: 100vw;
  }
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.screen--active {
  display: flex;
}

.screen[data-screen="title"],
.screen[data-screen="game"] {
  background: #442a19 url("assets/images/table.png") center / cover no-repeat;
}

.screen[data-screen="select"],
.screen[data-screen="description"],
.screen[data-screen="result"] {
  background: #1c2b3f url("assets/images/background.png") center / cover no-repeat;
}

.panel {
  width: 84%;
  background: rgba(0, 0, 0, 0.68);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
}

.panel--title h1 {
  font-size: clamp(36px, 8vw, 60px);
  margin: 0;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 22px;
  border-radius: 12px;
  border: none;
  padding: 10px 16px;
  margin: 8px;
  background: #f3d278;
}

button.ghost {
  background: #ddd;
}

.mode-list {
  display: grid;
  gap: 8px;
}

.note {
  margin: 0 0 12px;
  font-size: 20px;
}

.start-hint {
  margin: 10px 0 0;
  font-size: 34px;
  color: #ffd66e;
  text-shadow: 0 0 8px rgba(255, 182, 58, 0.75);
}

.error {
  color: #ff9e9e;
  min-height: 1.5em;
}

.hud {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.55);
  padding: 8px 12px;
  border-radius: 10px;
  min-height: 48px;
}

.hud-course {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.hud-time {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 28px;
}

.hud-score {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.cup-lane {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.cup-token {
  position: absolute;
  width: 144px;
  height: 144px;
  background: center / cover no-repeat;
  border-radius: 10px;
}

.typing-box {
  width: 420px;
  height: 180px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.68);
  margin-top: 60px;
  padding: 24px;
  text-align: center;
  z-index: 2;
}

.name {
  font-size: 50px;
  margin: 0 0 10px;
}

.romaji {
  font-size: 40px;
  min-height: 48px;
  margin: 0;
}

.result-list {
  text-align: left;
  list-style: none;
  padding: 0;
  max-width: 360px;
  margin: 0 auto 12px;
}
