/* Guess the Pro — builds on style.css tokens and grid.css (avatars, search list, emblems, modals). */

.gp-search { position: relative; max-width: 460px; margin: 0 auto 16px; }
.gp-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 50;
  max-height: min(46vh, 360px); background: #0d1527;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
}
.gp-noresults { cursor: default; color: var(--text-muted); font-size: 0.85rem; }

/* Rows: player and 6 categories; "played together" as a line of text under the tiles. */
.gp-table { max-width: 640px; margin: 0 auto; }
.gp-row {
  display: grid; grid-template-columns: minmax(92px, 1.5fr) repeat(7, minmax(0, 1fr));
  gap: 6px; align-items: stretch; margin-bottom: 6px;
}
/* Headers: two lines high, text centred both ways; longer text shrinks to fit two lines (fitText in guess.js). */
.gp-head > div {
  font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; line-height: 1.2;
  color: var(--text-muted); text-align: center; padding-bottom: 2px;
  display: flex; align-items: center; justify-content: center; height: calc(0.62rem * 1.2 * 2 + 2px); box-sizing: content-box;
  border-bottom: 1px solid rgba(200, 170, 110, 0.25);
}

.gp-player { display: flex; align-items: center; gap: 8px; min-width: 0; }
.gp-player .avatar { width: 38px; height: 38px; font-size: 0.8rem; }
.gp-nick {
  font-weight: 800; font-size: 0.9rem; color: var(--gold-light);
  white-space: nowrap; overflow: hidden; min-width: 0; max-width: 100%;
}
/* Text that doesn't fit gets smaller (fitText in guess.js) instead of breaking words or showing "…". */
.gp-head > div, .gp-cell .gp-text { overflow-wrap: normal; word-break: normal; hyphens: none; overflow: hidden; min-width: 0; }
.gp-cell .gp-text { max-width: 100%; }
.gp-cell .emblem { overflow: hidden; white-space: normal; overflow-wrap: normal; line-height: 1.05; padding: 1px; letter-spacing: 0; font-family: 'Montserrat', sans-serif; font-weight: 800; }

.gp-cell {
  position: relative; aspect-ratio: 1; max-height: 64px; justify-self: stretch;
  display: flex; align-items: center; justify-content: center; gap: 2px;
  border-radius: 6px; border: 1px solid; padding: 6px; cursor: default; overflow: hidden;
}
.gp-cell.ok { background: rgba(36, 108, 64, 0.85); border-color: rgba(90, 232, 150, 0.75); }
.gp-cell.no { background: rgba(116, 34, 40, 0.8); border-color: rgba(255, 120, 120, 0.55); }
/* Partial match: bright amber, clearly lighter than the dark green and red. */
.gp-cell.part { background: linear-gradient(160deg, #d9a521, #a87410); border-color: #ffd970; box-shadow: 0 0 8px rgba(255, 200, 70, 0.35); cursor: help; }
.gp-cell.part .gp-none { color: #2a1c02; font-weight: 800; }
.gp-role-icon { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }
.gp-role-icon .dim { fill: rgba(255, 255, 255, 0.28); }
.gp-cell > img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Team logos on their light plate, a bit smaller than the tile so its colour shows around them. */
/* Team logos straight on the tile (no light plate) with a soft, wide halo so they read on green, yellow and red alike:
   dark by default, light for logos that are dark themselves (guess.js marks them .logo-dark after measuring). */
.gp-team > img {
  width: 78%; height: 78%; object-fit: contain;
  filter: drop-shadow(0 0 3.5px rgba(5, 8, 17, 0.45)) drop-shadow(0 0 1px rgba(5, 8, 17, 0.25));
}
.gp-team > img.logo-dark { filter: drop-shadow(0 0 3.5px rgba(240, 230, 210, 0.45)) drop-shadow(0 0 1px rgba(240, 230, 210, 0.25)); }
/* Black one-colour logos (Dplus KIA, TSM, SK…) in negative: white, with the default dark halo, on every tile colour (as in the Grid). */
.gp-team > img.logo-neg { filter: invert(1) drop-shadow(0 0 3.5px rgba(5, 8, 17, 0.45)) drop-shadow(0 0 1px rgba(5, 8, 17, 0.25)); }
/* League logos with the league name under them: white traces on a transparent background (leagues-captioned,
   scripts/make-league-logos.js), straight on the tile. */
.gp-league > img, .gp-league-logo { width: 100%; height: 100%; padding: 1px; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.45)); }
/* A single flag: about two thirds of the tile, so the tile colour shows around it. */
.gp-nat > img { width: 66%; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
/* Two flags: the primary one in the top-left corner, the other in the bottom-right, slightly overlapping it. */
.gp-flags { position: relative; width: 100%; height: 100%; }
.gp-flags > img, .gp-flags > .emblem {
  position: absolute; height: 56%; width: auto; max-width: 70%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 2px 5px rgba(0, 0, 0, 0.5);
}
.gp-flags > :first-child { top: 6%; left: 0; }
.gp-flags > :last-child { bottom: 6%; right: 0; }
.gp-cell .emblem { font-size: 0.6rem; border-width: 1px; }
.gp-text { font-size: 0.68rem; font-weight: 800; text-align: center; line-height: 1.1; color: #fff; }
.gp-none { font-weight: 600; color: rgba(255, 255, 255, 0.7); text-transform: lowercase; }
.gp-num { font-family: 'Cinzel', serif; font-size: 1.05rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.gp-debut .gp-num, .gp-retired .gp-num { font-size: 0.92rem; }
/* "Active" instead of a year: a word (shrinks to fit, fitText). */
.gp-active-label { text-transform: uppercase; letter-spacing: 0.3px; }
/* Column headers and "none": the long label; phones get the short one (below). */
.gp-head .h-short, .gp-none .h-short { display: none; }
.gp-arrow { font-size: 0.95rem; font-weight: 800; color: #ffd27a; }

.gp-together {
  grid-column: 1 / -1; margin-top: -2px; padding: 3px 8px;
  font-size: 0.74rem; font-weight: 700; color: var(--gold-light);
  background: rgba(200, 170, 110, 0.1); border: 1px solid rgba(200, 170, 110, 0.35); border-radius: 5px;
}

.gp-correct .gp-player .avatar { box-shadow: 0 0 0 2px rgba(74, 224, 136, 0.8); }

/* A thin line between guesses (under the "played together" note when there is one). */
#guessRows > .gp-row { padding-bottom: 6px; border-bottom: 1px solid rgba(200, 170, 110, 0.18); }
@media (max-width: 520px) { #guessRows > .gp-row { padding-bottom: 4px; } }
/* The answer revealed after giving up: on top, set apart from the guesses below it. */
#guessRows > .gp-revealed { border-bottom: 2px solid rgba(200, 170, 110, 0.6); }
.gp-revealed .gp-nick::after { content: ' 🏳️'; }

/* A new guess: the player appears at once, the category cards start face down — the site's mark, flat and in one
   colour, on a dark back — and turn over one after another, the opposite way to the mystery card (dossier: out to +90°,
   in from −90°) and slower. The back is two layers over the tile (::before dark back, ::after mark) that vanish
   at the half-turn, when the card is edge-on. */
.gp-new > .gp-player { animation: gp-appear .3s ease-out both; }
/* One card per beat at 150 bpm (0.4 s apart); each turn takes one beat. */
.gp-new > .gp-cell { --d: 0s; animation: gp-turn .4s cubic-bezier(.45, .05, .35, 1) var(--d) both, gp-cover .4s var(--d) both; }
.gp-new > .gp-cell::before, .gp-new > .gp-cell::after, .gp-slot > .gp-cell::before, .gp-slot > .gp-cell::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
}
.gp-new > .gp-cell::before, .gp-new > .gp-cell::after { animation: gp-back .4s var(--d) both; }
.gp-new > .gp-cell::before, .gp-slot > .gp-cell::before {
  border-radius: inherit; border: 1px solid rgba(200, 170, 110, 0.35);
  background: #0e1628;
}
.gp-new > .gp-cell::after, .gp-slot > .gp-cell::after {
  /* The mark only — the L and the three squares (design/logo-modern.svg without its frame) — in one flat colour. */
  inset: 24%; background: rgba(200, 170, 110, 0.16);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='36 40 180 176'%3E%3Cpath d='M44 40H74A8 8 0 0 1 82 48V166A8 8 0 0 0 90 174H208A8 8 0 0 1 216 182V208A8 8 0 0 1 208 216H44A8 8 0 0 1 36 208V48A8 8 0 0 1 44 40Z'/%3E%3Crect x='133' y='40' width='40' height='40' rx='9'/%3E%3Crect x='176' y='83' width='40' height='40' rx='9'/%3E%3Crect x='90' y='126' width='40' height='40' rx='9'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='36 40 180 176'%3E%3Cpath d='M44 40H74A8 8 0 0 1 82 48V166A8 8 0 0 0 90 174H208A8 8 0 0 1 216 182V208A8 8 0 0 1 208 216H44A8 8 0 0 1 36 208V48A8 8 0 0 1 44 40Z'/%3E%3Crect x='133' y='40' width='40' height='40' rx='9'/%3E%3Crect x='176' y='83' width='40' height='40' rx='9'/%3E%3Crect x='90' y='126' width='40' height='40' rx='9'/%3E%3C/svg%3E") center / contain no-repeat;
}
.gp-new > .gp-cell:nth-child(3) { --d: .4s; }
.gp-new > .gp-cell:nth-child(4) { --d: .8s; }
.gp-new > .gp-cell:nth-child(5) { --d: 1.2s; }
.gp-new > .gp-cell:nth-child(6) { --d: 1.6s; }
.gp-new > .gp-cell:nth-child(7) { --d: 2s; }
.gp-new > .gp-cell:nth-child(8) { --d: 2.4s; }
.gp-new > .gp-together { animation: gp-appear .4s ease-out 2.8s both; }
@keyframes gp-appear { from { opacity: 0; transform: translateY(-4px); } }
@keyframes gp-turn {
  0% { transform: perspective(500px) rotateY(0); }
  45% { transform: perspective(500px) rotateY(-90deg); }
  45.01% { transform: perspective(500px) rotateY(90deg); }
  85% { transform: perspective(500px) rotateY(-8deg); }
  100% { transform: perspective(500px) rotateY(0); }
}
@keyframes gp-back { 0%, 45% { opacity: 1; } 45.01%, 100% { opacity: 0; } }
/* While face down the tile's own frame and glow (green / yellow / red) would give the answer away. */
@keyframes gp-cover { 0%, 45% { border-color: #4b4130; background: #0e1628; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) {
  .gp-new > *, .gp-new > .gp-cell::before, .gp-new > .gp-cell::after { animation: none; }
  .gp-new > .gp-cell::before, .gp-new > .gp-cell::after { display: none; }
}

/* The next slot, always on top of the guesses until the game is over (guess.js slotRow): a row of card backs; the
   guess entered takes its place and its cards turn over, and a new slot appears above it. */
.gp-slot > .gp-cell { border-color: #4b4130; background: #0e1628; }
.gp-slot-avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border-radius: 50%;
  background: #0e1628; border: 1px solid #4b4130; color: rgba(200, 170, 110, 0.35); font-family: 'Cinzel', serif; font-weight: 700;
}
.gp-slot-nick { display: block; width: 58%; height: 8px; border-radius: 4px; background: rgba(200, 170, 110, 0.1); }
.gp-slot.gp-slot-in { animation: gp-slot-grow .35s ease-out both; overflow: hidden; }
@keyframes gp-slot-grow { from { opacity: 0; max-height: 0; margin-bottom: 0; padding-bottom: 0; } to { opacity: 1; max-height: 120px; } }
@media (max-width: 520px) { .gp-slot-nick { width: 70%; height: 6px; } }
@media (prefers-reduced-motion: reduce) { .gp-slot.gp-slot-in { animation: none; } }

/* "Give up" sits at the bottom of the game panel (which reaches down to the footer), not right under the rows. */
.game-panel:has(#guessRows) { display: flex; flex-direction: column; }
.game-panel:has(#guessRows) > .game-area:not(.hidden) { flex: 1 0 auto; display: flex; flex-direction: column; }
.game-panel:has(#guessRows) > .game-area > .gp-search, .game-panel:has(#guessRows) > .game-area > .gp-table { width: 100%; }
.game-panel:has(#guessRows) > .game-area > .actions { margin-top: auto; padding-top: 14px; }

/* The answer, after the game. */
.gp-answer, .gp-result-player { display: flex; align-items: center; justify-content: center; gap: 14px; }
.gp-answer { margin: 0 auto 16px; }
.gp-answer .avatar, .gp-result-player .avatar { width: 64px; height: 64px; border: 2px solid var(--gold); }
.gp-result-player { margin: 6px 0 10px; }
.gp-answer-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); font-weight: 700; }
.gp-answer-nick { font-family: 'Cinzel', serif; font-size: 1.5rem; color: var(--gold-light); line-height: 1.1; }
.gp-answer-name { font-size: 0.78rem; color: var(--text-muted); }
.gp-answer-text { text-align: left; }

@media (max-width: 520px) {
  .gp-row { grid-template-columns: minmax(52px, 1fr) repeat(7, minmax(0, 1fr)); gap: 3px; margin-bottom: 4px; }
  .gp-head > div { font-size: 0.56rem; letter-spacing: 0; line-height: 1.15; height: calc(0.56rem * 1.15 * 2 + 2px); }
  .gp-player { flex-direction: column; gap: 2px; }
  .gp-player .avatar { width: 30px; height: 30px; }
  .gp-nick { font-size: 0.66rem; max-width: 100%; }
  /* Same coloured frame around every tile: thick enough to tell green from yellow around the logos. */
  .gp-cell { padding: 5px; border-radius: 5px; }
  /* Icon tiles (flag, position, league, team): a thinner inner frame, so the icons get ~32 px instead of ~26 px on
     a 360 px screen — the tile's colour still shows around them (no light plate any more). */
  .gp-nat, .gp-role, .gp-league, .gp-team { padding: 2px; }
  .gp-nat > img { width: 84%; }
  .gp-num { font-size: 0.85rem; }
  .gp-debut .gp-num, .gp-retired .gp-num { font-size: 0.7rem; }
  /* Short headers and bigger words in the tiles ("none", "active"): ~10.5 px instead of 8–9 px. Headers are two
     lines high, so "Int'l / titles" can say what the titles column counts; a line break comes only from the "\n"
     in the label (pre-line), the one-word labels stay on one line, centred. */
  .gp-head .h-long, .gp-none .h-long { display: none; }
  .gp-head .h-short, .gp-none .h-short { display: inline; }
  .gp-head > div { font-size: 0.66rem; text-transform: none; letter-spacing: 0; white-space: pre-line; line-height: 1.2; height: calc(0.66rem * 1.2 * 2 + 2px); }
  /* "active" needs the room: lower case, and the tile's inner frame thinner than elsewhere. */
  .gp-cell.gp-active { padding-inline: 2px; }
  .gp-active-label { letter-spacing: 0; text-transform: lowercase; }
  .gp-arrow { font-size: 0.75rem; }
  .gp-text { font-size: 0.66rem; }
  .gp-together { font-size: 0.66rem; padding: 3px 6px; }
  /* Phones: the game starts right under the header (no vertical centring as in the other games), the search bar
     sticks to the top of the screen and each new guess appears right under it, above the earlier ones. */
  .app > .game-area::before { display: none; }
  .app > .game-area > .actions { flex: none; padding-top: 0; margin-top: 12px; }
  .grid-status { margin-top: 4px; }
  .gp-search {
    position: sticky; top: 0; z-index: 40; margin: 0 -2px 12px; padding: 8px 2px;
    background: #0a101c; box-shadow: 0 6px 10px -6px rgba(0, 0, 0, 0.8);
  }
  #guessRows > .gp-row { scroll-margin-top: 70px; scroll-margin-bottom: 16px; }
}
@media (max-width: 520px) { .gp-titles, .gp-debut, .gp-retired { flex-direction: column; gap: 0; line-height: 1; } }

/* The guess count has no "/max" after it: keep it off the panel edge (like the ‹ arrow on the left). */
.board-line .grid-status { padding-right: 10px; }
