/* EwrekaGames — wave17 acq: start cards, invite waiting screen, share sheet, invite landing, away card, keeper pill.
 * Everything new that floats is position: fixed (never inside #boardPanel, so the board never moves). */

/* ---------- two-up start buttons (home card + game page) ---------- */
.aq-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.aq-two.one { grid-template-columns: 1fr; }
.aq-btn { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; min-height: 96px; padding: 14px 10px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-align: center; text-decoration: none; font: inherit; cursor: pointer; box-shadow: 0 4px 0 var(--line-2); transition: transform .08s, box-shadow .08s; min-width: 0; }
.aq-btn:active { transform: translateY(4px); box-shadow: none; }
.aq-btn b { font-size: 16px; font-weight: 700; line-height: 1.2; overflow-wrap: break-word; text-wrap: balance; }   /* wave18: no lone word on the second line ("Arkadaşını davet / et") */
.aq-btn small { font-size: 12.5px; line-height: 1.25; color: var(--ink-3); max-width: 100%; overflow-wrap: break-word; text-wrap: balance; }
.aq-btn .aq-i { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.aq-btn .aq-i svg, .aq-btn .aq-i .ico { width: 20px; height: 20px; }
.aq-btn.friend { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 0 var(--brand-press); }
.aq-btn.friend small { color: rgba(255, 255, 255, .9); }
.aq-btn.friend .aq-i { background: rgba(255, 255, 255, .2); color: #fff; }
.aq-btn.bot { background: #1f2738; border-color: #1f2738; color: #fff; box-shadow: 0 4px 0 #0b0f17; }
.aq-btn.bot small { color: rgba(255, 255, 255, .78); }
.aq-btn.bot .aq-i { background: rgba(255, 255, 255, .14); color: #fff; }
:root[data-theme="dark"] .aq-btn.bot { background: #eef1f6; border-color: #eef1f6; color: #11151d; box-shadow: 0 4px 0 #a9b2c2; }
:root[data-theme="dark"] .aq-btn.bot small { color: #4b566b; }
:root[data-theme="dark"] .aq-btn.bot .aq-i { background: rgba(0, 0, 0, .08); color: #11151d; }
.aq-btn.loading { pointer-events: none; opacity: .7; }
.aq-online { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 52px; padding: 10px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; box-shadow: 0 3px 0 var(--line-2); text-decoration: none; }
.aq-online { flex-wrap: wrap; row-gap: 2px; }
.aq-online b { font-weight: 700; min-width: 0; max-width: 100%; flex: 0 0 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* wave18: the row title stays on one line ("Online / oyna"); the live line beside it wraps or moves under it */
.aq-online small { color: var(--ink-3); font-size: 12.5px; text-align: right; min-width: 0; flex: 1 1 130px; text-wrap: balance; }
.aq-online small.live { color: var(--good); font-weight: 600; }
.aq-online.loading { pointer-events: none; opacity: .7; }

/* ---------- home "Play now" card ---------- */
.aq-start { margin: 18px 0 8px; padding: 16px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-sm); display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 620px; }
.aq-start h2 { margin: 0; font-size: 18px; font-weight: 800; }
.aq-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
/* fix2: browsers with ::-webkit-scrollbar (Chrome, Edge, Safari) draw a thin bar without the arrow buttons at its ends */
@supports selector(::-webkit-scrollbar) {
  .aq-chips { scrollbar-width: auto; scrollbar-color: auto; }
  .aq-chips::-webkit-scrollbar { height: 6px; }
  .aq-chips::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  .aq-chips::-webkit-scrollbar-track { background: transparent; }
  .aq-chips::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 3px; }
}
.aq-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 12px 0 6px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; }
.aq-chip img { width: 32px; height: 32px; border-radius: 8px; }
.aq-chip[aria-checked="true"] { border-color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.aq-inv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; border-radius: 12px; background: var(--blue-soft); font-size: 14px; }
.aq-inv span { flex: 1 1 160px; }
.aq-codeline { font-size: 14px; color: var(--ink-2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.aq-codeline .joinbar { flex: 1 1 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font: inherit; text-decoration: underline; cursor: pointer; min-height: 40px; }   /* wave18: 40 px tap height */
/* wave18: wide screens: the card takes the content width (no empty area on its right); the two big choices on the
   left, the online row and the room-code line in a column on the right */
@media (min-width: 1000px) {
  .aq-start { max-width: none; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); column-gap: 14px; align-items: start; }
  .aq-start > h2, .aq-start > .aq-inv, .aq-start > .aq-chips { grid-column: 1 / -1; }
  /* fix2: the online box is as tall as the two big buttons beside it (its title and live line centred in it, not a tall
     empty box); the room-code line runs under both, on the right */
  .aq-start > .aq-two { grid-column: 1; align-self: stretch; }   /* fix3: the two big buttons stretch to the row height, so the online box (which may wrap its title to 2 lines) and they stay equal */
  .aq-start > .aq-online { grid-column: 2; align-self: stretch; flex-direction: column; flex-wrap: nowrap; justify-content: center; align-items: flex-start; gap: 4px; padding: 14px 18px; }
  .aq-start > .aq-online b { font-size: 16px; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: break-word; text-wrap: balance; }   /* fix3: the title wraps (at most 2 lines) instead of ending in an ellipsis */
  .aq-start > .aq-online small { text-align: left; flex: 0 0 auto; font-size: 13px; }
  .aq-start > .aq-online::after { content: "\2192"; font-size: 18px; font-weight: 700; color: var(--ink-3); margin-top: 2px; }
  .aq-start > .aq-codeline { grid-column: 1 / -1; justify-self: end; }
  .aq-start .joinbar { min-width: 0; }
  .aq-start .joinbar .field { flex: 1 1 0; width: auto; min-width: 0; }
}
/* wave18: phones: the Play-now card starts higher and its buttons are a little more compact on short screens, so the
   three choices stay above the compact cookie banner (about 130 px) on a 360 × 640 phone in every language */
@media (max-width: 640px) {
  .home-head { margin-bottom: 14px; }
  .aq-start { margin-top: 12px; }
}
@media (max-width: 640px) and (max-height: 700px) {
  .aq-start { gap: 10px; padding: 14px; }
  .aq-btn { min-height: 84px; padding: 10px 8px; gap: 4px; }
  .aq-btn .aq-i { width: 30px; height: 30px; }
}
/* fix2: small short phones (320 × 568): the Play-now card's online row also stays above the compact cookie banner:
   the lead line under the title is kept for screen readers only and the title is a little smaller */
@media (max-width: 400px) and (max-height: 600px) {
  .home-head h1 { font-size: 24px; margin: 0; }
  .home-head p { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* ad gap: at least 150 px between the start card and the next ad slot (index.php keeps the ad further down) */
.aq-adgap { min-height: 150px; }

/* ---------- game page play card ---------- */
.play-card.aq-card { gap: 10px; }
.aq-nameline { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aq-nameline .avatar { width: 26px; height: 26px; font-size: 13px; }
.namefield.hidden, .aq-hide { display: none !important; }

/* ---------- waiting screens ---------- */
.aq-wait .wait-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.aq-wait .wait-hero { padding: 26px 20px 18px; }
.aq-wait .linkbox { margin: 0; }
.aq-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.aq-note { margin: 0; font-size: 13px; color: var(--ink-3); text-align: center; }
.aq-honest { margin: 0 auto; color: var(--ink-2); max-width: 400px; }
.aq-code { gap: 4px; }
.aq-code span { width: auto; flex: 1 1 0; max-width: 44px; min-width: 0; height: 48px; font-size: 20px; }
.aq-big { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); text-align: left; font: inherit; cursor: pointer; box-shadow: 0 3px 0 var(--line-2); }
.aq-big .aq-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); }
.aq-big .aq-t { display: grid; gap: 2px; min-width: 0; }
.aq-big b { font-weight: 700; }
.aq-big small { font-size: 12.5px; color: var(--ink-3); }
.aq-big.accent { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 3px 0 var(--brand-press); }
.aq-big.accent small { color: rgba(255, 255, 255, .9); }
.aq-big.accent .aq-ic { background: rgba(255, 255, 255, .2); }
.aq-big.dark { background: #1f2738; border-color: #1f2738; color: #fff; box-shadow: 0 3px 0 #0b0f17; }
.aq-big.dark small { color: rgba(255, 255, 255, .78); }
.aq-big.dark .aq-ic { background: rgba(255, 255, 255, .14); }
.aq-big:disabled { opacity: .6; }

/* ---------- share row / sheet ---------- */
.sh-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.sh-ch { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; padding: 6px 4px; font-size: 12px; text-decoration: none; }
.sh-ch .sh-ic, .sh-ch .sh-ic svg, .sh-ch .sh-ic .ico { width: 22px; height: 22px; display: grid; place-items: center; }
.sh-ch .sh-l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 380px) { .aq-wait .wait-body { padding-left: 14px; padding-right: 14px; } .sh-row { gap: 6px; } .sh-ch { padding: 6px 2px; } }
/* fix2: at 320-379 px the link field keeps the room code readable: the copy button is a 44 px icon button */
@media (max-width: 379px) { .aq-wait .linkbox .lb-copy { width: 44px; padding: 0; justify-content: center; } .aq-wait .linkbox .lb-copy .lb-t { display: none; } }
@media (max-width: 340px) { .sh-row { gap: 4px; } .sh-ch { font-size: 11px; } }
/* phone landscape: smaller hero so the main action (share / play) is on the first screen */
@media (max-height: 420px) and (orientation: landscape) {
  .aq-wait .wait-hero { padding: 14px 20px 10px; display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 16px; align-items: center; text-align: left; }
  .aq-wait .wait-hero > .seek { grid-row: 1 / span 3; }
  .aq-wait .wait-hero > :not(.seek) { grid-column: 2; }
  .aq-wait .seek, .aq-wait .seek img { width: 56px; height: 56px; border-radius: 16px; }
  .aq-wait .seek { margin: 0; }
  .aq-wait .wait-hero h2 { font-size: 20px; margin-bottom: 2px; }
  .aq-wait .wait-hero p { margin: 0; max-width: none; font-size: 14px; }
  .waiting { margin-top: 8px; }
}
.sh-scrim { position: fixed; inset: 0; z-index: 2147483000; background: rgba(10, 14, 22, .55); display: flex; align-items: flex-end; justify-content: center; }
.sh-box { width: 100%; max-width: 460px; max-height: 92vh; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 22px 22px 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; box-shadow: var(--shadow-lg); }
.sh-box h3 { margin: 0; font-size: 18px; text-align: center; }
.sh-body { display: grid; gap: 10px; }
.sh-p, .sh-link { margin: 0; text-align: center; color: var(--ink-2); font-size: 14px; overflow-wrap: anywhere; }
.sh-link { font-family: var(--mono); }
.sh-qr { width: min(260px, 70vw); margin: 0 auto; background: #fff; border-radius: 12px; padding: 6px; }
.sh-qr svg { display: block; width: 100%; height: auto; }
@media (min-width: 700px) { .sh-scrim { align-items: center; } .sh-box { border-radius: 22px; } }

/* ---------- invite landing ---------- */
.inv-landing .box { display: grid; gap: 10px; justify-items: center; text-align: center; }
.inv-landing .box > img { width: 64px; height: 64px; }
.inv-landing h3 { margin: 0; }
.inv-free { margin: 0; color: var(--ink-2); font-size: 14px; }
.inv-form { display: grid; gap: 10px; width: 100%; }
.inv-name.hidden { display: none; }
.inv-how { font-size: 14px; color: var(--blue); }
/* wave18: the landing scrolls inside itself when it is taller than the window (phones held sideways), and on short
   screens the game icon and the gaps are smaller, so the name field and the "how to play" link are reachable */
.modal.inv-landing { overflow-y: auto; overscroll-behavior: contain; place-items: safe center; }
@media (max-height: 480px) {
  .modal.inv-landing { padding: 8px; }
  .inv-landing .box { padding: 14px 18px 12px; gap: 6px; }
  .inv-landing .box > img { width: 40px; height: 40px; border-radius: 12px; }
  .inv-landing h3 { font-size: 19px; }
}

/* ---------- friend arrived, host away (fixed; bottom sheet on phones, side card on desktop) ---------- */
.away-card { position: fixed; left: 8px; right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 60; max-width: 420px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: 20px; padding: 16px; box-shadow: var(--shadow-lg); display: grid; gap: 8px; }
.away-card h3 { margin: 0; font-size: 17px; }
.away-card p { margin: 0; color: var(--ink-2); font-size: 14px; }
@media (min-width: 900px) { .away-card { left: auto; right: 16px; bottom: 16px; width: 360px; } }
.away-chip { position: fixed; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60; box-shadow: var(--shadow); }

/* ---------- arrival toast (any page) ---------- */
.arr-toast { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ---------- keeper pill + match sheet (vs-computer page) ---------- */
.kp-pill { position: fixed; left: 50%; transform: translateX(-50%); top: 8px; z-index: 70; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 16px); padding: 6px 6px 6px 14px; border-radius: 999px; background: #1f2738; color: #fff; font-size: 13.5px; box-shadow: var(--shadow-lg); font-variant-numeric: tabular-nums; }
.kp-pill.bottom { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); }
.kp-pill.docked { position: static; transform: none; margin: 6px auto; width: max-content; }
.kp-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kp-pill button { flex: 0 0 auto; min-height: 32px; border-radius: 999px; border: 0; padding: 0 12px; background: rgba(255, 255, 255, .16); color: #fff; font: inherit; cursor: pointer; }
.kp-pill.paused { background: #4b566b; }
/* wave18: label shortened with an ellipsis, the time always in full (keeper.js); on phones / tablets the pill sits in
   the top bar between the logo's mark and the account button (keeper.js place sets left / width / top) */
.kp-pill .kp-txt { display: flex; align-items: baseline; min-width: 0; flex: 1 1 auto; }
.kp-pill .kp-l { min-width: 0; }
.kp-pill .kp-t { flex: none; font-weight: 700; margin-left: .3em; }
.kp-pill .kp-l2 { flex: 0 1 auto; min-width: 0; }
.kp-pill.inbar { transform: none; max-width: none; padding: 4px 4px 4px 12px; gap: 6px; font-size: 13px; box-shadow: none; }
.kp-pill.inbar button { padding: 0 10px; }
body.kp-on .topbar .logo > .logo-word { display: none; }
.kp-pill button .ico { display: none; }
@media (max-width: 419px) {
  .kp-pill.inbar button { width: 32px; padding: 0; display: grid; place-items: center; }
  .kp-pill.inbar button .kp-bt { display: none; }
  .kp-pill.inbar button .ico { display: grid; width: 16px; height: 16px; }
}
.kp-sheet .sh-box { text-align: center; }
.kp-sheet .kp-auto { color: var(--ink-3); font-size: 13px; margin: 0; }
@media (prefers-reduced-motion: reduce) { .aq-btn, .aq-big { transition: none; } }
