/* player.css — mobile portrait. Large thumb-friendly buttons, no h-scroll. */

.screen {
  min-height: 100dvh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  gap: 14px;
}

/* ---------- Join ---------- */
.join-card { width: 100%; max-width: 420px; text-align: center; }
.join-logo { height: 58px; margin: 4px auto 10px; }
.join-title {
  margin: 0; font-size: 30px; font-weight: 800; color: var(--stpi-navy);
  letter-spacing: 0.5px;
}
.join-sub { margin: 4px 0 20px; color: var(--ink-soft); font-weight: 600; }
.field-label { display: block; text-align: left; font-weight: 700; margin-bottom: 8px; }
.emp-input {
  width: 100%; font-size: 22px; padding: 16px 18px; border-radius: var(--radius);
  border: 2px solid #e2ddf0; text-align: center; letter-spacing: 2px;
  outline: none; transition: border-color 0.15s;
}
.emp-input:focus { border-color: var(--bg-grad-a); }
.btn-primary {
  width: 100%; margin-top: 14px; font-size: 20px; font-weight: 800; color: #fff;
  padding: 16px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--bg-grad-a), var(--bg-grad-b));
  box-shadow: 0 8px 0 #5e17c0, var(--shadow-sm); transition: transform 0.08s;
}
.btn-primary:active { transform: translateY(4px); box-shadow: 0 4px 0 #5e17c0; }
.btn-primary:disabled { filter: grayscale(0.4) opacity(0.7); box-shadow: none; }
.join-error { color: var(--c1); font-weight: 700; min-height: 22px; margin: 12px 0 0; }

/* ---------- Lobby ---------- */
.lobby-card { width: 100%; max-width: 420px; text-align: center; }
.avatar-wrap { display: flex; justify-content: center; }
.avatar {
  width: 108px; height: 108px; border-radius: 50%; object-fit: cover;
  border: 5px solid #fff; box-shadow: var(--shadow-sm); background: #eee;
  animation: popIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.lobby-hello { margin: 14px 0 2px; font-size: 26px; font-weight: 800; color: var(--stpi-navy); }
.lobby-msg { color: var(--ink-soft); font-weight: 600; margin: 6px 0 0; }
.lobby-score { margin: 12px 0 0; font-weight: 800; font-size: 20px; color: var(--bg-grad-a); }

/* ---------- Question ---------- */
#screen-question { justify-content: flex-start; }
.q-top {
  width: 100%; max-width: 640px; display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.q-counter {
  background: rgba(255, 255, 255, 0.9); color: var(--stpi-navy); font-weight: 800;
  padding: 6px 14px; border-radius: 999px; font-size: 15px; box-shadow: var(--shadow-sm);
}
.timer { position: relative; width: 56px; height: 56px; }
.timer-ring { width: 56px; height: 56px; transform: rotate(-90deg); }
.timer-track { fill: none; stroke: rgba(255, 255, 255, 0.35); stroke-width: 5; }
.timer-arc {
  fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round;
  stroke-dasharray: 119.4; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear;
}
.timer-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff; font-size: 20px;
}
.q-text {
  width: 100%; max-width: 640px; color: #fff; font-size: 22px; font-weight: 800;
  line-height: 1.4; text-align: center; margin: 18px 0 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.choices {
  width: 100%; max-width: 640px; display: grid; grid-template-columns: 1fr;
  gap: 12px;
}
.choice {
  position: relative; min-height: 72px; border-radius: var(--radius); color: #fff;
  font-size: 17px; font-weight: 800; line-height: 1.3; padding: 14px 14px 14px 46px;
  text-align: left; display: flex; align-items: center;
  transition: transform 0.08s, filter 0.15s; animation: popIn 0.35s both;
}
.choice:active { transform: translateY(4px) scale(0.99); }
.choice:nth-child(1) { animation-delay: 0.02s; }
.choice:nth-child(2) { animation-delay: 0.08s; }
.choice:nth-child(3) { animation-delay: 0.14s; }
.choice:nth-child(4) { animation-delay: 0.20s; }
.choice .shape {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; color: #fff;
}
.choices.locked .choice { pointer-events: none; }
.choices.locked .choice.dimmed { filter: grayscale(0.55) opacity(0.5); }
.choice.chosen { outline: 4px solid #fff; filter: none !important; }

.answered-banner {
  width: 100%; max-width: 420px; text-align: center; color: #fff; margin-top: 20px;
  animation: popIn 0.4s both;
}
.answered-check {
  width: 76px; height: 76px; border-radius: 50%; background: rgba(255, 255, 255, 0.2);
  border: 3px solid #fff; display: flex; align-items: center; justify-content: center;
  font-size: 40px; margin: 0 auto 10px;
}
.answered-banner p { font-size: 20px; font-weight: 800; margin: 6px 0 2px; }
.answered-banner small { opacity: 0.85; }

/* ---------- Result ---------- */
.result-card { width: 100%; max-width: 420px; text-align: center; animation: popIn 0.4s both; }
.result-label { font-size: 24px; font-weight: 800; margin: 4px 0 10px; }
.result-label.good { color: var(--c4); }
.result-label.bad { color: var(--c1); }
.result-label.none { color: var(--ink-soft); }
.points-pop {
  font-size: 64px; font-weight: 900; line-height: 1;
  color: var(--bg-grad-a); margin: 6px 0 18px;
}
.total-row {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: #f4f1fb; border-radius: var(--radius); padding: 14px; margin: 8px 0;
}
.total-caption { color: var(--ink-soft); font-weight: 700; font-size: 14px; }
.total-score { font-size: 40px; font-weight: 900; color: var(--stpi-navy); }
.rank-line { margin: 12px 0 0; font-weight: 800; font-size: 18px; color: var(--ink); }

/* ---------- Game over ---------- */
.over-card { width: 100%; max-width: 440px; text-align: center; animation: popIn 0.5s both; }
.over-logo { height: 48px; margin: 0 auto 6px; }
.over-medal { font-size: 72px; line-height: 1; margin: 4px 0; }
.over-title { margin: 0; font-size: 28px; font-weight: 900; color: var(--stpi-navy); }
.over-rank { font-size: 22px; font-weight: 800; margin: 10px 0; color: var(--bg-grad-a); }
.over-msg { color: var(--ink-soft); font-weight: 600; margin-top: 10px; }

/* ---------- FX ---------- */
.fx-canvas {
  position: fixed; inset: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 60;
}
.float-num {
  position: fixed; z-index: 61; font-size: 72px; font-weight: 900; pointer-events: none;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.3); animation: floatUpFade 1.1s ease-out forwards;
}
