:root {
  --bg-top: #66c0ff;
  --bg-bottom: #a9e4ff;
  --panel-bg: rgba(7, 33, 58, 0.68);
  --text: #eef6ff;
  --accent: #ffe466;
  --danger: #ff5d68;
  --ok: #54de92;
  --card-border: rgba(255, 255, 255, 0.22);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Trebuchet MS", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 255, 255, 0.28), transparent 60%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
  color: var(--text);
  touch-action: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

#game-root {
  width: 100%;
  height: 100%;
}

.panel {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 10px;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: var(--panel-bg);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(4, 19, 33, 0.25);
  z-index: 10;
}

.hud-row {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  line-height: 1.5;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 20;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: rgba(8, 20, 34, 0.58);
}

.screen.visible {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.screen h1,
.screen h2,
.screen h3,
.screen p {
  margin: 0;
}

.screen p {
  max-width: 34ch;
}

.tap-btn {
  min-width: 180px;
  min-height: 48px;
  border: 0;
  border-radius: 14px;
  color: #0d1626;
  font-weight: 800;
  font-size: 16px;
  background: var(--accent);
  padding: 10px 16px;
  box-shadow: 0 6px 0 rgba(197, 153, 18, 0.95);
}

.tap-btn:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(197, 153, 18, 0.95);
}

.hint {
  position: absolute;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 8px));
  transform: translateX(-50%);
  width: min(92vw, 460px);
  display: none;
  z-index: 11;
  color: #ffffff;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: linear-gradient(180deg, rgba(18, 56, 92, 0.78), rgba(10, 37, 63, 0.78));
  box-shadow: 0 10px 28px rgba(7, 22, 42, 0.3);
  padding: 10px 14px;
  gap: 3px;
  pointer-events: none;
}

.hint.visible {
  display: flex;
  flex-direction: column;
}

.hint strong {
  font-size: 14px;
}

.hint span {
  font-size: 12px;
  opacity: 0.95;
}

.leaderboard-wrap {
  width: min(92vw, 360px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(0, 20, 38, 0.4);
}

.leaderboard-list {
  display: grid;
  gap: 5px;
  font-size: 14px;
  text-align: left;
}

@media (min-width: 768px) {
  .panel {
    left: 20px;
    top: 20px;
  }

  .tap-btn {
    min-width: 220px;
  }

  .hint {
    bottom: 22px;
  }
}
