/* ============================================================
   Game shell — pause card, "start again?" card, full-screen play.
   Paired with js/game-shell.js; loaded by every play-*.html.
   ============================================================ */

/* ---------- pause / confirm card ---------- */

.adhd-shell-overlay {
  position: absolute;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(10, 10, 10, 0.58);
  touch-action: manipulation;
}

.adhd-shell-overlay[hidden] {
  display: none;
}

.adhd-shell-card {
  width: min(100%, 340px);
  max-height: 100%;
  overflow: auto;
  padding: clamp(14px, 4vmin, 22px);
  color: var(--ink, #0A0A0A);
  background: var(--paper, #FAF5E8);
  border: var(--line-w-fat, 4px) solid var(--ink, #0A0A0A);
  box-shadow: 6px 6px 0 var(--ink, #0A0A0A);
  text-align: center;
}

.adhd-shell-card__kicker {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 9px 2px;
  font-family: var(--font-body, sans-serif);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--paper, #FAF5E8);
  background: var(--red, #D42A3A);
  border: 2px solid var(--ink, #0A0A0A);
  transform: rotate(-2deg);
}

/* Bangers has no Hangul, so the Korean title is set in the body face. */
.adhd-shell-card__title {
  margin: 0 0 6px;
  font-family: var(--font-body, sans-serif);
  font-weight: 900;
  font-size: clamp(19px, 5.4vmin, 24px);
  line-height: 1.25;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

.adhd-shell-card__copy {
  margin: 0 0 14px;
  font-family: var(--font-body, sans-serif);
  font-weight: 600;
  font-size: 14px;
  line-height: 1.45;
  color: var(--ink-soft, #4A4A4A);
  word-break: keep-all;
}

.adhd-shell-card__actions {
  display: grid;
  /* Side by side where they fit; stacked on a narrow board rather than
     breaking 계속하기 in the middle of the word. */
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
}

.adhd-shell-btn {
  min-height: 46px;
  padding: 10px 8px 9px;
  font-family: var(--font-body, sans-serif);
  font-weight: 900;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
  color: var(--ink, #0A0A0A);
  background: var(--paper, #FAF5E8);
  border: 2.5px solid var(--ink, #0A0A0A);
  border-radius: 0;
  box-shadow: 3px 3px 0 var(--ink, #0A0A0A);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.06s, box-shadow 0.06s;
}

.adhd-shell-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink, #0A0A0A);
}

.adhd-shell-btn:focus-visible {
  outline: 3px solid var(--blue, #2563EB);
  outline-offset: 2px;
}

.adhd-shell-btn--red {
  color: var(--paper, #FAF5E8);
  background: var(--red, #D42A3A);
}

/* ---------- computer vs touch ----------
   Two layouts, one switch. A computer (a mouse or trackpad that can hover)
   plays with the keyboard: no full screen, no touch pads, and its RESTART
   button is back on the page. Everything else (phones, tablets) is touch.
   A touch-screen laptop counts as a computer: its main pointer is fine. */

@media (hover: hover) and (pointer: fine) {
  .adhd-touch-only { display: none !important; }
}

@media not all and (hover: hover) and (pointer: fine) {
  .adhd-desk-only { display: none !important; }
}

/* ---------- the ⛶ button ---------- */

.adhd-fs-toggle {
  min-width: 40px;
  min-height: 40px;
  padding: 4px 8px;
  font-size: 18px;
  line-height: 1;
}

.adhd-fs-toggle--corner {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 40;
  min-width: 36px;
  min-height: 36px;
  font-size: 17px;
  box-shadow: 2px 2px 0 var(--ink, #0A0A0A);
  opacity: 0.92;
}

@media (pointer: coarse) {
  .adhd-fs-toggle--corner {
    min-width: 44px;
    min-height: 44px;
  }
}

html.adhd-game-fs .adhd-fs-toggle {
  display: none !important;
}

/* ---------- full screen ---------- */

html.adhd-game-fs,
html.adhd-game-fs body {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Pinned edges, not 100dvh: dvh follows a phone's toolbar sliding in and out
   and would resize the board mid-run (see play-adhdrun.html). */
html.adhd-game-fs body {
  position: fixed !important;
  inset: 0 !important;
  margin: 0 !important;
  padding:
    max(6px, env(safe-area-inset-top))
    max(8px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom))
    max(8px, env(safe-area-inset-left)) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  row-gap: 8px !important;
  background: #0A0A0A !important;
  transform: none !important;
  filter: none !important;
}

html.adhd-game-fs body::before,
html.adhd-game-fs body::after,
.adhd-fs-path::before,
.adhd-fs-path::after {
  display: none !important;
}

.adhd-fs-hide {
  display: none !important;
}

.adhd-fs-path {
  display: contents !important;
}

.adhd-fs-keep,
.adhd-fs-board {
  /* Page order, whatever order a phone layout gave the pieces in the page. */
  order: 0 !important;
}

.adhd-fs-keep {
  flex: 0 0 auto !important;
  width: 100% !important;
  max-width: 640px !important;
  margin: 0 !important;
  transform: none !important;
  position: relative;
}

.adhd-fs-board {
  flex: 0 0 auto !important;
  max-width: none !important;
  max-height: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  transform: none !important;
}

.adhd-fs-bar {
  order: -1;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 640px;
}

.adhd-fs-bar__stats {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
}

.adhd-fs-pill {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 5px 8px 4px;
  font-family: var(--font-body, sans-serif);
  font-weight: 900;
  font-size: 13px;
  line-height: 1.2;
  color: var(--ink, #0A0A0A);
  background: var(--yellow, #FCD34D);
  border: 2px solid var(--ink, #0A0A0A);
  box-shadow: 2px 2px 0 var(--paper, #FAF5E8);
}

.adhd-fs-bar__btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 6px 10px 5px;
  font-size: 14px;
  box-shadow: 2px 2px 0 var(--paper, #FAF5E8);
}

.adhd-fs-bar__btn[hidden] {
  display: none;
}

.adhd-fs-bar__exit {
  min-width: 40px;
  font-size: 16px;
}

/* A game's own PAUSE steps aside in full screen: the bar's, beside ✕, is the
   one pause button in every game there. */
html.adhd-game-fs [data-fs-hide] {
  display: none !important;
}
