/* Khel ON game side panel (Option A): shared look for the turn card, players, last moves, invite card and "Ready?" card.
   One copy per game folder (like kstep.css). The game sets --cur (current player's colour). */
.gp-side { --gp-panel: #1c2133; --gp-line: rgba(255, 255, 255, .08); --gp-muted: #a9adc8; --gp-teal: #2fd4c8;
  container-type: inline-size; container-name: gpside; min-width: 0; font-family: Nunito, system-ui, sans-serif; color: #f5f3ff; }
.gp-grid { min-width: 0; height: 100%; display: grid; gap: 14px; align-content: start;
  grid-template-columns: minmax(0, 1fr); grid-template-areas: "turn" "tip" "players" "moves" "invite"; }
.gp-turn { grid-area: turn; }
.gp-tip { grid-area: tip; }
.gp-players { grid-area: players; }
.gp-moves { grid-area: moves; }
.gp-invite { grid-area: invite; }

/* turn card */
.gp-turn { position: relative; display: flex; align-items: center; gap: 18px; padding: 22px 24px; border-radius: 22px; background: var(--gp-panel);
  border: 2px solid var(--gp-line); transition: border-color .2s, box-shadow .2s; }
.gp-turn.mine { border-color: var(--cur, #2fd4c8); box-shadow: 0 0 0 4px rgba(255, 255, 255, .04), 0 0 34px -6px var(--cur, #2fd4c8); }
.gp-tt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.gp-kicker { display: flex; align-items: center; gap: 8px; font: 800 13px/1 Nunito, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-muted); }
.gp-kicker i { width: 12px; height: 12px; border-radius: 50%; background: var(--cur, #2fd4c8); flex: none; }
.gp-who { margin: 0; font: 800 30px/1.12 Outfit, system-ui, sans-serif; letter-spacing: -.2px; overflow-wrap: anywhere; }
.gp-hint { margin: 0; font-size: 16px; line-height: 1.4; color: #c3c6de; font-weight: 700; }
.gp-act { flex: none; }
.gp-btn { appearance: none; border: 0; border-radius: 999px; min-height: 56px; padding: 0 26px; background: linear-gradient(135deg, #ff9a3c, #f04fa8); color: #241024;
  font: 800 19px/1 Outfit, system-ui, sans-serif; cursor: pointer; white-space: nowrap; box-shadow: 0 10px 26px -8px rgba(240, 79, 168, .7); }
.gp-btn:disabled { background: #2a3048; color: #7d84a3; box-shadow: none; cursor: default; }
.gp-btn.glow:not(:disabled) { animation: gp-glow 1.6s ease-in-out infinite; }
@keyframes gp-glow { 50% { box-shadow: 0 0 0 6px rgba(255, 154, 60, .18), 0 10px 30px -6px rgba(240, 79, 168, .9); } }

/* tip (the coach) */
.gp-tip { margin: 0; padding: 14px 18px; border-radius: 18px; background: #1a2637; border-left: 4px solid var(--gp-teal); font-weight: 700; font-size: 16px; line-height: 1.4; color: #e6f6f5; }

/* cards */
.gp-card { padding: 16px 18px 14px; border-radius: 22px; background: var(--gp-panel); min-width: 0; }
.gp-card h3 { margin: 0 0 10px; font: 800 13px/1 Nunito, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--gp-muted); }
.gp-card ul, .gp-card ol { list-style: none; margin: 0; padding: 0; }

/* players */
.gp-p { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 8px 10px; margin: 0 -10px; border-radius: 14px; }
.gp-p + .gp-p { margin-top: 2px; }
.gp-p.cur { background: rgba(255, 255, 255, .06); }
.gp-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font: 800 16px Outfit, system-ui, sans-serif; color: #fff; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55); }
.gp-p.cur .gp-av { box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px rgba(255, 255, 255, .18); }
.gp-pt { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.gp-pt b { font: 800 17px/1.2 Outfit, system-ui, sans-serif; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-pt small { font-size: 13px; color: var(--gp-muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-bar { display: block; height: 6px; margin-top: 5px; border-radius: 9px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.gp-bar i { display: block; height: 100%; border-radius: 9px; transition: width .4s; }
.gp-stat { font: 800 15px/1.1 Outfit, system-ui, sans-serif; color: #e9e7f7; white-space: nowrap; text-align: right; }
.gp-stat em { font-style: normal; }

/* last moves */
.gp-moves li { display: flex; align-items: flex-start; gap: 10px; padding: 5px 0; font-size: 15px; font-weight: 700; color: #c3c6de; line-height: 1.35; }
.gp-moves li:first-child { color: #f5f3ff; }
.gp-moves li i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; }
.gp-moves li.gp-empty { color: #7d84a3; }

/* invite card */
.gp-invite { appearance: none; display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 18px; border-radius: 22px; text-align: left; cursor: pointer;
  border: 2px dashed rgba(47, 212, 200, .6); background: rgba(47, 212, 200, .06); color: #f5f3ff; font-family: Nunito, system-ui, sans-serif; }
.gp-invite:hover { background: rgba(47, 212, 200, .12); border-color: var(--gp-teal); }
.gp-invite:focus-visible { outline: 3px solid var(--gp-teal); outline-offset: 2px; }
.gp-inv-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--gp-teal); display: grid; place-items: center; }
.gp-inv-ic svg { width: 24px; height: 24px; fill: none; stroke: #0e2422; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.gp-inv-t { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gp-inv-t b { font: 800 17px/1.2 Outfit, system-ui, sans-serif; color: var(--gp-teal); }
.gp-inv-t small { font-size: 14px; line-height: 1.35; color: #c3c6de; font-weight: 600; }

/* desktop single column: last moves stretches so the panel reaches the bottom of the board */
@media (min-width: 900px) { .gp-grid { grid-template-rows: auto auto auto minmax(0, 1fr) auto; align-content: stretch; } }
/* wide panel: two columns, the turn card standing tall on the left */
@container gpside (min-width: 560px) {
  .gp-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "turn players" "turn moves" "tip invite"; grid-template-rows: auto 1fr auto; align-content: stretch; }
  .gp-turn { flex-direction: column; justify-content: center; text-align: center; gap: 26px; padding: 30px 22px; }
  .gp-turn .gp-tt { flex: none; align-items: center; }
  .gp-who { font-size: 34px; }
  .gp-moves { align-self: stretch; }
  .gp-grid:not(:has(> .gp-tip:not([hidden]))) { grid-template-areas: "turn players" "turn moves" "turn invite"; }
  .gp-grid:has(> .gp-invite[hidden]) { grid-template-areas: "turn players" "turn moves" "tip moves"; }
  .gp-grid:not(:has(> .gp-tip:not([hidden]))):has(> .gp-invite[hidden]) { grid-template-areas: "turn players" "turn moves" "turn moves"; }
}

/* "Ready? Start game" over the board */
.gp-ready { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; padding: 16px; border-radius: inherit; background: rgba(18, 21, 33, .62); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.gp-ready-box { width: min(100%, 400px); padding: 30px 28px 28px; border-radius: 26px; background: #1c2133; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.gp-ready-box h2 { margin: 0; font: 800 38px/1.1 Outfit, system-ui, sans-serif; color: #f5f3ff; }
.gp-ready-box p { margin: 0 0 6px; font-size: 17px; line-height: 1.45; color: #c3c6de; font-weight: 700; }
.gp-go { appearance: none; border: 0; border-radius: 999px; height: 62px; background: linear-gradient(135deg, #ff9a3c, #f04fa8); color: #241024; font: 800 22px/1 Outfit, system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 12px 30px -8px rgba(240, 79, 168, .75); animation: gp-glow 1.6s ease-in-out infinite; }
.gp-go:hover { filter: brightness(1.06); }
.gp-go:focus-visible { outline: 3px solid #2fd4c8; outline-offset: 3px; }

/* phone and narrow screens: compact turn card and a players strip under the board */
@media (max-width: 899px) {
  .gp-grid { gap: 10px; grid-template-areas: "turn" "players" "tip"; }
  .gp-moves, .gp-invite { display: none !important; }
  .gp-turn { padding: 12px 14px 12px 18px; gap: 12px; border-radius: 20px; }
  .gp-kicker { font-size: 11px; }
  .gp-who { font-size: 22px; }
  .gp-hint { font-size: 14px; }
  .gp-btn { min-height: 50px; padding: 0 20px; font-size: 17px; }
  .gp-tip { padding: 10px 14px; font-size: 14px; border-radius: 14px; }
  .gp-players { padding: 8px; border-radius: 18px; }
  .gp-players h3 { display: none; }
  .gp-players ul { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .gp-p { margin: 0; padding: 6px 5px; grid-template-columns: 18px minmax(0, 1fr); grid-template-rows: auto auto; gap: 0 6px; border-radius: 12px; }
  .gp-p + .gp-p { margin-top: 0; }
  .gp-av { width: 18px; height: 18px; font-size: 0; grid-row: 1 / span 2; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55); }
  .gp-p.cur .gp-av { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px rgba(255, 255, 255, .25); }
  .gp-pt b { font-size: 13px; }
  .gp-pt small, .gp-bar { display: none; }
  .gp-stat { grid-column: 2; font-size: 12px; text-align: left; color: #c3c6de; }
  .gp-stat em { display: none; }
  .gp-ready-box { padding: 22px 20px 20px; gap: 8px; }
  .gp-ready-box h2 { font-size: 30px; }
  .gp-ready-box p { font-size: 15px; }
  .gp-go { height: 56px; font-size: 20px; }
}
/* short desktop screens (e.g. 1568×772): tighter rows so the whole panel fits beside the board */
@media (min-width: 900px) and (max-height: 820px) {
  .gp-grid { gap: 12px; }
  .gp-card { padding: 14px 16px 10px; }
  .gp-card h3 { margin-bottom: 6px; }
  .gp-p { padding: 5px 10px; }
  .gp-moves li { padding: 3px 0; }
  .gp-invite { padding: 12px 16px; }
  .gp-inv-ic { width: 38px; height: 38px; }
  .gp-tip { padding: 12px 16px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .gp-go, .gp-btn.glow:not(:disabled) { animation: none; } }
