/* Games section (2026-10-27): /games and the game pages (templates/games/*.twig). Colours and radii: site.css
   tokens. The first game: «Washing Line» (game-washing-line.js). */

.gm { max-width: 1040px; margin: 0 auto; }
.gm-head { margin-bottom: 20px; }
.gm-head .breadcrumb { margin-bottom: 10px; }
.gm-head h1 { margin: 0 0 8px; color: var(--ink); font-size: 30px; font-weight: 900; line-height: 1.2; }
.gm-lead { max-width: 62ch; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.5; }

/* ---------- the hub ---------- */
.gm-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.gm-card { display: flex; flex-direction: column; border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow); overflow: hidden; color: inherit; text-decoration: none; }
.gm-card:hover { box-shadow: var(--shadow-hover); text-decoration: none; color: inherit; }
.gm-card-art { position: relative; height: 170px; background: linear-gradient(180deg, #D8EEFB 0%, #EEF7FC 70%, #DDEFD2 100%); overflow: hidden; }
/* multiply: flashcard pictures on white paper sit on the card colour without white squares */
.gm-card-art img { position: absolute; bottom: 10px; height: 110px; width: auto; mix-blend-mode: multiply; }
.gm-card-body { padding: 16px 18px 18px; }
.gm-card-body h2 { margin: 0 0 6px; font-size: 19px; font-weight: 900; color: var(--ink); }
.gm-card-body p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.45; }
.gm-card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gm-tag { padding: 3px 9px; border-radius: 999px; background: var(--primary-light); color: var(--primary-dark); font-size: 12px; font-weight: 800; }
.gm-card.is-soon { opacity: .72; pointer-events: none; }
.gm-card.is-soon .gm-card-art { filter: grayscale(.35); }

/* ---------- Washing Line ---------- */
.wl { margin: 0 0 28px; }
.wl-levels { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.wl-level { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 2px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.wl-level.is-active { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.wl-level[aria-disabled="true"] { color: var(--muted); cursor: default; }
.wl-level small { font-weight: 700; color: var(--muted); }

.wl-scene { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-lg); overflow: hidden; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(ellipse 60% 22% at 22% 12%, rgba(255,255,255,.75), transparent 70%),
    radial-gradient(ellipse 45% 16% at 78% 22%, rgba(255,255,255,.6), transparent 70%),
    linear-gradient(180deg, #BFE2F6 0%, #DDF0FA 52%, #EAF5E2 64%, #CFE6BF 100%);
  box-shadow: var(--shadow); }
/* posts and rope: one SVG stretched over the scene */
.wl-line { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wl-line path { fill: none; stroke: #8A6A4A; stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.wl-post { position: absolute; top: 13%; width: 1.4%; min-width: 8px; height: 56%; border-radius: 6px; background: linear-gradient(90deg, #A47E57, #C9A47B 50%, #9A7550); }
.wl-post.is-left { left: 3.3%; }
.wl-post.is-right { right: 3.3%; }

.wl-hung { position: absolute; width: 13%; transform: translate(-50%, 0); text-align: center; z-index: 2; }
.wl-hung img { display: block; width: 100%; height: auto; max-height: 9.5vw; object-fit: contain; object-position: top; transform-origin: 50% 0; will-change: transform; }
.wl-hung.is-pegged img { animation: wl-sway 2.6s ease-in-out infinite; }
.wl-peg { position: absolute; top: -9px; left: 50%; width: 10px; height: 22px; margin-left: -5px; border-radius: 3px; background: linear-gradient(90deg, #E9C38E, #F6DDB5 50%, #D9AE74); box-shadow: 0 1px 2px rgba(0,0,0,.25); z-index: 3; opacity: 0; transition: opacity .2s; }
.wl-hung.is-pegged .wl-peg { opacity: 1; }
.wl-label { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: rgba(255,255,255,.88); color: var(--ink); font-size: clamp(11px, 1.4vw, 15px); font-weight: 800; opacity: 0; transition: opacity .3s .2s; }
.wl-hung.is-pegged .wl-label { opacity: 1; }
@keyframes wl-sway { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }

/* the basket at the bottom */
.wl-basket { position: absolute; left: 20%; right: 3%; bottom: 4%; height: 30%; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 1%; align-items: center; padding: 1% 2%; border-radius: 22px 22px 28px 28px;
  background: repeating-linear-gradient(90deg, #D9B484 0 14px, #CFA673 14px 16px), #D9B484; box-shadow: inset 0 6px 0 #E8C99C, inset 0 -8px 0 #B98D5C, 0 6px 14px rgba(80,55,30,.18); z-index: 1; }
.wl-item { position: relative; height: 100%; padding: 4%; border: 0; border-radius: 14px; background: rgba(255,255,255,.55); cursor: pointer; transition: transform .15s, background .15s; }
.wl-item:hover, .wl-item:focus-visible { background: rgba(255,255,255,.9); transform: translateY(-3px); outline: none; }
.wl-item img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.wl-item.is-wrong { animation: wl-shake .45s, wl-red .9s; }
@keyframes wl-red { 0%, 60% { background: rgba(255,214,214,.95); } 100% { background: rgba(255,255,255,.55); } }
.wl-item.is-gone { visibility: hidden; }
@keyframes wl-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }

/* Biscuit, his speech bubble and the prompt */
.wl-biscuit { position: absolute; left: 1.5%; bottom: 3%; width: 16%; height: auto; z-index: 2; pointer-events: none; }
.wl-bubble { position: absolute; left: 2%; bottom: 36%; max-width: 22%; padding: 8px 12px; border-radius: 14px 14px 14px 4px; background: #fff; color: var(--ink); font-size: clamp(12px, 1.5vw, 16px); font-weight: 800; line-height: 1.3; box-shadow: 0 4px 12px rgba(28,39,76,.12); z-index: 3; }
.wl-bubble.is-yes { color: #0E8A50; }
.wl-bubble.is-oops { color: #C2410C; }
.wl-prompt { position: absolute; top: 3.5%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; z-index: 4; }
.wl-say { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px; white-space: nowrap; border: 0; border-radius: 999px; background: var(--primary); color: #fff; font: inherit; font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: 0 6px 14px rgba(76,110,245,.3); }
.wl-say:hover { background: var(--primary-dark); }
.wl-say[hidden] { display: none; }
.wl-say svg { width: 20px; height: 20px; }
.wl-say-short { display: none; }
.wl-word { padding: 6px 18px; border-radius: 999px; background: #fff; color: var(--ink); font-size: clamp(18px, 2.6vw, 28px); font-weight: 900; box-shadow: 0 4px 12px rgba(28,39,76,.1); }
.wl-word:empty { display: none; }
.wl-progress { position: absolute; top: 4.5%; right: 3%; display: flex; gap: 5px; z-index: 4; }
.wl-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: inset 0 0 0 2px rgba(76,110,245,.35); }
.wl-dot.is-done { background: var(--success); box-shadow: none; }

/* start and end panels over the scene */
.wl-panel { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; background: rgba(240,248,253,.93); text-align: center; z-index: 6; }
.wl-panel[hidden] { display: none; }
.wl-panel h2 { margin: 0; color: var(--ink); font-size: clamp(22px, 3.2vw, 32px); font-weight: 900; }
.wl-panel p { max-width: 44ch; margin: 0; color: #475069; font-size: 16px; line-height: 1.45; }
.wl-btn { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 26px; border: 0; border-radius: 14px; background: var(--primary); color: #fff; font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; text-decoration: none; }
.wl-btn:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }
.wl-btn.is-light { background: var(--paper); color: var(--primary-dark); box-shadow: inset 0 0 0 2px var(--primary-light); }
.wl-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.wl-stars { display: flex; gap: 6px; font-size: 44px; line-height: 1; }
.wl-star { color: #D7DCE8; }
.wl-star.is-on { color: var(--accent); }
.wl-note { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

/* the page text under the game */
.gm-text { max-width: 72ch; }
.gm-text h2 { margin: 28px 0 10px; font-size: 22px; font-weight: 900; color: var(--ink); }
.gm-text p, .gm-text li { line-height: 1.6; }
.gm-words { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 12px 0; padding: 0; list-style: none; }
.gm-words li { display: flex; flex-direction: column; align-items: center; padding: 8px; border-radius: var(--radius-md); background: var(--paper); box-shadow: var(--shadow); font-weight: 800; }
.gm-words img { width: 64px; height: 64px; object-fit: contain; }
.gm-words small { color: var(--muted); font-weight: 600; }

@media (max-width: 900px) {
  .gm-head h1 { font-size: 24px; }
  .gm-cards { grid-template-columns: 1fr; }
  /* phones: a taller scene, the basket in two rows of four */
  .wl-scene { aspect-ratio: 3 / 4; }
  .wl-hung { width: 15%; }
  .wl-hung img { max-height: 16vw; }
  .wl-basket { left: 3%; right: 3%; bottom: 3%; height: 38%; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 8px; }
  .wl-say { height: 40px; padding: 0 14px; font-size: 14px; }
  .wl-say-long { display: none; }
  .wl-say-short { display: inline; }
  .wl-biscuit { left: auto; right: 2%; bottom: 42%; width: 22%; }
  .wl-bubble { left: auto; right: 25%; bottom: 44%; max-width: 48%; border-radius: 14px 14px 4px 14px; }
  .wl-prompt { top: 2.5%; }
  .wl-progress { top: auto; bottom: 41%; right: auto; left: 4%; }
  .wl-post { height: 40%; }
  .gm-words { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
