/* مين ده؟ / Meen Da?: game-only styles on top of ../retro/kit.css (linked first).
   Feedback colours are reserved (docs/design/panel_rules.md): lime = match, yellow = close, red hatched = no,
   paper dashed = unknown. Attribute labels keep their panel family colour + icon in a small chip on an ink band. */


.gw-spread { display: grid; gap: 16px; }
.gw-cover { min-width: 0; }

/* ---- issue strip with round navigation ---- */
.gw-issue { padding: 4px 0; }
.gw-issue__mid { flex: 1 1 auto; text-align: center; min-width: 0; }
.gw-issue__line { display: flex; align-items: center; justify-content: center; gap: 10px; }

/* ---- question + sticker + search ---- */
.gw-ask { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.gw-ask__text { min-width: 0; }
.gw-ask .r-h2 { font-size: clamp(24px, 7vw, 30px); margin: 0; }
.gw-sticker { width: 78px; flex: 0 0 auto; margin-inline-end: 4px; }
.gw-sticker small { font-size: 12px; font-weight: 800; max-width: 70px; }
/* the search field is a button: it opens the shared bottom sheet (sheet-search.js) with the real input above the keyboard */
.gw-searchbtn { display: flex; align-items: center; gap: 10px; text-align: start; cursor: text; }
.gw-searchbtn span { color: var(--ink-soft); }
.gw-searchbtn::before { content: ""; flex: 0 0 auto; width: 20px; height: 20px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='10' cy='10' r='6.5' fill='none' stroke='%231A1A1A' stroke-width='2.6'/%3E%3Cpath d='M15 15l5.5 5.5' stroke='%231A1A1A' stroke-width='2.8' stroke-linecap='square'/%3E%3C/svg%3E") center / contain no-repeat; }

/* ---- the hidden player's file: family panels with the value pinned on top ---- */
.gw-file { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 16px 0 6px; }
.gw-fcell { position: relative; flex: 0 0 calc((100% - 16px) / 3); min-width: 0; }
.gw-file.c4 .gw-fcell { flex-basis: calc((100% - 24px) / 4); }
.gw-fcell .r-panel { min-height: 0; height: 100%; }
.gw-fcell .r-panel__art { flex: 1 0 auto; height: 78px; padding: 8px 18% 22px; }
.gw-fcell .r-band { font-size: clamp(12px, 12.5cqi, 15px); padding: 4px 3px 5px; }
.gw-fval { position: absolute; inset-inline: 0; margin-inline: auto; width: max-content; top: 42px; transform: translateY(-50%) rotate(-3deg); z-index: 1; }
.gw-fval.q { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-clip);
             border: 2.5px solid var(--ink); box-shadow: 2px 2px 0 var(--ink); font: 400 26px/1 var(--font-display); padding-top: 4px; }
/* the value is a small clipping (kit .r-clip.sm.tape-narrow): the tape sits above the text, never over it
   (over the letters it cut the top off "وسط", which then read as "بسو") */
.gw-fval.r-clip { padding: 9px 7px 5px; max-width: 100%; min-width: 60%; text-align: center; font: 800 16px/1.25 var(--font-ui);
                  overflow-wrap: break-word; hyphens: none; }
.gw-fval .arr { display: none; }
.gw-fcell:nth-child(2n) .gw-fval { transform: translateY(-50%) rotate(2deg); }

.gw-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.gw-left { font-weight: 800; font-size: 16px; color: var(--ink-meta); }
.gw-giveup { flex: 0 0 auto; }   /* a small text button (end.css .r-giveup); it asks first */

/* ---- result: the back page ---- */
.gw-result { margin-top: 16px; }
.gw-reveal-card { text-align: center; padding: 12px 8px 14px; margin-bottom: 14px; background: var(--paper-clip); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.gw-result.won .gw-reveal-card { outline: 3px solid var(--lime); outline-offset: -7px; }
.gw-result__sub { font-weight: 800; font-size: 16px; color: var(--ink-meta); }
.gw-answer { font: 400 clamp(28px, 8vw, 36px)/1.15 var(--font-display); margin-top: 4px; padding-top: 4px; }
.gw-answer__meta { font-weight: 700; font-size: 16px; color: var(--ink-soft); }

/* ---- guesses column ---- */
.gw-log { min-width: 0; }
.gw-log__head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin: 4px 2px 12px; }
.gw-log__title { margin: 0; font: 400 26px/1.1 var(--font-display); color: var(--yellow); text-shadow: 2px 2px 0 var(--navy-deep); padding-top: 4px; }
.gw-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--paper); font-size: 14px; font-weight: 800; }
.gw-legend span { display: inline-flex; align-items: center; gap: 5px; }
.gw-sw { width: 16px; height: 16px; border: 2px solid var(--ink); display: inline-block; }
.gw-sw.ok, .gw-chipx.ok { background: var(--paper-clip); box-shadow: inset 0 0 0 3px var(--lime); }
.gw-sw.near, .gw-chipx.near { background: var(--yellow); }
.gw-sw.no, .gw-chipx.no { background-color: #F7D4CF; background-image: repeating-linear-gradient(-45deg, rgba(215,38,46,.35) 0 3px, transparent 3px 6px); border-color: var(--red); }
.gw-sw.unk, .gw-chipx.unk { background: var(--paper-2); border-style: dashed; }

.gw-guesses { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.gw-empty { color: var(--paper); font-weight: 800; text-align: center; border: 2px dashed rgba(239,230,210,.55); padding: 18px 12px; }
.gw-guess { padding: 10px; }
.gw-guess.r-clip { padding: 14px 12px 12px; }
.gw-guess__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; min-height: 30px; }
.gw-guess__no { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--paper-clip); display: grid; place-items: center;
                font: 800 14px/1 var(--font-ui); }
.gw-guess__name { flex: 1 1 auto; min-width: 0; font: 400 24px/1.2 var(--font-display); padding-top: 3px; overflow-wrap: anywhere; }
.gw-stamp { font-size: 17px; padding: 0 7px; border-width: 2px; outline-width: 2px; box-shadow: 2px 2px 0 var(--ink); flex: 0 0 auto; margin-inline-end: 4px; }
.gw-guess.r-clip .gw-stamp { margin-inline-end: 18px; }

/* attribute tiles: ink band with the family chip, value body in the feedback colour */
.gw-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.gw-tiles.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gw-tile { display: flex; flex-direction: column; border: 2px solid var(--ink); min-width: 0; background: var(--paper-clip); }
/* UI sweep C7: the icon above the word, words never split in the middle ("بطولات دوري" breaks between the words only) */
.gw-tile__lab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; background: var(--ink); color: var(--paper-clip);
                font: 800 13px/1.25 var(--font-ui); padding: 3px 2px 4px; min-height: 44px; }
html[lang="ar"] .gw-tile__lab { font-size: 14px; }
.gw-tile__lab span { min-width: 0; max-width: 100%; word-break: keep-all; overflow-wrap: normal; hyphens: none; }
.gw-chip { flex: 0 0 auto; width: 20px; height: 20px; display: grid; place-items: center; background: var(--fam-team); border: 1px solid rgba(251,247,236,.5); }
.gw-chip[data-family="honours"] { background: var(--fam-honours); }
.gw-chip[data-family="where"] { background: var(--fam-where); }
.gw-chip[data-family="profile"] { background: var(--fam-profile); }
.gw-chip[data-family="numbers"] { background: var(--fam-numbers); }
.gw-chip b { width: 15px; height: 15px; background: var(--fill, var(--paper-clip)); -webkit-mask: var(--ico) center / contain no-repeat; mask: var(--ico) center / contain no-repeat; }
.gw-tile__val { position: relative; flex: 1 1 auto; display: flex; align-items: center; justify-content: center; gap: 3px; flex-wrap: wrap; text-align: center;
                min-height: 46px; padding: 5px 3px; font: 800 15px/1.25 var(--font-ui); overflow-wrap: break-word; min-width: 0; }
.gw-tile .num { font: 900 17px/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.gw-tile .arr { display: inline-grid; place-items: center; width: 18px; height: 18px; background: var(--ink); color: var(--paper-clip); font: 800 12px/1 var(--font-ui); }
.gw-tile.ok .gw-tile__val { background: var(--paper-clip); box-shadow: inset 0 0 0 3px var(--lime); padding-inline: 14px; }
.gw-tile.ok .gw-tile__val::after { content: ""; position: absolute; top: 3px; inset-inline-end: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--lime)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23141821' stroke-width='4' stroke-linecap='square'/%3E%3C/svg%3E") center / 75% no-repeat; border: 1.5px solid var(--ink); }
.gw-tile.near .gw-tile__val { background: var(--yellow); }
.gw-tile.no .gw-tile__val { background-color: #F7D4CF; background-image: repeating-linear-gradient(-45deg, rgba(215,38,46,.09) 0 6px, transparent 6px 13px); color: #A3141B; }
.gw-tile.no .arr { background: #A3141B; }
.gw-tile.unk .gw-tile__val { background: var(--paper-2); outline: 2px dashed rgba(26,26,26,.4); outline-offset: -5px; color: var(--ink-soft); }

/* the state marks (colour is never alone): close badge on yellow tiles without an arrow, dash on every "no" tile */
.gw-tile.no .gw-tile__val, .gw-tile.near:not(.has-arr) .gw-tile__val { padding-inline: 4px 17px; padding-top: 8px; }
.gw-tile.no .gw-tile__val::after, .gw-tile.near:not(.has-arr) .gw-tile__val::after { content: ""; position: absolute; top: 3px; inset-inline-end: 3px; width: 14px; height: 14px;
  border: 1.5px solid var(--ink); border-radius: 50%; background: var(--paper-clip) center / 75% no-repeat; }
.gw-tile.no .gw-tile__val::after { border-color: #A3141B;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12h14' stroke='%23A3141B' stroke-width='4.5' stroke-linecap='square'/%3E%3C/svg%3E"); }
.gw-tile.near:not(.has-arr) .gw-tile__val::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 9.5q4-4 8 0t8 0M4 16q4-4 8 0t8 0' fill='none' stroke='%23141821' stroke-width='3'/%3E%3C/svg%3E"); }
.gw-sw { position: relative; }
.gw-sw.no::after { content: ""; position: absolute; inset: 5px 2px auto; height: 2.5px; background: #A3141B; }
.gw-sw.near::after { content: ""; position: absolute; inset: 1px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M8 9l4-5 4 5M8 15l4 5 4-5' fill='none' stroke='%23141821' stroke-width='3'/%3E%3C/svg%3E") center / 90% no-repeat; }
.gw-sw.ok::after { content: ""; position: absolute; inset: 1px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%23141821' stroke-width='4' stroke-linecap='square'/%3E%3C/svg%3E") center / 80% no-repeat; }
.gw-sw.unk::after { content: "?"; position: absolute; inset: 0; display: grid; place-items: center; font: 900 10px/1 var(--font-ui); color: var(--ink-soft); }

/* the fresh row: columns turn over one at a time, 120 ms apart (7 x 120 + 200 = 920 ms); transform + opacity only */
@keyframes gw-turn { from { opacity: 0; transform: scaleY(.12); } to { opacity: 1; transform: none; } }
@keyframes gw-fade { from { opacity: 0; } to { opacity: 1; } }
.gw-reveal .gw-tile { animation: gw-turn 200ms cubic-bezier(.2,.9,.3,1.2) both; animation-delay: calc(var(--i, 0) * 120ms); transform-origin: 50% 0; }
@media (prefers-reduced-motion: reduce) { .gw-reveal .gw-tile { animation: gw-fade 150ms linear both; animation-delay: 0ms; } }

/* inline coach mark under the first guess (first visit only) */
.gw-coach { background: var(--paper-clip); color: var(--ink); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--yellow); padding: 12px 12px 10px;
            display: grid; gap: 10px; position: relative; margin-top: -4px; }
.gw-coach::before { content: ""; position: absolute; top: -10px; inset-inline-start: 26px; border: 9px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.gw-coach p { margin: 0; font-weight: 700; font-size: 16px; line-height: 1.6; }
.gw-coach__ok { justify-self: end; min-height: 44px; min-width: 88px; font-size: 16px; }

/* ---- help sheet ---- */
#helpSheet { position: fixed; inset: 0; z-index: 40; }
.gw-sheet { outline: none; }
.gw-sheet__title { font-size: 26px; padding-top: 4px; }
.gw-tagline { font-weight: 800; font-size: 16px; line-height: 1.6; margin: 0 0 10px; }
.gw-howto { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gw-howto li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; font-size: 16px; line-height: 1.6; }
.gw-howto__n { flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; border: 2px solid var(--ink); display: grid; place-items: center; font: 800 13px/1 var(--font-ui); box-shadow: 2px 2px 0 var(--ink); }
.gw-chipx { display: inline-block; padding: 0 6px; border: 2px solid var(--ink); font-weight: 800; color: var(--ink); line-height: 1.4; }
.gw-chipx.no { color: #A3141B; }
.gw-note { font-size: 14px; line-height: 1.6; font-weight: 700; color: var(--ink-soft); margin: 12px 0 14px; }
.gw-sheet__go { width: 100%; }
html.sheet-open { overflow: hidden; }

/* ---- toast ---- */
.gw-toast { position: fixed; z-index: 60; inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100vw - 32px); bottom: calc(24px + var(--ib)); background: var(--ink); color: var(--paper-clip);
            border: 2px solid var(--paper-clip); box-shadow: 3px 3px 0 var(--red); padding: 10px 16px; font-weight: 800; white-space: nowrap; }

/* ---- narrow phones ---- */
@media (max-width: 359px) {
  .gw-tiles.c4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gw-fval.r-clip { font-size: 14px; padding: 8px 3px 3px; }
  .gw-fcell .r-panel__art { height: 64px; }
  .gw-fval { top: 34px; }
  .gw-fval.q { width: 32px; height: 32px; font-size: 21px; }
  .gw-fval.r-clip::after { display: none; }
  .gw-file.c4 { gap: 6px; }
  .gw-file.c4 .gw-fcell { flex-basis: calc((100% - 18px) / 4); }
  .r-btns .r-btn { font-size: 15px; padding: 0 10px; }
  .gw-sticker { width: 68px; }
  .gw-sticker b { font-size: 28px; }
}

/* ---- desktop: two-column spread (cover left, guesses log right) ---- */
@media (min-width: 1024px) {
  .r-poster { --maxw: 1180px; }
  .gw-spread { grid-template-columns: minmax(0, 540px) minmax(0, 1fr); gap: 32px; align-items: start; }
  .gw-cover { position: sticky; top: 12px; }
  .gw-log { padding-top: 0; }
  .gw-log__title { font-size: 32px; }
  .gw-tile__lab { font-size: 13px; }
  .gw-tile .num { font-size: 20px; }
  .gw-tile__val { min-height: 52px; font-size: 15px; }
}

/* compact phones (owner 2026-11-11): the question, the search and the whole file fit on one screen; the question stays on
   screen through kit.js pinQuestion (guesses left + the facts found so far) when the log scrolls */
@media (max-width: 1023px) {
  .gw-spread { gap: 12px; }
  .gw-ask { margin-bottom: 8px; }
  .gw-ask .r-h2 { font-size: clamp(24px, 6.6vw, 28px); }
  .gw-sticker { width: 66px; }
  .gw-file { margin: 10px 0 4px; gap: 6px; }
  .gw-file .gw-fcell { flex-basis: calc((100% - 12px) / 3); }
  .gw-file.c4 .gw-fcell { flex-basis: calc((100% - 18px) / 4); }
  .gw-fcell .r-panel__art { height: 62px; padding: 6px 18% 16px; }
  .gw-fval { top: 34px; }
  .gw-fval.q { width: 36px; height: 36px; font-size: 24px; }
  .gw-foot { margin-top: 10px; }
  .gw-log__head { margin-bottom: 8px; }
}
/* alignment pass 2026-11-12: a long value (club names up to ~45 letters) is set smaller and breaks between words
   first, so it stays a compact clipping over the panel art instead of a tall one that covers the label band */
.gw-fval.r-clip.long { font-size: 14px; line-height: 1.2; padding: 8px 6px 4px; }
.gw-fval.r-clip.xlong { font-size: 12px; line-height: 1.15; padding: 7px 5px 4px; }
html[lang="ar"] .gw-fval.r-clip.long, html[lang="ar"] .gw-fval.r-clip.xlong { line-height: 1.3; }
/* alignment pass 2026-11-12: "محاولات" under the number reached the rim of the phone disc */
@media (max-width: 1023px) { .gw-sticker { width: 78px; } .gw-sticker b { font-size: 26px; line-height: .95; } .gw-sticker small { font-size: 12px; } }

/* UI sweep C7: the fact clipping's tick seal sits outside the clipping's corner, never over the value ("ألمانيا", "١٩٨٩") */
.gw-fval.r-clip::after { top: -9px; inset-inline-end: -9px; }
.gw-fval.r-clip { padding-inline: 8px; }
/* UI sweep C7: phones: the search is pinned to the bottom (Mashwar's guess bar) with «فاضل N» at its end */
.gw-barleft { flex: 0 0 auto; margin-inline-start: auto; font: 800 14px/1.2 var(--font-ui); color: var(--ink-meta); white-space: nowrap; }
.gw-searchbtn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1023px) {
  .gw-guessbar { position: fixed; z-index: 20; inset-inline: 0; bottom: 0; padding: 7px 14px calc(7px + var(--ib)); padding-inline: calc(14px + var(--il)) calc(14px + var(--ir));
                 background: var(--navy); border-top: 3px solid var(--ink); }
  .gw-guessbar .gw-searchbtn { max-width: 520px; margin-inline: auto; min-height: 48px; box-shadow: 3px 3px 0 var(--red); }
  body:has(#play:not(.hidden)) .r-poster { padding-bottom: 80px; }
  html.sheet-open .gw-guessbar { visibility: hidden; }
}
@media (min-width: 1024px) { .gw-barleft { display: none; } }
/* G3 (UI sweep 2026-11-16): the first paint keeps the final sizes (issue strip with its date line, the file's two rows of
   panels) so nothing on screen moves when the data lands */
@media (max-width: 1023px) { .gw-issue { min-height: 61px; } .gw-file:empty { min-height: 203px; } }
/* UI sweep E1: the file's panel bands 14 px in Arabic (13 px English), words kept whole */
.gw-fcell .r-band { font-size: 13px; word-break: keep-all; overflow-wrap: normal; }
html[lang="ar"] .gw-fcell .r-band { font-size: 14px; }
