/* AMA Classroom Games — projector-ready board, scores, teacher checks */

#ama-arena-fs.cg-root,
.ama-arena-fs.cg-root {
 position: fixed;
 inset: 0;
 z-index: 13000;
 display: flex;
 flex-direction: column;
 overflow: auto;
 -webkit-overflow-scrolling: touch;
 color: #fff;
 background:
  radial-gradient(1100px 520px at 8% -10%, #1a3f8c 0%, transparent 58%),
  radial-gradient(900px 420px at 100% 100%, rgba(201, 149, 42, .18), transparent 50%),
  linear-gradient(180deg, #061028 0%, #0a1840 48%, #071226 100%);
 font-family: "Segoe UI", system-ui, sans-serif;
 padding: 0;
}
.ama-arena-fs.cg-root[hidden] { display: none !important; }

.cg-shell {
 width: min(1200px, 100%);
 margin: 0 auto;
 min-height: 100%;
 display: flex;
 flex-direction: column;
 padding: 14px 18px 28px;
 box-sizing: border-box;
}
.cg-bar {
 display: flex;
 align-items: center;
 gap: 12px;
}
.cg-bar__t { flex: 1; min-width: 0; }
.cg-bar__t p {
 margin: 0;
 letter-spacing: .18em;
 text-transform: uppercase;
 font-size: .7rem;
 font-weight: 800;
 opacity: .62;
}
.cg-bar__t h2 {
 margin: 2px 0 0;
 font: 800 clamp(1.35rem, 3vw, 2.05rem)/1.15 "Playfair Display", Georgia, serif;
}
.cg-x, .cg-full {
 width: 48px;
 height: 48px;
 border: 0;
 border-radius: 999px;
 background: rgba(255,255,255,.12);
 color: #fff;
 cursor: pointer;
 font-size: 1.05rem;
 flex: 0 0 auto;
}
.cg-x:hover, .cg-full:hover { background: rgba(255,255,255,.22); }

.cg-scores {
 display: grid;
 grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
 gap: 12px;
 margin: 16px 0 14px;
}
.cg-score {
 display: grid;
 grid-template-columns: 1fr auto;
 grid-template-rows: auto auto auto;
 column-gap: 10px;
 align-items: center;
 text-align: left;
 padding: 12px 16px 14px;
 border: 2px solid rgba(255,255,255,.08);
 border-radius: 18px;
 background: #101c3c;
 color: #fff;
 cursor: pointer;
 opacity: .55;
 box-shadow: inset 5px 0 0 var(--ac, #c8102e);
}
.cg-score.is-turn {
 opacity: 1;
 border-color: #f5d76e;
 background: #1b3a78;
 box-shadow: inset 6px 0 0 var(--ac, #c8102e), 0 0 0 3px #f5d76e, 0 12px 28px rgba(245, 215, 110, .28);
 transform: scale(1.03);
}
.cg-score__now {
 grid-column: 1 / -1;
 font-size: .72rem;
 font-weight: 800;
 letter-spacing: .16em;
 text-transform: uppercase;
 opacity: .5;
}
.cg-score.is-turn .cg-score__now {
 opacity: 1;
 color: #f5d76e;
}
.cg-score__name {
 width: 100%;
 min-width: 0;
 border: 0;
 background: transparent;
 color: #fff;
 font-weight: 800;
 font-size: 1.15rem;
 letter-spacing: .01em;
 padding: 2px 0;
 outline: none;
}
.cg-score__name::placeholder { color: rgba(255,255,255,.4); }
.cg-score.is-turn .cg-score__name { font-size: 1.35rem; }
.cg-score__pts {
 grid-column: 2;
 grid-row: 2 / span 2;
 font: 800 clamp(2.1rem, 6vw, 3.3rem)/1 "Playfair Display", Georgia, serif;
 color: #f5d76e;
}
.cg-score em {
 font-style: normal;
 font-size: .7rem;
 letter-spacing: .14em;
 text-transform: uppercase;
 opacity: .5;
}
.cg-turnline {
 margin: 0 0 14px;
 text-align: center;
 font-size: clamp(1.15rem, 3vw, 1.7rem);
 font-weight: 700;
}
.cg-turnline b {
 color: #f5d76e;
 font: 800 1.05em/1 "Playfair Display", Georgia, serif;
 padding: 2px 10px;
 border-radius: 999px;
 background: rgba(245, 215, 110, .16);
}

.cg-stage { flex: 1; }
.cg-help {
 margin: 0 0 12px;
 opacity: .82;
 font-size: .95rem;
}
.cg-help b { color: #f5d76e; }

.cg-board {
 display: grid;
 grid-template-columns: repeat(4, minmax(0, 1fr));
 gap: 12px;
 margin: 4px 0 18px;
}
.cg-tile {
 aspect-ratio: 1.2 / 1;
 min-height: 92px;
 border: 0;
 border-radius: 16px;
 background: linear-gradient(180deg, #2260c8 0%, #0d2e7a 100%);
 color: #fff;
 font: 800 clamp(1.55rem, 4.2vw, 2.55rem)/1 "Playfair Display", Georgia, serif;
 box-shadow: 0 12px 26px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.22);
 cursor: pointer;
}
.cg-tile:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.cg-tile.is-hot {
 background: linear-gradient(180deg, #d97706 0%, #9a3412 100%);
}
.cg-tile.is-used {
 background: #152038;
 color: #4b5878;
 box-shadow: none;
 cursor: default;
}

.cg-q {
 background: #fff;
 color: #0b1f4d;
 border-radius: 24px;
 padding: 26px 26px 20px;
 max-width: 820px;
 margin: 0 auto;
 box-shadow: 0 24px 50px rgba(0,0,0,.28);
}
.cg-q--twist {
 background: linear-gradient(180deg, #fff8e8, #fff);
 border: 2px solid #e8c547;
}
.cg-kicker {
 letter-spacing: .16em;
 text-transform: uppercase;
 font-weight: 800;
 font-size: .72rem;
 color: #8a6410;
 margin: 0 0 8px;
}
.cg-prompt { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.45; }
.cg-big {
 margin: 4px 0 16px;
 font: 800 clamp(1.9rem, 5vw, 3.3rem)/1.12 "Playfair Display", Georgia, serif;
 color: #0a1a4a;
}
.cg-forbid {
 background: #fff1f2;
 border: 1px solid #fecdd3;
 border-radius: 12px;
 padding: 10px 12px;
 color: #9f1239;
}
.cg-ans {
 background: #ecfdf5;
 border: 1px solid #6ee7b7;
 border-radius: 14px;
 padding: 12px 14px;
 font-weight: 700;
 color: #065f46;
 margin: 12px 0 0;
}
.cg-judge {
 display: flex;
 flex-wrap: wrap;
 gap: 10px;
 margin-top: 18px;
}
.cg-btn {
 min-height: 52px;
 border: 0;
 border-radius: 14px;
 padding: 0 18px;
 font-weight: 800;
 cursor: pointer;
 background: #e8eefc;
 color: #0b1f4d;
 font-size: .95rem;
}
.cg-btn i { margin-right: 6px; }
.cg-btn small { opacity: .82; margin-left: 6px; font-weight: 700; }
.cg-btn--check { background: #0b2a6f; color: #fff; }
.cg-btn--go { background: #047857; color: #fff; }
.cg-btn--no { background: #be123c; color: #fff; }
.cg-btn--listen { background: #1d4ed8; color: #fff; margin-top: 4px; }
.cg-btn--xl { width: 100%; min-height: 58px; font-size: 1.08rem; margin-top: 8px; }

.cg-setup {
 width: min(640px, 100%);
 margin: 18px auto 0;
 background: #fff;
 color: #0b1f4d;
 border-radius: 24px;
 padding: 24px;
}
.cg-setup p { margin: 0 0 16px; line-height: 1.5; }
.cg-setup label, .cg-names label {
 display: grid;
 gap: 6px;
 font-weight: 800;
 margin-bottom: 12px;
}
.cg-setup select, .cg-names input {
 min-height: 48px;
 border-radius: 12px;
 border: 1px solid #c9d6f2;
 padding: 8px 12px;
 font: 600 1rem system-ui, sans-serif;
}
.cg-clock {
 margin: 0 0 10px;
 font: 800 clamp(2.4rem, 7vw, 4rem)/1 "Playfair Display", Georgia, serif;
 color: #f5d76e;
 text-align: center;
}
.cg-split {
 display: grid;
 grid-template-columns: 1fr 1fr;
 gap: 12px;
 margin: 8px 0 18px;
}
.cg-split__a, .cg-split__b {
 margin: 0;
 padding: 22px 16px;
 border-radius: 18px;
 font: 800 1.25rem/1.25 "Playfair Display", Georgia, serif;
 text-align: center;
}
.cg-split__a { background: #e8eefc; color: #0b2a6f; }
.cg-split__b { background: #fef3c7; color: #7c4a00; }

.cg-win {
 width: min(560px, 100%);
 margin: 12px auto 0;
 background: #fff;
 color: #0b1f4d;
 border-radius: 24px;
 padding: 28px;
 text-align: center;
 position: relative;
 overflow: hidden;
}
.cg-win--party { padding-top: 36px; }
.cg-trophy {
 font-size: clamp(3.4rem, 10vw, 5.4rem);
 color: #d4a017;
 animation: cgTrophy 1.2s ease infinite alternate;
}
.cg-dancers {
 display: flex;
 justify-content: center;
 gap: 18px;
 margin: 8px 0 12px;
}
.cg-dancers span {
 width: 14px;
 height: 36px;
 border-radius: 8px;
 background: #0b2a6f;
 animation: cgDance .45s ease-in-out infinite alternate;
}
.cg-dancers span:nth-child(2) { background: #c8102e; animation-delay: .12s; height: 42px; }
.cg-dancers span:nth-child(3) { background: #d4a017; animation-delay: .24s; }
.cg-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cg-confetti span {
 position: absolute;
 top: -12px;
 left: var(--x);
 width: 8px;
 height: 14px;
 background: var(--c);
 border-radius: 2px;
 animation: cgFall var(--d) linear infinite;
}
@keyframes cgTrophy {
 from { transform: translateY(0) rotate(-8deg); }
 to { transform: translateY(-10px) rotate(8deg); }
}
@keyframes cgDance {
 from { transform: translateY(6px) rotate(-12deg); }
 to { transform: translateY(-8px) rotate(12deg); }
}
@keyframes cgFall {
 0% { transform: translateY(0) rotate(0); opacity: 1; }
 100% { transform: translateY(420px) rotate(240deg); opacity: .2; }
}
.cg-win h3 {
 margin: 4px 0 6px;
 font: 800 clamp(1.8rem, 4vw, 2.6rem)/1.15 "Playfair Display", Georgia, serif;
}
.cg-win__pts { font-size: 1.2rem; font-weight: 800; color: #8a6410; }
.cg-win ul { list-style: none; padding: 0; margin: 16px 0 20px; }
.cg-win li {
 display: flex;
 justify-content: space-between;
 padding: 8px 0;
 border-bottom: 1px solid #e8eefc;
 font-weight: 700;
}

.cg-flash {
 position: fixed;
 inset: 0;
 display: grid;
 place-items: center;
 font: 800 clamp(2.6rem, 8vw, 5rem)/1 "Playfair Display", Georgia, serif;
 pointer-events: none;
 z-index: 14000;
 animation: cgPop .9s ease;
 text-shadow: 0 10px 30px rgba(0,0,0,.35);
}
.cg-flash--well { color: #34d399; }
.cg-flash--oops { color: #fb7185; }
@keyframes cgPop {
 0% { transform: scale(.6); opacity: 0; }
 25% { opacity: 1; transform: scale(1.06); }
 100% { opacity: 0; transform: scale(1.12); }
}

/* Hub cards — no fake high scores */
#view-fun .game-card__best { display: none !important; }
#view-fun .game-card__diff { display: none !important; }
#view-fun .play-hero h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
#view-fun .games-picker--pro {
 display: grid;
 grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
 gap: 16px;
}
html.ama-arena-open .ama-refresh-fab,
html.ama-arena-open #ama-refresh-fab,
html.ama-arena-open #ama-tv-fit {
 display: none !important;
}

@media (max-width: 720px) {
 .cg-board { gap: 8px; }
 .cg-tile { min-height: 68px; border-radius: 12px; }
 .cg-judge { flex-direction: column; }
 .cg-btn { width: 100%; }
 .cg-q, .cg-setup, .cg-win { padding: 18px; border-radius: 18px; }
}
