/* GameKit: shared look of the board games. Colours and fonts come from the lesson theme
   (public/themes/*.css: --bg, --fg, --muted, --accent, --accent2, --line, --card, --card-fg, --f-display, --f-body).
   Each module adds its own CSS (prefix .gm-<module>-). Canvas: 1920×1080. */

.gk .gk-screen { position: absolute; inset: 0; overflow: hidden; background: var(--bg); color: var(--fg); font-family: var(--f-body); font-size: 32px; line-height: 1.35; }
.gk .gk-screen .orn { position: absolute; pointer-events: none; display: block; }
.gk .gk-screen .orn-emblem { display: none; }
.gk .gk-screen > .orn-frame { display: none; }
.gk .gk-head { position: absolute; left: 0; right: 0; top: 0; height: 112px; display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 0 60px; z-index: 3; }
.gk .gk-screen[data-phase="intro"] .gk-title { visibility: hidden; }
.gk .gk-title { display: flex; flex-direction: column; min-width: 0; max-width: 1060px; flex: 1 1 auto; }
.gk .gk-title span { font-size: 19px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.gk .gk-title b { font-family: var(--f-display); font-weight: var(--title-weight, 700); font-size: 31px; line-height: 1.08; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; text-wrap: balance; }
.gk .gk-main { position: absolute; left: 0; right: 0; top: 112px; bottom: 0; padding: 10px 60px 50px; }
.gk .gk-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.gk .gk-layer > * { pointer-events: auto; }

/* scoreboard */
.gk .gk-score { display: flex; gap: 12px; flex-wrap: nowrap; justify-content: flex-end; min-width: 0; flex: none; }
.gk .gk-score.n4 .gk-chip { padding: 8px 14px 8px 12px; font-size: 19px; gap: 9px; }
.gk .gk-score.n4 .gk-chip span { max-width: 150px; }
.gk .gk-score.n4 .gk-chip b { font-size: 30px; }
.gk .gk-score.n3 .gk-chip span { max-width: 180px; }
.gk .gk-chip { --tc: #e5a53b; position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 20px 10px 16px; border-radius: 14px; border: 2px solid transparent; background: var(--card); color: var(--card-fg, var(--fg)); font: 600 22px var(--f-body); cursor: pointer; transition: transform .2s, border-color .2s, box-shadow .2s; }
.gk .gk-chip i { width: 16px; height: 16px; border-radius: 50%; background: var(--tc); flex: none; }
.gk .gk-chip span { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gk .gk-chip b { font-variant-numeric: lining-nums tabular-nums; font-family: var(--f-display); font-size: 36px; line-height: 1; min-width: 1.2em; text-align: right; font-variant-numeric: tabular-nums; }
.gk .gk-chip.on { border-color: var(--tc); box-shadow: 0 0 0 6px color-mix(in srgb, var(--tc) 25%, transparent); transform: translateY(-3px); }
.gk .gk-chip.on::after { content: ""; position: absolute; left: 50%; bottom: -14px; margin-left: -9px; border: 9px solid transparent; border-top-color: var(--tc); }
.gk .gk-chip em { font-style: normal; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--tc); color: #fff; font-size: 28px; line-height: 1; }
.gk .gk-chip.bump { animation: gk-bump .6s ease; }
.gk .gk-chip.drop { animation: gk-drop .6s ease; }
@keyframes gk-bump { 30% { transform: scale(1.14); } }
@keyframes gk-drop { 30% { transform: translateX(-8px); } 60% { transform: translateX(8px); } }

/* buttons */
.gk .gk-btn { --tc: var(--accent); display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 76px; padding: 0 38px; border-radius: 999px; border: 0; cursor: pointer; background: var(--accent); color: var(--bg); font: 700 30px var(--f-body); box-shadow: 0 6px 0 color-mix(in srgb, var(--accent) 55%, #000); transition: transform .08s, box-shadow .08s, opacity .2s; }
.gk .gk-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 55%, #000); }
.gk .gk-btn.ghost { background: transparent; color: var(--fg); border: 2px solid var(--line); box-shadow: none; }
.gk .gk-btn.small { min-height: 58px; padding: 0 24px; font-size: 24px; box-shadow: none; }
.gk .gk-btn.small i { width: 14px; height: 14px; border-radius: 50%; background: var(--tc); }
.gk .gk-btn:disabled { opacity: .35; cursor: default; }
.gk .gk-big { min-height: 96px; font-size: 36px; padding: 0 60px; }
.gk .gk-award { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.gk .gk-award > span { font-size: 24px; color: var(--muted); margin-right: 6px; }

/* start screen */
.gk .gk-intro { position: absolute; inset: 0 60px 60px; display: grid; grid-template-columns: 1fr 640px; gap: 80px; align-items: center; }
.gk .gk-intro-text h1 { font-family: var(--f-display); font-weight: var(--title-weight, 700); font-size: 92px; line-height: 1; margin: 0 0 30px; text-transform: var(--title-case, none); letter-spacing: var(--title-track, 0); color: var(--title, var(--fg)); text-wrap: balance; }
.gk .gk-intro-text .kicker { font-family: var(--f-kicker, var(--f-body)); font-size: var(--kicker-size, 24px); letter-spacing: var(--kicker-track, .16em); text-transform: var(--kicker-case, uppercase); color: var(--kicker, var(--accent)); font-weight: var(--kicker-weight, 700); margin-bottom: 18px; }
.gk .gk-emblem { position: relative !important; margin-bottom: 28px; }
.gk .gk-story { font-family: var(--f-text, var(--f-body)); font-size: 34px; line-height: 1.45; margin: 0 0 36px; max-width: 980px; }
.gk .gk-howto { display: grid; gap: 6px; padding: 22px 28px; border-left: 6px solid var(--accent); background: var(--card); color: var(--card-fg, var(--fg)); font-size: 25px; max-width: 980px; }
.gk .gk-howto b { font-size: 18px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.gk .gk-setup { display: grid; gap: 30px; padding: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; color: var(--card-fg, var(--fg)); }
.gk .gk-row { display: grid; gap: 12px; }
.gk .gk-row label { font-size: 20px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.gk .gk-seg { display: flex; flex-wrap: wrap; gap: 10px; }
.gk .gk-seg button { min-height: 64px; min-width: 64px; padding: 0 22px; border-radius: 14px; border: 2px solid var(--line); background: transparent; color: inherit; font: 600 25px var(--f-body); cursor: pointer; }
.gk .gk-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.gk .gk-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gk .gk-name { --tc: #e5a53b; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--line); }
.gk .gk-name i { width: 16px; height: 16px; border-radius: 50%; background: var(--tc); flex: none; }
.gk .gk-name input { min-width: 0; width: 100%; border: 0; background: transparent; color: inherit; font: 600 24px var(--f-body); padding: 14px 0; outline: none; }

/* final screen */
.gk .gk-final { position: absolute; inset: 0 60px 50px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; text-align: center; }
.gk .gk-final h1 { font-family: var(--f-display); font-weight: var(--title-weight, 700); font-size: 86px; margin: 0; color: var(--title, var(--fg)); }
.gk .gk-podium { display: flex; align-items: flex-end; gap: 26px; height: 470px; padding-top: 80px; }
.gk .gk-pod { --tc: #e5a53b; width: 280px; height: var(--h); min-height: 150px; border-radius: 22px 22px 6px 6px; background: linear-gradient(180deg, var(--tc), color-mix(in srgb, var(--tc) 60%, #000)); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 24px; position: relative; animation: gk-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
.gk .gk-pod.p1 { animation-delay: .3s; } .gk .gk-pod.p3 { animation-delay: .15s; }
.gk .gk-pod b { font-family: var(--f-display); font-size: 76px; line-height: 1; }
.gk .gk-pod span { font-size: 26px; font-weight: 700; margin-top: 10px; padding: 0 12px; }
.gk .gk-pod i { position: absolute; top: -74px; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 34px; font-family: var(--f-display); background: var(--card); color: var(--fg); border: 3px solid var(--tc); }
.gk .gk-pod.p1 i { background: var(--tc); color: #fff; }
@keyframes gk-rise { from { transform: scaleY(0); transform-origin: bottom; } to { transform: scaleY(1); transform-origin: bottom; } }
.gk .gk-solo b { font-family: var(--f-display); font-size: 200px; line-height: 1; color: var(--accent); display: block; }
.gk .gk-solo span { font-size: 30px; color: var(--muted); }
.gk .gk-line, .gk .gk-rest { margin: 0; font-size: 28px; color: var(--muted); }
.gk .gk-actions { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }

/* timer ring */
.gk .gk-timer { --p: 1; position: relative; width: 112px; height: 112px; flex: none; }
.gk .gk-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gk .gk-timer circle { fill: none; stroke: var(--line); stroke-width: 8; }
.gk .gk-timer circle.arc { stroke: var(--accent); stroke-dasharray: 276.5; stroke-dashoffset: calc(276.5 * (1 - var(--p))); stroke-linecap: round; transition: stroke-dashoffset .9s linear; }
.gk .gk-timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-display); font-size: 44px; font-variant-numeric: tabular-nums; }
.gk .gk-timer.low circle.arc { stroke: #e0574a; }
.gk .gk-timer.low b { color: #e0574a; animation: gk-pulse 1s infinite; }
@keyframes gk-pulse { 50% { transform: scale(1.12); } }

/* modal and toast */
.gk .gk-modal { position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); display: grid; place-items: center; animation: gk-fade .25s ease; }
.gk .gk-modal-in { width: min(1500px, 90%); max-height: 90%; overflow: auto; background: var(--card); color: var(--card-fg, var(--fg)); border: 1px solid var(--line); border-radius: 28px; padding: 56px 64px; box-shadow: 0 40px 90px rgba(0, 0, 0, .4); background-color: var(--bg2, var(--bg)); }
@keyframes gk-fade { from { opacity: 0; } }
.gk .gk-toast { position: absolute; left: 50%; top: 150px; transform: translateX(-50%); padding: 20px 40px; border-radius: 18px; background: var(--fg); color: var(--bg); font: 700 34px var(--f-body); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); animation: gk-drop-in .35s cubic-bezier(.2, .8, .2, 1); transition: opacity .35s, transform .35s; max-width: 1400px; text-align: center; }
.gk .gk-toast.ok { background: #2f9a63; color: #fff; } .gk .gk-toast.bad { background: #c8473d; color: #fff; }
.gk .gk-toast.out { opacity: 0; transform: translate(-50%, -20px); }
@keyframes gk-drop-in { from { transform: translate(-50%, -40px); opacity: 0; } }
.gk .gk-burst { position: absolute; width: 10px; height: 10px; pointer-events: none; }
.gk .gk-burst::before, .gk .gk-burst::after { content: ""; position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; border-radius: 50%; border: 6px solid #2f9a63; animation: gk-ring .8s ease-out forwards; }
.gk .gk-burst::after { animation-delay: .12s; }
.gk .gk-burst.bad::before, .gk .gk-burst.bad::after { border-color: #c8473d; }
@keyframes gk-ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }

/* drag ghost */
.gk .gk-ghost { position: absolute; z-index: 30; pointer-events: none; opacity: .92; transform: rotate(-2deg) scale(1.04); box-shadow: 0 24px 50px rgba(0, 0, 0, .35); }
.gk .gk-dragging { opacity: .3; }

/* common answer feedback used by modules */
.gk .gk-explain { padding: 22px 30px; border-radius: 16px; background: var(--card); color: var(--card-fg, var(--fg)); border-left: 8px solid var(--accent2, var(--accent)); font-size: 28px; line-height: 1.42; }
.gk .gk-explain.ok { border-left-color: #2f9a63; } .gk .gk-explain.bad { border-left-color: #c8473d; }
.gk .gk-explain > b:first-child { margin-right: 8px; }
.gk .gk-pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px; border-radius: 999px; background: var(--card); color: var(--card-fg, var(--fg)); font-size: 22px; font-weight: 600; }
.gk .gk-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gk img.gk-zoom { cursor: zoom-in; }

/* standalone countdown */
.gk-countdown { position: fixed; inset: 0; z-index: 100; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 40px; font-family: var(--f-body); }
.gk-countdown .gk-cd-num { font-family: var(--f-display); font-size: min(34vw, 60vh); line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.gk-countdown .gk-cd-num.low { color: #e0574a; }
.gk-countdown .gk-btn { min-height: 60px; font-size: 22px; }
