@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Javanese:wght@400;700&family=Outfit:wght@600;700;800;900&family=Plus+Jakarta+Sans:wght@500;600;700;800&display=swap');

/* === VARIABLE COLOR TONE & SYSTEM === */
:root {
  --bg: #f8fafc;
  --card-bg: rgba(255, 255, 255, 0.92);
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  
  /* Modern Bright Tone Palette */
  --accent-primary: #6366f1;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --accent-orange: #f59e0b;
  --accent-dark: #0f172a;
  
  --ok: #10b981;
  --ok-bg: #ecfdf5;
  --retry: #f59e0b;
  --retry-bg: #fffbeb;
  --fail: #ef4444;
  --fail-bg: #fef2f2;

  --shadow-sm: 0 4px 12px rgba(99, 102, 241, 0.06);
  --shadow-lg: 0 25px 50px -12px rgba(99, 102, 241, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
}

/* === RESET & BASE === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* === AMBIENT GLOW ORBS ANIMATION === */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: 0;
  pointer-events: none;
  opacity: 0.65;
  animation: floatOrb 18s ease-in-out infinite alternate;
}

.orb-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #a855f7 0%, #6366f1 100%);
  top: -100px;
  left: -100px;
}

.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #f59e0b 0%, #f43f5e 100%);
  bottom: -80px;
  right: -80px;
  animation-delay: -6s;
}

.orb-3 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, #06b6d4 0%, #3b82f6 100%);
  top: 40%;
  left: 60%;
  animation-delay: -12s;
}

@keyframes floatOrb {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -50px) scale(1.1); }
  100% { transform: translate(-30px, 30px) scale(0.95); }
}

/* === TOP NAVBAR === */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  padding: 12px 20px;
}

.nav-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 20px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-icon {
  font-size: 22px;
  -webkit-text-fill-color: initial;
  animation: pulseIcon 2s infinite alternate;
}

@keyframes pulseIcon {
  0% { transform: scale(1); }
  100% { transform: scale(1.2) rotate(10deg); }
}

.guide-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-primary);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 99px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.guide-trigger-btn:hover {
  background: var(--accent-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.3);
}

/* === MAIN APP SHELL & WRAP === */
.app-shell {
  min-height: calc(100vh - 60px);
  position: relative;
  z-index: 1;
  padding: 32px 16px 48px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.wrap {
  width: 100%;
  max-width: 740px;
  margin: 0 auto;
  animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === HEADINGS === */
h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center;
}

h1 .jawa {
  font-family: "Noto Sans Javanese", serif;
  font-weight: 400;
  display: inline-block;
  margin-left: 4px;
}

.sub {
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 28px;
}

/* === VIEWS & CARDS === */
.view {
  display: none;
}

.view.active {
  display: block;
  animation: fadeInScale 0.35s ease-out;
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  position: relative;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media(max-width: 580px) {
  .grid2 { grid-template-columns: 1fr; }
  h1 { font-size: 34px; }
  .card { padding: 20px; }
}

/* === BUTTONS & FORM INPUTS === */
button, input, select {
  height: 52px;
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s ease;
}

button {
  border: none;
  background: var(--accent-dark);
  color: #ffffff;
  font-weight: 700;
  padding: 0 22px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.2);
}

button:active {
  transform: translateY(0) scale(0.98);
}

button.secondary {
  background: #ffffff;
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}

button.secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

button.accent {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.4);
}

button.accent:hover {
  box-shadow: 0 14px 30px -4px rgba(99, 102, 241, 0.55);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

input, select {
  width: 100%;
  border: 2px solid var(--line);
  background: #ffffff;
  padding: 0 16px;
  outline: none;
  color: var(--ink);
  font-weight: 600;
}

input:focus, select:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}

/* === LOBBY & CODE DISPLAY === */
.code-display {
  font-family: 'Outfit', sans-serif;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-align: center;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border: 2px dashed var(--accent-primary);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 14px 0;
  color: var(--accent-primary);
  text-shadow: 0 2px 10px rgba(99, 102, 241, 0.2);
}

.qr-wrap {
  display: flex;
  justify-content: center;
  margin: 12px 0 20px;
}

.qr-wrap img {
  border-radius: 20px;
  border: 2px solid var(--line);
  background: #ffffff;
  padding: 12px;
  width: 200px;
  height: 200px;
  object-fit: contain;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.qr-wrap img:hover {
  transform: scale(1.05) rotate(-1deg);
}

/* === PLAYER LIST === */
#hostPlayerList {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
  min-height: 52px;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}

.player-row:hover {
  border-color: var(--accent-primary);
  transform: translateX(4px);
}

.p-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
}

.p-dot.ok { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.p-dot.retry { background: var(--retry); box-shadow: 0 0 8px var(--retry); }

.p-name { flex: 1; font-weight: 700; color: var(--ink); }
.p-status { font-size: 11px; font-weight: 700; background: #f1f5f9; border-radius: 99px; padding: 4px 10px; color: var(--muted); }
.p-score { font-size: 13px; font-weight: 800; color: var(--accent-primary); }
.p-id { font-size: 11px; font-family: monospace; color: var(--muted); background: #f8fafc; border: 1px solid var(--line); border-radius: 99px; padding: 2px 8px; }

.empty-state {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  background: rgba(248, 250, 252, 0.6);
}

/* === LEVEL CHECKBOXES & OPTIONS === */
.level-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.level-cb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.level-cb:has(input:checked) {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-primary);
}

.level-cb input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-primary);
}

.jumlah-wrap {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 14px 0;
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 10px 16px;
}

.jumlah-wrap label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

#jumlahSoal {
  flex: 1;
  border: none;
  height: 38px;
  background: transparent;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}

/* === GAMEPLAY AREA === */
#hostGameArea {
  display: none;
  background: #ffffff;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-xl);
  padding: 24px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  min-height: 340px;
  align-items: center;
  justify-content: center;
}

.countdown-overlay {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(8px);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  z-index: 20;
  border-radius: var(--radius-xl);
  min-height: 340px; /* FIX */
  height: 100%;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  overflow: visible;
}

.cd-big {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(80px, 15vw, 120px);
  font-weight: 900;
  line-height: 0.85;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: popBig 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 12px 0; 
  overflow: visible;
  text-align: center;
}

@keyframes popBig {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.cd-big.go {
  font-size: clamp(64px, 12vw, 90px);
  letter-spacing: 0.05em;
}

.cd-sub { font-size: 18px; font-weight: 600; opacity: 0.8; margin-top: 8px; }

/* Gameplay Header */
.hq-head, .pq-head {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.badge-lv {
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.q-progress {
  font-size: 12px;
  font-weight: 800;
  background: #f1f5f9;
  border-radius: 99px;
  padding: 6px 12px;
  color: var(--muted);
}

.timer {
  margin-left: auto;
  background: var(--accent-dark);
  color: #fde047;
  border-radius: 99px;
  padding: 6px 16px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.05em;
  box-shadow: 0 0 12px rgba(253, 224, 71, 0.3);
}

.my-score {
  margin-left: auto;
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fde68a;
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 800;
}

/* Question Display */
.q-latin {
  font-size: 22px;
  font-weight: 800;
  margin: 14px 0;
  color: var(--ink);
  line-height: 1.3;
}

.jawa {
  font-family: "Noto Sans Javanese", serif;
}

.jawa.big {
  font-size: 64px;
  line-height: 1.1;
  margin: 12px 0;
  text-align: center;
  color: var(--accent-primary);
}

.q-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ans-key { font-size: 12px; font-weight: 700; background: var(--accent-dark); color: #f8fafc; border-radius: 99px; padding: 6px 12px; }

.progress-track { margin: 16px 0 10px; }
.progress-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--accent-gradient); width: 0%; transition: width 0.4s ease; }

/* Options Grid */
.opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.opt-btn {
  height: 56px;
  background: #ffffff;
  border: 2px solid var(--line);
  color: var(--ink);
  font-weight: 800;
  font-size: 16px;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

.opt-btn:hover {
  border-color: var(--accent-primary);
  background: #f8fafc;
}

.opt-btn.selected {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.35);
}

/* Reference Aksara Grid */
.grid-aksara-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 18px;
}

.grid-aksara {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin: 10px 0 16px;
}

.aks-cell {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  font-family: "Noto Sans Javanese", serif;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

/* Attempts & Feedback */
.attempt-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: #f8fafc;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
}

.fb {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 15px;
  font-weight: 800;
  margin-top: 12px;
  animation: slideUp 0.3s ease-out;
}

.fb.ok { background: var(--ok-bg); color: var(--ok); border: 1.5px solid #a7f3d0; }
.fb.retry { background: var(--retry-bg); color: #d97706; border: 1.5px solid #fde68a; }
.fb.fail { background: var(--fail-bg); color: var(--fail); border: 1.5px solid #fca5a5; }

/* Live Log & Results */
.live-log {
  max-height: 180px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.log-line {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13px;
}

.log-line.ok { border-color: #a7f3d0; background: var(--ok-bg); }
.log-line.retry { border-color: #fde68a; background: var(--retry-bg); }

.result-card {
  margin-top: 16px;
  background: #f8fafc;
  border: 2px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 16px;
}

.result-title { font-weight: 800; font-size: 16px; margin-bottom: 12px; }

.podium-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.podium-row.r1 { border-color: #fde047; background: #fefce8; box-shadow: 0 4px 12px rgba(250, 204, 21, 0.2); }

.all-ranking { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.rank-line { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; background: #ffffff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }

/* Sticky Next Button */
#hostNextWrap {
  display: none;
  margin-top: 14px;
  position: sticky;
  top: 72px;
  z-index: 30;
}

#hostNextWrap #btnNextQuestion {
  height: 54px;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
}

/* Final Leaderboard Card */
.final-card {
  background: var(--accent-dark);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
}

.final-card.player {
  background: #ffffff;
  color: var(--ink);
  border: 2px solid var(--line);
}

.final-title { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 900; }
.final-sub { font-size: 14px; opacity: 0.75; margin: 6px 0 16px; }

.final-list { display: flex; flex-direction: column; gap: 10px; }

.final-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
}

.final-card.player .final-row {
  background: #f8fafc;
  border: 1.5px solid var(--line);
}

.final-row.top1 {
  background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
  color: #713f12;
  font-weight: 800;
  border-color: #facc15;
}

.final-row .rank { font-weight: 900; min-width: 36px; }
.final-row .name { flex: 1; font-weight: 700; }
.final-row .score { font-weight: 900; }
.final-row.me { outline: 3px solid var(--accent-primary); }

/* Waiting & Finish Screens */
.waiting-card, .finish-card {
  background: #ffffff;
  border: 2px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  text-align: center;
}

.waiting-badge {
  display: inline-flex;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid #a7f3d0;
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 12px;
}

.waiting-room { font-size: 15px; color: var(--muted); }
.waiting-name { font-size: 22px; font-weight: 800; margin: 8px 0; }
.waiting-msg { font-size: 15px; line-height: 1.5; margin: 12px 0; }
.waiting-info { font-size: 13px; color: var(--muted); background: #f8fafc; border: 1.5px dashed var(--line); border-radius: var(--radius-md); padding: 12px; margin-top: 12px; }

.dots span { animation: blink 1.4s infinite; }
.dots span:nth-child(2) { animation-delay: 0.2s; }
.dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 20% { opacity: 0; } 50% { opacity: 1; } }

#playerCountdown {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--accent-dark);
  color: #ffffff;
  border-radius: var(--radius-xl);
  padding: 36px 20px;
  margin-top: 20px;
  min-height: 240px;
}

/* === MODAL PETUNJUK GAME === */
.guide-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(10px);
  padding: 20px;
  overflow-y: auto;
  align-items: center;
  justify-content: center;
}

.guide-modal-backdrop.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.guide-modal {
  background: #ffffff;
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
  animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

@keyframes modalPop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
}

.modal-header h2 {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 28px;
  color: var(--muted);
  width: 36px;
  height: 36px;
  padding: 0;
  box-shadow: none;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.highlight-box {
  display: flex;
  gap: 16px;
  background: rgba(99, 102, 241, 0.06);
  border: 1.5px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
}

.section-icon { font-size: 32px; }
.highlight-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 4px; color: var(--accent-primary); }
.highlight-box p { font-size: 14px; color: var(--muted); line-height: 1.5; }

.guide-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media(max-width: 580px) {
  .guide-grid { grid-template-columns: 1fr; }
}

.role-card {
  background: #ffffff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.host-card .role-badge { background: #e0e7ff; color: #4338ca; }
.player-card .role-badge { background: #fef3c7; color: #b45309; }

.role-card h4 { font-size: 15px; font-weight: 800; margin-bottom: 10px; }

.step-list {
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}

.rules-box {
  background: #f8fafc;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.rules-box h3 { font-size: 16px; font-weight: 800; margin-bottom: 14px; }

.rules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media(max-width: 580px) {
  .rules-grid { grid-template-columns: 1fr; }
}

.rule-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
}

.rule-icon { font-size: 22px; }
.rule-detail { font-size: 12px; color: var(--muted); line-height: 1.5; }
.rule-detail strong { display: block; font-size: 13px; color: var(--ink); margin-bottom: 2px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.accent-btn {
  background: var(--accent-gradient);
  color: #ffffff;
  font-weight: 800;
  font-size: 15px;
  border-radius: var(--radius-lg);
  height: 48px;
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.accent-btn:hover {
  box-shadow: 0 12px 25px rgba(99, 102, 241, 0.45);
}

#hostLobbyControls {
  display: grid;
  gap: 10px;
}

.about-hero {
  display: flex;
  gap: 14px;
  background: rgba(99,102,241,0.06);
  border: 1.5px solid rgba(99,102,241,0.18);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 0 0 22px 0;
}
