/* Spel, Lotus & Lime bordsplatta. Motor enligt Spel-och-Teman v2 kap 3.2.
   En sak i taget, knappar minst 72 px, läsbart från båda håll i split2. */

/* Värdens rad */
.g-host { display: block; font: 600 15px/1.3 inherit; color: var(--ink-1, #28251D);
  background: rgba(200,166,63,.14); border: 1px solid rgba(138,100,18,.35);
  border-radius: 10px; padding: 8px 14px; min-height: 38px; text-align: center;
  transition: opacity .18s; max-width: 46em; }
.g-host.swap { opacity: 0; }

/* split2: plattan delad i två halvor, övre roterad 180° */
.g-split2 { position: relative; height: 100%; min-height: 70vh; display: block; }
.g-half { position: absolute; left: 0; right: 0; height: calc(50% - 32px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 18px; }
.g-half.g-top { top: 0; transform: rotate(180deg); }
.g-half.g-bottom { bottom: 0; }
.g-mid { position: absolute; top: 50%; left: 0; right: 0; height: 64px; transform: translateY(-50%);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: var(--paper, #F4EBD9); border-top: 1px solid rgba(138,100,18,.3);
  border-bottom: 1px solid rgba(138,100,18,.3); z-index: 2; }
.g-mid-score { font-weight: 800; font-size: 19px; letter-spacing: .06em; }
.g-halflbl { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.g-half h3 { font-size: 21px; margin: 0; text-align: center; }

/* corners4-användning i duellen */
.g-duel .g-half { gap: 10px; }

/* knappar */
.g-big { font: 700 20px/1 inherit; padding: 16px 34px; min-height: 72px; border-radius: 14px;
  border: 2px solid var(--brand-dark, #8A6412); background: var(--brand, #C8A63F); color: #28251D; cursor: pointer; }
.g-big:active { transform: scale(.97); }
.g-ghostbtn { font: 600 15px/1 inherit; padding: 10px 18px; min-height: 44px; border-radius: 10px;
  border: 1.5px solid rgba(40,37,29,.4); background: transparent; color: inherit; cursor: pointer; }
.g-btnrow { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 10px; }
.g-card { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px;
  align-items: center; padding: 20px; text-align: center; }
.g-sub { font-size: 17px; color: var(--ink-2, #5E6670); margin: 0; }
.g-fine { font-size: 13px; opacity: .75; }
.g-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 14px;
  border: 2px solid rgba(138,100,18,.35); background: rgba(255,246,238,.6); cursor: pointer; text-align: left; }
.g-tile h3 { margin: 0; font-size: 19px; }
.g-tile p { margin: 0; font-size: 14px; opacity: .8; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; max-width: 900px; margin: 12px auto; }
.g-partybar { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  border-left: 6px solid var(--g-color); background: rgba(255,246,238,.7); border-radius: 10px;
  padding: 10px 16px; max-width: 900px; margin: 0 auto 8px; }
.g-team { font-weight: 800; }
.g-limes { font-size: 14px; opacity: .85; }

/* Hettaduellen */
.g-dish { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.g-dish img { width: 150px; height: 110px; object-fit: cover; border-radius: 12px; border: 2px solid rgba(138,100,18,.4); }
.g-dish-sm img { width: 120px; height: 88px; }
.g-heat-num { font-size: 42px; font-weight: 900; color: #C8281E; }
.g-heatbtns { display: flex; gap: 8px; }
.g-heatb { width: 62px; height: 72px; font-size: 24px; font-weight: 800; border-radius: 12px;
  border: 2px solid rgba(40,37,29,.35); background: rgba(255,246,238,.85); cursor: pointer; }
.g-heatb.on { background: #C8281E; color: #fff; border-color: #7d1a12; }

/* Bordsröstningen */
.g-vote { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; max-width: 860px; }
.g-vote-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px;
  border: 2px solid rgba(138,100,18,.35); background: rgba(255,246,238,.85); cursor: pointer; align-items: center; }
.g-vote-card img { width: 100%; height: 130px; object-fit: cover; border-radius: 10px; }
.g-vote-card b { font-size: 16px; }
.g-dots { display: flex; flex-wrap: wrap; gap: 4px; min-height: 12px; justify-content: center; }
.g-dots i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; animation: dotin .3s ease-out; }
@keyframes dotin { from { transform: scale(0); } to { transform: scale(1); } }

/* Sant eller falskt */
.g-statement { font-size: 22px; font-weight: 700; text-align: center; max-width: 24em; margin: 0; }
.g-tfbtns { display: flex; gap: 12px; }
.g-tfb { min-width: 130px; min-height: 72px; font-size: 20px; font-weight: 800; border-radius: 14px;
  border: 2px solid rgba(40,37,29,.35); cursor: pointer; }
.g-tfb.yes { background: #7BA428; color: #fff; }
.g-tfb.no { background: #C8281E; color: #fff; }

/* Fånga limen */
.g-catch { position: relative; height: 72vh; min-height: 480px; }
.g-catch-hud { display: flex; gap: 14px; align-items: baseline; padding: 8px 4px; }
.g-catch-hud b { font-size: 26px; }
.g-catch-t { margin-left: auto; font-weight: 800; font-size: 20px; }
.g-field { position: relative; height: 100%; border-radius: 16px; overflow: hidden;
  background: linear-gradient(180deg, #9FD3E8 0%, #DCEFF0 62%, #DCC197 62.5%); }
.g-drop { position: absolute; top: -8%; width: 58px; height: 58px; padding: 0; border: 0;
  background: none; cursor: pointer; z-index: 2; }
.g-drop svg { width: 100%; height: 100%; pointer-events: none; }
.g-drop:active { transform: scale(1.2); }

/* Bygg din skål */
.g-bowl-art svg { width: 200px; height: 160px; }
.g-alts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.g-alt { font: 600 17px/1 inherit; padding: 14px 18px; min-height: 56px; border-radius: 12px;
  border: 2px solid rgba(138,100,18,.4); background: rgba(255,246,238,.9); cursor: pointer; }
.g-alt.on, .g-alt:active { background: #C8A63F; }
.g-hold { position: relative; overflow: hidden; min-height: 72px; padding: 0 30px; font: 700 18px/72px inherit;
  border-radius: 14px; border: 2px solid #8A6412; background: #C8A63F; cursor: pointer; }
.g-hold i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(46,111,216,.35); transition: width .1s linear; }
.g-hold.holding i { width: 100%; transition: width 2s linear; }

/* Hjälp kocken */
.g-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; width: 100%; max-width: 860px; }
.g-step { display: flex; align-items: center; gap: 10px; text-align: left; font: 600 16px/1.25 inherit;
  padding: 14px; min-height: 64px; border-radius: 12px; border: 2px solid rgba(138,100,18,.4);
  background: rgba(255,246,238,.9); cursor: pointer; }
.g-step b { font-size: 20px; color: #C8281E; }
.g-step.done { opacity: .45; border-style: dashed; }
.g-step.shake, .g-alt.shake { animation: gshake .4s; }
@keyframes gshake { 25% { transform: translateX(-7px); } 75% { transform: translateX(7px); } }
.g-pot svg { width: 230px; height: 165px; touch-action: none; }
.g-pot.done svg { width: 180px; }
.g-steam path { animation: gsteam 2.2s ease-in-out infinite alternate; opacity: .8; }
.g-steam path:nth-child(2) { animation-delay: .5s; }
.g-steam path:nth-child(3) { animation-delay: 1s; }
@keyframes gsteam { from { transform: translateY(4px); opacity: .35; } to { transform: translateY(-6px); opacity: .8; } }
.g-stir-bar { width: 240px; height: 10px; border-radius: 6px; background: rgba(40,37,29,.15); overflow: hidden; }
.g-stir-bar i { display: block; height: 100%; width: 0; background: #C8281E; transition: width .1s; }

/* Djungelljud */
.g-sound-row { display: flex; gap: 10px; align-items: center; justify-content: center; }
.g-play { width: 96px; height: 96px; border-radius: 50%; border: 3px solid #3E7C8C; color: #3E7C8C;
  background: rgba(159,211,232,.35); cursor: pointer; }
.g-play svg { width: 54px; height: 54px; }
.g-snd-toggle { font: 600 13px/1 inherit; padding: 8px 12px; border-radius: 999px; border: 1.5px solid rgba(40,37,29,.4); background: transparent; cursor: pointer; }
.g-fact { display: flex; flex-direction: column; gap: 8px; align-items: center; max-width: 34em; }
.g-sound-alts { min-height: 120px; align-content: center; }

/* Memory */
.g-mem-wrap { max-width: 860px; margin: 0 auto; border: 4px solid var(--g-turn); border-radius: 16px; padding: 12px; }
.g-mem { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.g-mem-card { min-height: 84px; font: 600 15px/1.2 inherit; border-radius: 12px; border: 2px solid rgba(138,100,18,.45);
  background: #183E2C; color: #DDEBCB; cursor: pointer; padding: 8px; }
.g-mem-card.up, .g-mem-card.hit { background: rgba(255,246,238,.95); color: #28251D; }
.g-mem-card.hit { border-color: #7BA428; box-shadow: 0 0 0 3px rgba(123,164,40,.3); }
.g-mem-back { font-size: 30px; }

/* Duell */
.g-iconalts { display: flex; gap: 14px; }
.g-iconalt { width: 108px; height: 108px; padding: 10px; border-radius: 16px;
  border: 2.5px solid rgba(40,37,29,.4); background: rgba(255,246,238,.9); cursor: pointer; }
.g-iconalt svg { width: 100%; height: 100%; }
.g-iconalt:active { transform: scale(.94); }
.g-result h3 { font-size: 34px; }

/* Telefonvy: halverade ytor, större tryckytor */
body.phone .g-split2, body.phone .g-catch { min-height: 60vh; }
body.phone .g-vote { grid-template-columns: 1fr; }
body.phone .g-mem { grid-template-columns: repeat(3, 1fr); }
body.phone .g-heatb { width: 48px; }
body.phone .g-iconalt { width: 84px; height: 84px; }

/* Nedsatt rörelse: inga nya animationer */
@media (prefers-reduced-motion: reduce) {
  .g-drop, .g-dots i, .g-steam path, .g-host.swap { animation: none; transition: none; }
}

/* Avbryt-knapp i pågående spel, ingen transform: träfftestet ska vara stabilt */
.g-close { position: absolute; top: 9px; right: 8px;
  width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid rgba(40,37,29,.4);
  background: rgba(255,246,238,.9); font-size: 19px; line-height: 46px; cursor: pointer; z-index: 3; }

/* Pongduellen: canvas täcker spelläget, poäng ritas på duken i båda riktningarna. */
.g-pong { position: relative; height: 100%; min-height: 70vh; }
.g-pong canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; border-radius: 14px; }
.g-pong .g-pong-mid { z-index: 2; pointer-events: none; justify-content: center; }
.g-pong .g-pong-mid .g-close { pointer-events: auto; }
.g-bigscore { font: 800 34px/1.2 inherit; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { .g-pong canvas { touch-action: none; } }

/* ---------- Fas 4: beloningar, temaratt, topplista, pass ---------- */
.g-sec { max-width: 900px; margin: 18px auto 0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 14px 16px; }
.g-sec h3 { margin: 0 0 8px; font-size: 17px; }
.g-sec .g-limes { float: right; color: #5B6B14; font-weight: 700; }
.g-reward { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid rgba(255,255,255,.1); }
.g-reward:first-of-type { border-top: 0; }
.g-reward b { display: block; font-size: 15px; }
.g-reward span { font-size: 13px; opacity: .75; }
.g-board { margin: 0; padding: 0 0 0 20px; }
.g-board li { display: flex; justify-content: space-between; padding: 6px 0; font-size: 15px; }
.g-board span { color: #CDE86B; font-weight: 700; }
.g-passbtn { display: block; max-width: 900px; margin: 14px auto 72px; width: 100%; padding: 14px; border-radius: 14px; border: 1px dashed rgba(255,255,255,.4); background: transparent; color: inherit; font-size: 16px; font-weight: 700; }

/* Utskrift av bordspasset: allt annat döljs vid utskrift. */
#passPrint { display: none; }
@media print {
  body > *:not(#passPrint) { display: none !important; }
  #passPrint { display: block !important; }
}
#passPrint .pp-card { font-family: Georgia, serif; color: #222; max-width: 460px; margin: 0 auto; border: 3px double #222; border-radius: 18px; padding: 34px 38px; text-align: center; }
#passPrint h1 { font-size: 34px; margin: 0 0 18px; letter-spacing: 1px; }
#passPrint .pp-team { font-size: 22px; border: 2px solid #444; border-radius: 999px; display: inline-block; padding: 6px 22px; margin: 0 0 16px; font-weight: 700; }
#passPrint .pp-row { font-size: 16px; margin: 6px 0; }
#passPrint .pp-note { font-size: 14px; font-style: italic; margin: 16px 0 4px; }
#passPrint .pp-fine { font-size: 10px; color: #777; margin: 0; }
