/* ============================================================
   StakeGame — app.css
   Palette: #24356f / #40509e / #6c99dd / #e8f4fc
            #fbeb87 / #f4c500
            #eab888 / #f59c44
            #ea5162 / #db7182
            #f3a1c6
   ============================================================ */

:root {
  --navy:      #24356f;
  --navy-mid:  #40509e;
  --blue:      #6c99dd;
  --blue-light:#e8f4fc;
  --yellow:    #fbeb87;
  --gold:      #f4c500;
  --peach:     #eab888;
  --orange:    #f59c44;
  --coral:     #ea5162;
  --rose:      #db7182;
  --pink:      #f3a1c6;

  --bg-dark:   #141225;
  --bg-grid:   #1e1c35;
  --card-bg:   #ffffff;
  --text:      #1a1a2e;
  --text-muted:#6b7280;
  --border:    #e5e7eb;

  --radius-sm: 8px;
  --radius:    16px;
  --radius-lg: 24px;

  --shadow:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 12px 40px rgba(0,0,0,.18);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  color: var(--text);
  background: #f0f4ff;
  min-height: 100vh;
}

a { color: var(--navy-mid); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 2rem;
  background: var(--navy);
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
  position: sticky; top: 0; z-index: 100;
}

.navbar-brand {
  display: flex; align-items: center; gap: .75rem;
  text-decoration: none;
}
.logo-icon { width: 36px; height: 36px; }
.logo-text {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 1.25rem;
  color: var(--blue); letter-spacing: .04em;
}
.logo-diamond { color: white; }

.navbar-menu {
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-link {
  color: rgba(255,255,255,.8); font-size: .9rem; font-weight: 500;
  text-decoration: none; transition: color .2s;
}
.nav-link:hover { color: #fff; text-decoration: none; }

.nav-user { display: flex; align-items: center; gap: .75rem; }
.nav-user-name { color: var(--yellow); }
.btn-logout {
  background: none; border: 1px solid rgba(255,255,255,.3);
  color: rgba(255,255,255,.7); cursor: pointer; font-size: .8rem;
  padding: .25rem .75rem; border-radius: 20px;
  font-family: inherit; transition: all .2s;
}
.btn-logout:hover { border-color: var(--coral); color: var(--coral); }

/* ── Main content ───────────────────────────────────────── */
.main-content {
  max-width: 1280px; margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ── Auth ───────────────────────────────────────────────── */
.auth-body {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 100%);
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 1rem;
}
.auth-container {
  width: 100%; max-width: 440px;
  display: flex; flex-direction: column; align-items: center; gap: 1.5rem;
}
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.auth-logo-text {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.6rem; color: var(--blue); letter-spacing: .1em;
}
.auth-logo-text span { color: white; }

.auth-card {
  background: white; border-radius: var(--radius-lg);
  padding: 2.5rem; width: 100%;
  box-shadow: var(--shadow-lg);
}
.auth-title { font-size: 1.75rem; font-weight: 800; color: var(--navy); margin-bottom: .25rem; }
.auth-subtitle { color: var(--text-muted); margin-bottom: 1.5rem; font-size: .9rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-footer { text-align: center; margin-top: 1.5rem; font-size: .875rem; color: var(--text-muted); }
.auth-footer a { color: var(--navy-mid); font-weight: 600; }
.auth-demo { color: rgba(255,255,255,.6); font-size: .8rem; text-align: center; }
.legal-notice {
  font-size: .78rem; color: var(--text-muted); line-height: 1.55;
  background: #f8faff; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .75rem .9rem;
}
.legal-notice a { color: var(--navy-mid); font-weight: 600; }
.legal-notice a:hover { text-decoration: underline; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .6rem 1.25rem; border-radius: var(--radius-sm);
  font-family: inherit; font-size: .9rem; font-weight: 600;
  cursor: pointer; border: 2px solid transparent;
  transition: all .2s; text-decoration: none; line-height: 1;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--navy); color: white; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-mid); border-color: var(--navy-mid); }

.btn-secondary { background: var(--blue); color: white; border-color: var(--blue); }
.btn-secondary:hover { background: var(--navy-mid); border-color: var(--navy-mid); }

.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: white; }

.btn-danger { background: var(--coral); color: white; border-color: var(--coral); }
.btn-danger:hover { background: #c84152; }

.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .8rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: .35rem; }
.form-label { font-size: .85rem; font-weight: 600; color: var(--navy); }
.form-input {
  padding: .65rem .9rem; border: 2px solid var(--border);
  border-radius: var(--radius-sm); font-family: inherit; font-size: .9rem;
  transition: border-color .2s, box-shadow .2s; background: white;
  color: var(--text); width: 100%;
}
.form-input:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(108,153,221,.2);
}
.form-input:disabled { background: #f9fafb; color: var(--text-muted); cursor: not-allowed; }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .78rem; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px,1fr)); gap: .75rem; }
.form-stack { display: flex; flex-direction: column; gap: 1.5rem; }
.form-section { margin-bottom: 0; }
.form-actions { display: flex; gap: 1rem; justify-content: flex-end; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 1rem; }
.checkbox-row {
  display: flex; align-items: center; gap: .65rem;
  font-size: .9rem; font-weight: 500; color: var(--text);
}
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--navy);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow);
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.2rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; font-size: .875rem; font-weight: 500;
}
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.alert-error   { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.alert-warning { background: #fef9c3; color: #92400e; border: 1px solid #fde047; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 20px; font-size: .75rem; font-weight: 700;
}
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-admin-q { background: #ede9fe; color: #5b21b6; }
.badge-my-q   { background: #dcfce7; color: #15803d; }

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap;
}
.page-title { font-size: 1.75rem; font-weight: 800; color: var(--navy); }
.page-subtitle { color: var(--text-muted); font-size: .9rem; margin-top: .25rem; }
.section { margin-top: 2rem; }
.section-title { font-size: 1.1rem; font-weight: 700; color: var(--navy); margin-bottom: 1rem; }

/* ── Stats Grid ──────────────────────────────────────────── */
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.stat-card {
  background: var(--navy); color: white; border-radius: var(--radius);
  padding: 1.5rem; text-align: center; box-shadow: var(--shadow);
}
.stat-number { font-size: 2.5rem; font-weight: 800; color: var(--yellow); }
.stat-label { font-size: .8rem; font-weight: 500; opacity: .8; margin-top: .25rem; }

/* ── Quick Actions ───────────────────────────────────────── */
.quick-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }

/* ── Subscription Card ───────────────────────────────────── */
.subscription-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem;
}
.sub-active { border-left: 4px solid #4ade80; }
.sub-expired { border-left: 4px solid var(--coral); }
.sub-info { display: flex; align-items: center; gap: 1rem; }
.sub-status { font-weight: 700; font-size: .95rem; }
.sub-dates { font-size: .8rem; color: var(--text-muted); margin-top: .2rem; }

.sub-detail { display: flex; flex-direction: column; gap: .5rem; }
.sub-row { display: flex; justify-content: space-between; gap: 1rem; font-size: .875rem; }

/* ── Tables ──────────────────────────────────────────────── */
.table-container { overflow-x: auto; border-radius: var(--radius-sm); }
.table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.table th {
  background: var(--navy); color: white; padding: .7rem 1rem;
  text-align: left; font-weight: 600; white-space: nowrap;
}
.table td { padding: .65rem 1rem; border-bottom: 1px solid var(--border); }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: #f8faff; }

/* ── Two Column ──────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 768px) { .two-col { grid-template-columns: 1fr; } }

/* ── Questions List ──────────────────────────────────────── */
.questions-list { display: flex; flex-direction: column; gap: 1rem; }
.question-card { }
.question-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.question-meta { display: flex; gap: 1rem; }
.q-order, .q-decisions { font-size: .75rem; color: var(--text-muted); background: #f3f4f6; padding: .2rem .6rem; border-radius: 20px; }
.question-actions { display: flex; gap: .5rem; }
.q-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); margin-bottom: .5rem; }
.q-body { font-size: .875rem; color: var(--text-muted); }

.decisions-preview { display: flex; gap: .5rem; margin-top: .75rem; flex-wrap: wrap; }
.decision-pill {
  display: flex; align-items: center; gap: .5rem;
  padding: .3rem .75rem; border-radius: 20px; font-size: .8rem; font-weight: 600;
}
.decision-a { background: #fff8e6; border: 2px solid var(--gold); }
.decision-b { background: #e6f7ec; border: 2px solid #4ade80; }
.decision-c { background: #e6f0ff; border: 2px solid var(--blue); }
.decision-label { font-size: 1rem; font-weight: 800; }
.decision-coins.positive { color: #15803d; }
.decision-coins.negative { color: var(--coral); }

/* Decision form cards */
.decision-form-card { border-left: 4px solid transparent; }
.decision-form-a { border-left-color: var(--gold); }
.decision-form-b { border-left-color: #4ade80; }
.decision-form-c { border-left-color: var(--blue); }
.decision-badge {
  display: inline-flex; width: 28px; height: 28px; align-items: center;
  justify-content: center; background: var(--navy); color: var(--yellow);
  border-radius: 6px; font-weight: 800;
}

/* ── Sessions Grid ───────────────────────────────────────── */
.sessions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 1rem; }
.session-card { padding: 0; overflow: hidden; }
.session-status-bar { height: 5px; }
.session-status-bar.status-active   { background: #4ade80; }
.session-status-bar.status-finished { background: var(--blue); }
.session-status-bar.status-draft    { background: #d1d5db; }
.session-body { padding: 1.25rem; }
.session-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .5rem;
}
.session-name {
  flex: 1;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}
.session-panel-link {
  flex-shrink: 0;
  font-size: .82rem;
  font-weight: 700;
  color: var(--blue);
  text-decoration: none;
  white-space: nowrap;
}
.session-panel-link:hover { text-decoration: underline; }
.session-meta { display: flex; align-items: center; gap: .75rem; margin-bottom: .5rem; }
.session-teams { font-size: .8rem; color: var(--text-muted); }
.session-date { font-size: .78rem; color: var(--text-muted); }
.session-actions {
  padding: .75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: stretch;
  gap: .5rem;
}
.session-action-btn,
.session-delete-btn {
  min-height: 42px;
}
.session-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.session-delete-form {
  margin-left: auto;
}
.session-delete-btn {
  width: 42px;
  min-width: 42px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.session-delete-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Empty State ─────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 4rem 2rem; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}

/* ── PANEL BODY (teacher panel / projection) ─────────────── */
.panel-body {
  background: var(--bg-dark);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 100vh; color: white;
}

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; background: rgba(0,0,0,.4);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.panel-back { color: rgba(255,255,255,.6); font-size: .85rem; text-decoration: none; }
.panel-back:hover { color: white; }
.panel-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.5rem; letter-spacing: .1em; color: white;
  text-shadow: 0 0 20px rgba(108,153,221,.6);
}
.panel-header-actions { display: flex; gap: .75rem; }
.panel-icon-btn {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.2);
  color: white; font-size: 1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; font-family: inherit;
  transition: all .2s; text-decoration: none;
}
.panel-icon-btn:hover { background: rgba(255,255,255,.2); transform: scale(1.05); text-decoration: none; }
.panel-start-btn  { background: rgba(74,222,128,.2); border-color: #4ade80; color: #4ade80; }
.panel-finish-btn { background: rgba(234,81,98,.2); border-color: var(--coral); color: var(--coral); }

.panel-status-bar {
  display: flex; align-items: center; gap: 1.5rem;
  padding: .6rem 2rem; background: rgba(0,0,0,.3);
  font-size: .85rem;
}
.status-badge {
  padding: .3rem .8rem; border-radius: 20px; font-weight: 700; font-size: .8rem;
}
.status-badge.status-active   { background: rgba(74,222,128,.2); color: #4ade80; border: 1px solid #4ade80; }
.status-badge.status-finished { background: rgba(108,153,221,.2); color: var(--blue); border: 1px solid var(--blue); }
.status-badge.status-draft    { background: rgba(255,255,255,.1); color: #9ca3af; border: 1px solid #4b5563; }
.session-name-label { flex: 1; font-weight: 600; }
.answered-count { color: var(--yellow); font-weight: 600; }

/* ── Panel Layout ────────────────────────────────────────── */
.panel-layout {
  display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem;
  padding: 1.5rem 2rem; min-height: calc(100vh - 180px);
}
@media (max-width: 1024px) {
  .panel-layout { grid-template-columns: 1fr; }
}

/* ── Board ───────────────────────────────────────────────── */
.board-wrapper { display: flex; flex-direction: column; }
.board-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.1rem; letter-spacing: .15em; color: var(--blue);
  text-align: center; margin-bottom: 1rem; opacity: .7;
}
.board {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px; width: 100%;
}

/* Tile base */
.tile {
  aspect-ratio: 1; border-radius: 12px;
  cursor: pointer; position: relative;
  border: 3px solid transparent; transition: border-color .2s, box-shadow .2s, filter .2s;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
  perspective: 700px;
}

/* 3D inner wrapper for flip */
.tile-inner {
  position: absolute; inset: 0; border-radius: 10px;
  transform-style: preserve-3d;
  transition: transform .55s cubic-bezier(.4,0,.2,1);
}
.tile--flipped .tile-inner { transform: rotateY(180deg); }

/* Front & back share same slot */
.tile-front, .tile-back {
  position: absolute; inset: 0; border-radius: 10px;
  backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}

/* Column colors on front */
.tile--orange .tile-front  { background: linear-gradient(135deg, #f59c44, #e8893a); }
.tile--yellow .tile-front  { background: linear-gradient(135deg, #fbeb87, #f4c500); }
.tile--purple .tile-front  { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.tile--blue   .tile-front  { background: linear-gradient(135deg, #6c99dd, #4070c0); }
.tile--pink   .tile-front  { background: linear-gradient(135deg, #f3a1c6, #e07aab); }

/* Back face: dark card */
.tile-back {
  transform: rotateY(180deg);
  background: rgba(10, 16, 48, .92);
  padding: .55rem .5rem;
  justify-content: flex-start;
  gap: .35rem;
  text-align: center;
  border: 1px solid rgba(255,255,255,.12);
}

/* Teacher panel tiles (no .tile-inner): keep old layout */
.tile > .tile-number,
.tile > .tile-check,
.tile > .tile-team-label { /* direct children — teacher board */ }

/* Front face content */
.tile-number {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: clamp(1rem, 2.5vw, 2rem);
  color: var(--gold);
  text-shadow: 0 2px 8px rgba(0,0,0,.5), 0 0 16px rgba(244,197,0,.4);
  line-height: 1;
}
/* Yellow front: darker number */
.tile--yellow .tile-front .tile-number { color: var(--navy); text-shadow: 0 1px 4px rgba(0,0,0,.2); }

/* Back face content */
.tile-back-num {
  font-family: 'Montserrat', sans-serif; font-size: .78rem; font-weight: 800;
  color: var(--gold); opacity: .8; align-self: flex-start; margin-left: .1rem;
}
.tile-back-title {
  font-size: clamp(.85rem, 1.35vw, 1.05rem); font-weight: 800; color: #f8fafc;
  text-shadow: 0 1px 4px rgba(0,0,0,.8); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; text-align: center; padding: 0 .15rem;
}
.tile-back-body {
  font-size: clamp(.68rem, .98vw, .82rem); color: rgba(255,255,255,.82);
  line-height: 1.5; text-align: center; padding: 0 .15rem;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tile-back-check {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 1rem; color: #4ade80; font-weight: 900;
}
.tile-back-team {
  font-size: clamp(.68rem, .95vw, .78rem); font-weight: 700;
  color: #fbbf24; text-align: center; letter-spacing: .02em;
  background: rgba(251,191,36,.18); border-radius: 999px;
  padding: .18rem .5rem; width: 100%; box-sizing: border-box;
}
.tile-back-deliberating {
  font-size: clamp(.58rem, .82vw, .68rem); color: rgba(251,191,36,.78);
  font-weight: 600; text-align: center; letter-spacing: .05em; text-transform: uppercase;
}

/* Teacher panel direct tiles (no tile-inner) */
.tile:not(:has(.tile-inner)) {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
/* Column colors for teacher panel tiles */
.tile--orange  { background: linear-gradient(135deg, #f59c44, #e8893a); }
.tile--yellow  { background: linear-gradient(135deg, #fbeb87, #f4c500); }
.tile--purple  { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.tile--blue    { background: linear-gradient(135deg, #6c99dd, #4070c0); }
.tile--pink    { background: linear-gradient(135deg, #f3a1c6, #e07aab); }
.tile--yellow > .tile-number { color: var(--navy); text-shadow: 0 1px 4px rgba(0,0,0,.2); }
.tile-check {
  position: absolute; top: 4px; right: 6px;
  font-size: .7rem; color: white; opacity: .9;
}
.tile-team-label {
  font-size: .55rem; font-weight: 600; color: rgba(255,255,255,.85);
  margin-top: 2px; text-align: center; max-width: 90%; line-height: 1.1;
  overflow: hidden; text-overflow: ellipsis;
}

.tile--available:hover {
  border-color: white; transform: scale(1.05);
  box-shadow: 0 0 0 2px white, 0 8px 24px rgba(0,0,0,.4);
  z-index: 1;
}
.tile--done {
  filter: brightness(.5) saturate(.5);
  cursor: not-allowed;
}
.tile--done:hover { transform: none; border-color: transparent; }
.tile--flipped:not(.tile--done) {
  border-color: rgba(251,191,36,.6);
  box-shadow: 0 0 0 2px rgba(251,191,36,.4), 0 4px 16px rgba(0,0,0,.4);
}

/* ── Panel Right ─────────────────────────────────────────── */
.panel-right { display: flex; flex-direction: column; gap: 1rem; }

.players-box {
  background: rgba(255,255,255,.05); border: 2px solid rgba(255,255,255,.15);
  border-radius: var(--radius); padding: 1rem; flex: 1;
}
.players-box-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: .9rem; letter-spacing: .12em; color: var(--yellow);
  margin-bottom: .75rem; text-align: center;
}
.players-list { display: flex; flex-direction: column; gap: .5rem; max-height: 320px; overflow-y: auto; }
.player-row {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  padding: .5rem .75rem; background: rgba(255,255,255,.06);
  border-radius: 8px; font-size: .82rem;
}
.player-name { flex: 1; font-weight: 600; color: white; }
.player-stats { display: flex; gap: .5rem; color: rgba(255,255,255,.7); font-size: .78rem; }
.coin-mini, .justice-mini, .progress-mini { white-space: nowrap; }
.progress-mini { opacity: .85; font-size: .8em; }
.player-links { display: flex; gap: .35rem; }
.link-small {
  font-size: .7rem; color: var(--blue); background: rgba(108,153,221,.2);
  padding: .1rem .4rem; border-radius: 4px; text-decoration: none;
}
.link-small:hover { background: rgba(108,153,221,.4); color: white; text-decoration: none; }

.qr-section { }
.qr-title {
  font-size: .8rem; font-weight: 600; color: rgba(255,255,255,.5);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: .5rem;
}
.qr-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.qr-item { text-align: center; }
.qr-img { width: 100%; max-width: 90px; border-radius: 6px; border: 2px solid rgba(255,255,255,.2); }
.qr-team-name { font-size: .65rem; color: rgba(255,255,255,.6); margin-top: .25rem; }

/* ── Panel Footer ────────────────────────────────────────── */
.panel-footer {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 2rem; background: rgba(0,0,0,.4);
  border-top: 1px solid rgba(255,255,255,.08);
}
.rodada-badge { display: flex; align-items: center; gap: .5rem; }
.rodada-label { font-size: .75rem; font-weight: 600; color: rgba(255,255,255,.5); letter-spacing: .08em; text-transform: uppercase; }
.rodada-number {
  background: var(--yellow); color: var(--navy); font-family: 'Montserrat', sans-serif;
  font-weight: 800; font-size: 1.4rem; padding: .1rem .6rem; border-radius: 6px;
  min-width: 52px; text-align: center;
}

/* ── Game Play Body (team view) ──────────────────────────── */
.game-play-body {
  background: var(--bg-dark);
  background-image:
    linear-gradient(var(--bg-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px);
  background-size: 40px 40px;
  min-height: 100vh; color: white;
}
.game-finished-banner {
  background: var(--navy-mid); color: white; text-align: center;
  padding: .75rem; font-weight: 600; font-size: .9rem;
}
.game-finished-banner a { color: var(--yellow); margin-left: .5rem; }

.game-header {
  display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: 1rem 1.5rem; background: rgba(0,0,0,.4);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.game-view-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.4rem; letter-spacing: .08em; flex: 1;
  text-align: center; color: white;
}
.game-team-badge {
  background: var(--navy-mid); color: var(--yellow); font-weight: 800;
  padding: .45rem 1rem; border-radius: 20px; font-size: 1rem;
}

/* ── Team View Layout ────────────────────────────────────── */
.team-view-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;
  padding: 1rem 1.5rem;
}
@media (max-width: 900px) {
  .team-view-layout { grid-template-columns: 1fr; }
}

.engagement-panel, .meters-panel { }
.engagement-panel { background: rgba(108,153,221,.12); border: 1px solid rgba(108,153,221,.2); }
.meters-panel { display: flex; flex-direction: column; gap: 1rem; }

.panel-section-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: .95rem; letter-spacing: .12em; color: var(--yellow);
  margin-bottom: 1rem; text-align: center;
  text-transform: uppercase;
}

/* Engagement rows */
.engagement-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  column-gap: .9rem;
  margin-bottom: .75rem;
}
.eng-icon-wrap {
  width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .2rem;
}
.eng-icon { width: 44px; height: 44px; object-fit: contain; }
.eng-label {
  width: 100%;
  font-size: .55rem;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255,255,255,.7);
  letter-spacing: .05em;
  text-align: center;
  line-height: 1.2;
}
.eng-bar-wrap { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.eng-bar-row { display: flex; gap: 3px; }
.eng-cell {
  flex: 1; height: 22px; border-radius: 4px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 600; color: rgba(255,255,255,.5);
  transition: all .3s;
}
.eng-cell--active {
  background: var(--cell-color, var(--blue));
  border-color: rgba(255,255,255,.3);
  color: rgba(0,0,0,.7); font-weight: 800;
}

/* Coins display */
.coins-display {
  display: flex; align-items: center; gap: .75rem;
  margin-top: 1rem; padding: .75rem 1rem;
  background: rgba(244,197,0,.15); border: 1px solid rgba(244,197,0,.3);
  border-radius: var(--radius-sm);
}
.coin-icon-big { width: 36px; height: 36px; }
.coins-info { display: flex; flex-direction: column; }
.coins-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; color: var(--gold); letter-spacing: .08em; }
.coins-value { font-size: 1.5rem; font-weight: 800; color: var(--yellow); }

/* Reputation meter */
.meter-card {
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
}
.meter-subtitle { font-size: .75rem; color: rgba(255,255,255,.5); text-align: center; margin-bottom: .75rem; margin-top: -.5rem; }
.rep-thermometer-wrap { display: flex; gap: .75rem; align-items: stretch; }
.rep-thermometer {
  width: 22px; border-radius: 11px 11px 50% 50%;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  position: relative; display: flex; align-items: flex-end; overflow: hidden;
  min-height: 140px;
}
.thermo-fill {
  width: 100%; background: linear-gradient(to top, var(--coral), var(--gold), #4ade80);
  border-radius: inherit; transition: height .5s;
}
.rep-table { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rep-row {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem .6rem; border-radius: 6px;
  font-size: .75rem; transition: all .2s;
  border: 1px solid transparent;
}
.rep-exemplar { background: rgba(74,222,128,.1); }
.rep-solida   { background: rgba(108,153,221,.1); }
.rep-neutra   { background: rgba(251,235,135,.1); }
.rep-fraca    { background: rgba(245,156,68,.1);  }
.rep-crise    { background: rgba(234,81,98,.1);   }
.rep-row--active { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12) !important; font-weight: 700; }
.rep-label { flex: 1; }
.rep-range { color: rgba(255,255,255,.6); min-width: 48px; text-align: right; }
.rep-bonus { font-weight: 700; color: var(--gold); min-width: 52px; text-align: right; }
.eng-avg-display { text-align: center; margin-top: .5rem; font-size: .8rem; color: rgba(255,255,255,.7); }
.eng-avg-display strong { color: var(--yellow); }

/* Justice meter */
.just-table { display: flex; flex-direction: column; gap: 4px; }
.just-row {
  display: flex; align-items: center; gap: .4rem;
  padding: .35rem .6rem; border-radius: 6px; font-size: .75rem;
  border: 1px solid transparent;
}
.just-perfect  { background: rgba(74,222,128,.1);  }
.just-good     { background: rgba(108,153,221,.1); }
.just-neutral  { background: rgba(251,235,135,.1); }
.just-bad      { background: rgba(245,156,68,.1);  }
.just-crisis   { background: rgba(234,81,98,.1);   }
.just-row--active { border-color: rgba(255,255,255,.4); background: rgba(255,255,255,.12) !important; font-weight: 700; }
.just-label { flex: 1; }
.just-range { color: rgba(255,255,255,.6); min-width: 54px; text-align: right; }
.just-bonus { font-weight: 700; color: var(--gold); min-width: 52px; text-align: right; }
.diff-display { text-align: center; margin-top: .5rem; font-size: .8rem; color: rgba(255,255,255,.7); }
.diff-display strong { color: var(--yellow); }

/* ── Game Board (team side) ──────────────────────────────── */
.game-board-section { padding: 1rem 1.5rem 2rem; }
.game-board-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 1.15rem; letter-spacing: .08em; color: var(--blue);
  text-align: center; margin-bottom: 1rem;
  text-transform: uppercase;
}
.game-board { }

.game-waiting {
  text-align: center; padding: 4rem 2rem; color: rgba(255,255,255,.6);
}
.waiting-icon { font-size: 3rem; margin-bottom: 1rem; }
.game-waiting h2 { color: white; font-size: 1.5rem; margin-bottom: .5rem; }

/* ── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 1rem; overflow-y: auto;
}
.modal-container {
  background: white; border-radius: var(--radius-lg);
  padding: 2rem; max-width: 960px; width: 100%;
  position: relative; box-shadow: var(--shadow-lg);
  max-height: 90vh; overflow-y: auto;
}
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(0,0,0,.1); border: none; cursor: pointer;
  font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: all .2s; box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.modal-close:hover { background: var(--coral); color: white; }

.event-header { text-align: center; margin-bottom: 1.5rem; }
.event-tag { font-size: .85rem; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--text-muted); }
.event-title {
  font-family: 'Montserrat', sans-serif; font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 800; color: var(--navy); margin: .25rem 0;
}
.event-desc { font-style: italic; color: var(--text-muted); font-size: 1.02rem; line-height: 1.7; max-width: 720px; margin: 0 auto; }
.event-decision-label {
  text-align: center; font-weight: 800; font-size: 1.22rem;
  text-decoration: underline; color: var(--navy); margin-bottom: 1rem;
}

.decisions-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr));
  gap: 1rem;
}
.decision-card {
  border-radius: var(--radius); padding: 1.35rem;
  cursor: pointer; transition: all .2s; position: relative;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .5rem;
}
.decision-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.dc-letter {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 2.3rem; color: var(--navy); line-height: 1;
}
.dc-text { font-size: 1rem; line-height: 1.65; color: var(--navy); flex: 1; }
.coin-line {
  display: flex; align-items: center; gap: .4rem;
  font-size: .98rem; font-weight: 700;
}
.coin-line.positive { color: #15803d; }
.coin-line.negative { color: var(--coral); }
.coin-icon-sm { width: 20px; height: 20px; }
.stake-badges-row { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .35rem; }
.stake-badge { display: flex; align-items: center; gap: .28rem; font-size: .82rem; font-weight: 700; }
.stake-icon { width: 24px; height: 24px; }
.stake-delta { font-weight: 800; }
.stake-delta.positive { color: #15803d; }
.stake-delta.negative { color: var(--coral); }
.dc-choose-btn { margin-top: auto; }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  padding: .75rem 1.5rem; border-radius: 30px;
  font-weight: 700; font-size: .9rem; z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  animation: fadeInUp .3s ease;
}
.toast--success { background: #15803d; color: white; }
.toast--error   { background: var(--coral); color: white; }
.toast--info    { background: var(--navy); color: white; }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Leaderboard ─────────────────────────────────────────── */
.leaderboard-body {
  background: linear-gradient(135deg, var(--navy) 0%, #1e1c35 100%);
  min-height: 100vh; padding: 2rem;
  display: flex; align-items: flex-start; justify-content: center;
}
.leaderboard-container { width: 100%; }
.leaderboard-header {
  text-align: center; margin-bottom: 1.5rem; color: white;
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
}
.lb-logo { display: flex; }
.lb-title {
  font-family: 'Montserrat', sans-serif; font-weight: 800;
  font-size: 2rem; letter-spacing: .15em; color: var(--yellow);
  text-shadow: 0 0 20px rgba(244,197,0,.4);
}
.lb-session { color: rgba(255,255,255,.7); font-size: .9rem; }
.lb-team-own { color: var(--blue); font-size: .9rem; }
.lb-actions { display: flex; gap: 1rem; margin-bottom: 1.5rem; justify-content: center; }
.leaderboard-body .btn-outline {
  background: rgba(255,255,255,.12);
  color: white;
  border-color: rgba(255,255,255,.35);
}
.leaderboard-body .btn-outline:hover {
  background: rgba(255,255,255,.22);
  border-color: rgba(255,255,255,.55);
  color: white;
}

/* Podium */
.podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: .5rem; margin-bottom: 2rem;
}
.podium-place { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.podium-crown { font-size: 1.5rem; }
.podium-name { color: white; font-weight: 700; font-size: .85rem; text-align: center; max-width: 100px; }
.podium-rep { color: var(--yellow); font-size: 1.1rem; font-weight: 800; }
.podium-block {
  width: 90px; display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; font-weight: 800; border-radius: 8px 8px 0 0; color: white;
}
.podium-block-1 { height: 100px; background: linear-gradient(135deg, #f4c500, #f59c44); }
.podium-block-2 { height: 75px; background: linear-gradient(135deg, #9ca3af, #6b7280); }
.podium-block-3 { height: 55px; background: linear-gradient(135deg, #f59c44, #b45309); }

/* LB Table */
.lb-table-container { border-radius: var(--radius); overflow-x: auto; overflow-y: hidden; box-shadow: var(--shadow-lg); }
.lb-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.lb-table th {
  background: var(--navy); color: var(--yellow); padding: .8rem .7rem;
  text-align: center; font-weight: 700; font-size: .78rem; text-transform: uppercase;
  letter-spacing: .05em;
}
.lb-table td { padding: .7rem .7rem; text-align: center; border-bottom: 1px solid rgba(255,255,255,.05); color: white; }
.lb-table th:first-child, .lb-table td:first-child { padding-left: 1rem; }
.lb-table th:last-child, .lb-table td:last-child { padding-right: 1rem; }
.lb-table tbody tr { background: rgba(255,255,255,.04); }
.lb-table tbody tr:hover { background: rgba(255,255,255,.08); }
.lb-top-1 td { background: rgba(244,197,0,.12) !important; }
.lb-top-2 td { background: rgba(156,163,175,.1)  !important; }
.lb-top-3 td { background: rgba(245,156,68,.1)   !important; }
.lb-own-team td { outline: 2px solid var(--blue); outline-offset: -2px; }
.lb-pos { font-size: 1.1rem; }
.lb-team-name { text-align: left; font-weight: 700; }
.lb-rep { font-size: 1rem; }
.lb-pts { color: rgba(255,255,255,.7); font-weight: 600; }
.lb-score { font-size: 1.05rem; cursor: help; }
.lb-highlight { color: var(--yellow) !important; font-weight: 800; }
.lb-coins { color: #4ade80; font-weight: 700; }
.podium-rep-unit { font-size: .6em; font-weight: 700; color: rgba(255,255,255,.65); }

.rep-rows { display: flex; flex-direction: column; gap: 4px; }
.reputation-scale { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ── Question selector (sessions/new) ───────────────────── */
.q-select-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap;
}
.q-select-counter {
  font-size: 1rem; font-weight: 700; color: var(--navy);
  white-space: nowrap; padding-top: .2rem;
}
.q-select-counter span { font-size: 1.4rem; color: var(--navy-mid); }
.q-select-actions { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }

.q-group { margin-bottom: 1.5rem; }
.q-group-title {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 700; font-size: .85rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .04em;
  margin-bottom: .6rem;
}
.q-group-count { font-weight: 400; }

.q-checklist { display: flex; flex-direction: column; gap: .4rem; }
.q-check-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .65rem .9rem; border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.q-check-item:hover { border-color: var(--blue); background: var(--blue-light); }
.q-check-item:has(.q-checkbox:checked) {
  border-color: var(--navy-mid); background: #eef2ff;
}
.q-checkbox { margin-top: .2rem; width: 16px; height: 16px; accent-color: var(--navy); flex-shrink: 0; }
.q-check-body { display: flex; flex-direction: column; gap: .15rem; }
.q-check-title { font-weight: 600; font-size: .9rem; color: var(--text); }
.q-check-preview { font-size: .78rem; color: var(--text-muted); line-height: 1.4; }

/* ── Single-row engagement bar ──────────────────────────── */
.eng-bar-single {
  display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto;
}
.eng-bar-single .eng-cell {
  min-width: 22px; max-width: 28px; flex: 1 1 0;
  height: 26px; line-height: 26px;
  border-radius: 3px; font-size: .65rem; font-weight: 700;
  text-align: center; cursor: default;
  font-variant-numeric: tabular-nums;
  background: #d1d5db; color: #6b7280;
  transition: background .2s, color .2s;
}
.eng-bar-single .eng-cell--active {
  background: var(--cell-color, #6c99dd);
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

@media (max-width: 640px) {
  .engagement-row {
    grid-template-columns: 72px minmax(0, 1fr);
    column-gap: .65rem;
  }

  .eng-icon-wrap {
    width: 72px;
  }

  .eng-icon {
    width: 38px;
    height: 38px;
  }
}

/* ── Turn banner ─────────────────────────────────────────── */
.turn-banner {
  text-align: center; padding: .75rem 1.5rem; border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; margin-bottom: 1rem;
  letter-spacing: .03em;
}
.turn-banner--mine {
  background: linear-gradient(135deg, #24356f, #3d55a8);
  color: #fff; animation: pulse-banner 1.5s ease-in-out infinite;
}
.turn-banner--waiting {
  background: #f1f5f9; color: #64748b; border: 2px dashed #cbd5e1;
}
.turn-banner--finished {
  background: #1e293b; color: #94a3b8; border: 2px solid #334155;
  font-weight: 600; letter-spacing: .02em;
}
@keyframes pulse-banner {
  0%,100% { opacity: 1; } 50% { opacity: .85; }
}

/* ── Active question notice (waiting teams) ──────────────── */
.active-question-notice {
  background: #fefce8; border: 2px solid #fbbf24;
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.aqn-label { font-size: .75rem; font-weight: 700; color: #92400e; text-transform: uppercase; margin-bottom: .35rem; }
.aqn-title { font-weight: 700; font-size: 1rem; color: #1e293b; margin-bottom: .3rem; }
.aqn-body  { font-size: .85rem; color: #475569; line-height: 1.5; }

/* ── Locked tile (not your turn) ─────────────────────────── */
.tile--locked {
  opacity: .5; cursor: not-allowed !important; pointer-events: none;
}

/* ── Current-turn bar (teacher panel) ───────────────────── */
.current-turn-bar {
  background: #eef2ff; border-radius: 6px; padding: .4rem .8rem;
  font-size: .85rem; color: #3730a3; font-weight: 600;
  margin-bottom: .75rem; text-align: center;
}
.player-row--active {
  background: linear-gradient(135deg, rgba(24, 39, 84, .96), rgba(34, 197, 94, .18));
  border-left: 3px solid #22c55e;
  box-shadow: inset 0 0 0 1px rgba(74, 222, 128, .28);
}
.player-row--active .player-name,
.player-row--active .player-stats,
.player-row--active .coin-mini,
.player-row--active .justice-mini,
.player-row--active .progress-mini {
  color: #f8fafc;
}
.player-row--active .link-small {
  color: #eff6ff;
  background: rgba(108,153,221,.3);
}
.player-row--active .link-small:hover {
  background: rgba(108,153,221,.48);
  color: #fff;
}
.turn-dot { color: #22c55e; font-size: .75rem; margin-right: .35rem; }

/* ── Panel toast ─────────────────────────────────────────── */
.panel-toast {
  position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; padding: .65rem 1.4rem;
  border-radius: 24px; font-size: .9rem; font-weight: 500;
  z-index: 9999; white-space: nowrap; display: none;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .main-content { padding: 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .navbar { padding: .75rem 1rem; }
  .navbar-menu { display: none; } /* mobile: simplify */
  .panel-layout { padding: .75rem; grid-template-columns: 1fr; }
  .board { gap: 6px; }
  .tile { border-radius: 8px; }
  .tile-number { font-size: 1rem; }
  .team-view-layout { padding: .85rem; gap: .85rem; }
  .leaderboard-body { padding: 1rem; }
  .decisions-grid { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; }

  .game-header {
    padding: 1rem .9rem .85rem;
    gap: .75rem;
    justify-content: center;
  }

  .game-header-logo svg {
    width: 30px;
    height: 30px;
  }

  .game-view-title {
    flex: 0 0 100%;
    order: 3;
    font-size: 1.1rem;
    letter-spacing: .06em;
  }

  .game-team-badge {
    font-size: .95rem;
    padding: .45rem .9rem;
  }

  .engagement-panel,
  .meter-card {
    padding: 1rem .9rem;
  }

  .panel-section-title {
    font-size: .9rem;
    margin-bottom: .8rem;
  }

  .engagement-row {
    grid-template-columns: 60px minmax(0, 1fr);
    column-gap: .55rem;
    margin-bottom: .95rem;
  }

  .eng-icon-wrap {
    width: 60px;
  }

  .eng-icon {
    width: 32px;
    height: 32px;
  }

  .eng-label {
    font-size: .5rem;
    line-height: 1.15;
  }

  .eng-bar-single {
    gap: 2px;
    overflow-x: auto;
    padding-bottom: .2rem;
  }

  .eng-bar-single .eng-cell {
    min-width: 20px;
    height: 24px;
    font-size: .62rem;
  }

  .coins-display {
    padding: .8rem .9rem;
  }

  .coins-value {
    font-size: 1.7rem;
  }

  .rep-thermometer-wrap {
    gap: .65rem;
  }

  .rep-row,
  .just-row {
    font-size: .82rem;
    padding: .45rem .55rem;
  }

  .game-board-section {
    padding: .85rem .85rem 1.5rem;
  }

  .game-board-title {
    font-size: 1rem;
    margin-bottom: .85rem;
  }

  .turn-banner {
    padding: .8rem .9rem;
    font-size: .95rem;
    line-height: 1.45;
  }

  .game-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .tile {
    aspect-ratio: 1 / 1.08;
    border-width: 2px;
    min-height: 132px;
  }

  .tile-front,
  .tile-back {
    border-radius: 8px;
  }

  .tile-back {
    padding: .75rem .55rem .65rem;
    gap: .38rem;
  }

  .tile-back-num {
    font-size: .82rem;
  }

  .tile-back-title {
    font-size: .94rem;
    -webkit-line-clamp: 3;
  }

  .tile-back-body {
    font-size: .8rem;
    line-height: 1.45;
    -webkit-line-clamp: 5;
  }

  .tile-back-team {
    font-size: .72rem;
    padding: .22rem .45rem;
  }

  .tile-back-deliberating {
    font-size: .62rem;
  }

  .game-waiting {
    padding: 3rem 1.2rem;
  }

  .game-waiting h2 {
    font-size: 1.35rem;
  }

  .modal-overlay {
    align-items: flex-end;
    padding: .5rem;
  }

  .modal-container {
    width: 100%;
    max-height: 92vh;
    padding: 1.15rem 1rem 1rem;
    border-radius: 22px 22px 0 0;
  }

  .event-header {
    margin-bottom: 1rem;
  }

  .event-tag {
    font-size: .78rem;
  }

  .event-title {
    font-size: 1.38rem;
    line-height: 1.2;
  }

  .event-desc {
    font-size: .98rem;
    line-height: 1.65;
  }

  .event-decision-label {
    font-size: 1rem;
    margin-bottom: .85rem;
  }

  .decision-card {
    padding: 1rem;
    gap: .65rem;
  }

  .dc-letter {
    font-size: 1.9rem;
  }

  .dc-text {
    font-size: .98rem;
    line-height: 1.6;
  }

  .coin-line {
    font-size: .95rem;
  }

  .stake-badge {
    font-size: .8rem;
  }

  .dc-choose-btn {
    width: 100%;
    justify-content: center;
    min-height: 46px;
    font-size: .95rem;
  }

  .toast {
    width: calc(100% - 1.5rem);
    bottom: 1rem;
    text-align: center;
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .game-board {
    grid-template-columns: 1fr;
  }

  .tile {
    aspect-ratio: 1 / .92;
    min-height: 148px;
  }

  .tile-back-title {
    font-size: 1rem;
  }

  .tile-back-body {
    font-size: .84rem;
  }

  .engagement-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .eng-icon-wrap {
    width: 54px;
  }

  .eng-bar-single .eng-cell {
    min-width: 18px;
    font-size: .58rem;
  }
}
