/* HSG / Universität St.Gallen corporate design (colours + Gill Sans from official brand assets) */
:root{
  --bg:#f6f6f3; --card:#fff; --ink:#231f20; --muted:#6b6a66; --line:#e6e7e8;
  --accent:#00802f; --accent-2:#008e43; --accent-bg:#e8f1eb;
  --ok:#008e43; --ok-bg:#e8f1eb;
  --warn:#b3801f; --warn-bg:#fbf3e1;
  --bad:#ed1c24; --bad-bg:#fbe9ea;
  --logoh:36px;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:"Gill Sans MT","Gill Sans",Calibri,"Segoe UI",system-ui,Helvetica,Arial,sans-serif;
  background:var(--bg);
  color:var(--ink);
  line-height:1.55;
  min-height:100vh;
  display:flex;flex-direction:column;
}

/* header / lockup — sizing k-factors shared with the Verteidigungs-Coach / Begleiter baseline */
header.top{background:var(--card);border-bottom:1px solid var(--line);padding:12px 22px;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px}
.logo{height:var(--logoh);width:calc(var(--logoh) * 4.66);flex:0 0 auto;display:block}   /* explicit width (DE viewBox 466/100) — prevents flex 'stretch' from distorting the SVG */
html:not([lang='de']) .logo{width:calc(var(--logoh) * 4.81553)}   /* EN viewBox 496/103 */
.lockup{display:flex;flex-direction:column;gap:4px;text-decoration:none;color:inherit}
.lockup .sub{margin-left:calc(var(--logoh) * 1.1)}   /* left-align with the "U" of «Universität St.Gallen», not the emblem (DE logo k=1.1) */
html:not([lang='de']) .lockup .sub{margin-left:calc(var(--logoh) * 1.068)}   /* EN logo (non-German UI) viewBox h=103 → k=1.068 */
.suite{font-size:14px;font-weight:600;color:var(--ink);line-height:1.2}
.suite .sep{color:var(--muted);font-weight:400;margin:0 .45em}
.apptitle{font-size:12.5px;font-weight:600;color:var(--accent);margin-top:5px;line-height:1.1}
.top-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}

/* Language toggle — shared pill design with the Dashboard / Begleiter / Verteidigungs-Coach */
.lang-toggle{position:relative;display:inline-flex;align-items:center;background:#e2e8f0;border-radius:999px;padding:3px;margin-right:8px;align-self:center;-webkit-user-select:none;user-select:none}
.lang-toggle button{position:relative;z-index:1;border:0;background:transparent;color:#64748b;font-family:inherit;font-size:11.5px;font-weight:700;letter-spacing:.3px;width:30px;padding:4px 0;margin:0;text-align:center;line-height:1.3;cursor:pointer;transition:color .2s;border-radius:0;min-width:0}
.lang-toggle button:hover{filter:none}
.lang-toggle button.active{color:#fff}
.lang-slider{position:absolute;top:3px;bottom:3px;left:3px;width:30px;background:var(--accent);border-radius:999px;box-shadow:0 1px 2px rgba(0,0,0,.15);transition:transform .22s ease;z-index:0}
.lang-toggle[data-lang='en'] .lang-slider{transform:translateX(30px)}
.lang-toggle[data-lang='fr'] .lang-slider{transform:translateX(60px)}
.lang-toggle[data-lang='it'] .lang-slider{transform:translateX(90px)}

/* Mobile language selector — compact globe button + dropdown card (suite-wide pattern).
   Desktop (>=561px): globe hidden, pill exactly as before (.lang-dropdown is display:contents).
   Mobile (<=560px): pill hidden behind a globe button in the top header row; tapping it
   opens the unchanged pill inside a white dropdown card, right-aligned under the header. */
.lang-globe{display:none;flex:0 0 auto;width:34px;height:34px;align-items:center;justify-content:center;padding:0;border:1px solid var(--line);border-radius:999px;background:var(--card);color:var(--ink);font-size:17px;line-height:1;cursor:pointer}
.lang-globe:hover{filter:none;border-color:var(--accent)}
.lang-dropdown{display:contents}

@media (max-width:560px){
  header.top{flex-wrap:nowrap;position:relative}
  .lockup{flex:1 1 auto;min-width:0}                       /* lockup shrinks so the header row never wraps */
  .top-right{flex:0 1 auto;min-width:0;flex-wrap:nowrap}
  #authArea{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .lang-globe{display:inline-flex}
  .lang-dropdown{display:none;position:absolute;top:calc(100% + 6px);right:12px;z-index:40;background:var(--card);border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.14);padding:6px}
  .lang-dropdown.open{display:block}
  .lang-dropdown .lang-toggle{margin-right:0}
}

.wrap{max-width:700px;margin:0 auto;padding:20px 22px 50px;width:100%;flex:1 0 auto}

.screen{display:none}
.screen.active{display:block}

.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:20px;margin:14px 0}

h2{font-size:17px;margin:0 0 6px}
.muted{color:var(--muted);font-size:12.5px}

label{display:block;font-size:12.5px;color:var(--muted);font-weight:600;margin:10px 0 3px}

textarea,input[type=email],input[type=password],input[type=text]{width:100%;border:1px solid var(--line);border-radius:8px;padding:9px 11px;font:inherit;font-size:14px;background:#fcfcfb;color:var(--ink)}
textarea{min-height:160px;resize:vertical}

code{background:var(--accent-bg);color:#00461f;border-radius:4px;padding:1px 5px;font-size:0.92em}

button{font:inherit;font-size:14px;border:1px solid var(--accent);background:var(--accent);color:#fff;border-radius:8px;padding:9px 15px;cursor:pointer;font-weight:500}
button:hover{filter:brightness(1.05)}
button.ghost{background:#fff;color:var(--accent)}
button.sm{padding:5px 10px;font-size:13px}
button:disabled{opacity:.5;cursor:not-allowed}

.row{display:flex;gap:10px;flex-wrap:wrap;align-items:center}

/* ready-made deck picker — compact one-row-per-deck list */
#presetRow{display:block;margin-top:16px}
.preset-heading{margin:0 0 4px;font-weight:600}
.preset-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:7px 0;border-top:1px solid var(--line)}
.preset-row:first-of-type{border-top:0}
.preset-name{font-size:13px}
.preset-controls{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.preset-pick{border:1px solid var(--line);border-radius:8px;padding:6px 9px;font:inherit;font-size:13px;background:#fcfcfb;color:var(--ink);cursor:pointer}

.notice{font-size:12.5px;padding:8px 12px;border-radius:8px;margin:12px 0 0}
.notice.bad{background:var(--bad-bg);color:var(--bad)}
.notice.warn{background:var(--warn-bg);color:#7a5a13}
.notice.ok{background:var(--ok-bg);color:var(--ok)}

.set-list{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0}
.set-chip{background:#fcfcfb;border:1px solid var(--line);border-radius:9px;padding:12px 16px;cursor:pointer;text-align:center;min-width:110px}
.set-chip:hover{border-color:var(--accent)}
.set-chip .len{font-size:1.3rem;font-weight:700;color:var(--ink)}
.set-chip .count{color:var(--muted);font-size:12px}

.game-toolbar{margin-bottom:4px}
#sessionSizeRow{margin:14px 0 18px}
#revealPanel button{margin-top:10px}

.board{display:flex;flex-direction:column;gap:6px;align-items:center;margin:16px auto 8px}
.board-row{display:flex;gap:6px}
.tile{
  width:52px;height:52px;border:2px solid var(--line);
  display:flex;align-items:center;justify-content:center;
  font-size:1.5rem;font-weight:700;text-transform:uppercase;border-radius:6px;
  background:#fcfcfb;color:var(--ink);
}
.tile.filled{border-color:#b9b8b3}
.tile.correct{background:var(--ok);border-color:var(--ok);color:#fff}
.tile.present{background:var(--warn);border-color:var(--warn);color:#fff}
.tile.absent{background:var(--muted);border-color:var(--muted);color:#fff}

.message{text-align:center;min-height:1.5em;font-size:1.1rem;font-weight:600;color:var(--ink);margin:6px 0}

.keyboard{display:flex;flex-direction:column;gap:8px;align-items:center;margin-top:1.25rem}
.kb-row{display:flex;gap:6px;justify-content:center;flex-wrap:wrap}
.key{
  background:#fff;color:var(--ink);border:1px solid var(--line);
  border-radius:6px;padding:0.8rem 0.55rem;min-width:2.3rem;
  font-weight:600;cursor:pointer;text-transform:uppercase;font-size:0.9rem;
}
.key.wide{min-width:3.8rem;font-size:0.75rem}
.key.correct{background:var(--ok);color:#fff;border-color:var(--ok)}
.key.present{background:var(--warn);color:#fff;border-color:var(--warn)}
.key.absent{background:var(--muted);color:#fff;border-color:var(--muted)}

.app-note{text-align:center;margin:24px 0 0}

/* Footer — shared with the Dashboard / Begleiter / Verteidigungs-Coach */
.site-footer{border-top:1px solid var(--line);background:var(--card);padding:18px 22px;text-align:center;font-size:12.5px;color:var(--muted)}
.site-footer a{color:var(--accent);text-decoration:none}
.site-footer a:hover{text-decoration:underline}
.site-footer p{margin:3px 0}

/* auth header widget */
#authArea{font-size:12.5px;color:var(--muted)}
#authArea a, #authArea button.linklike{background:none;border:none;color:var(--accent);font-weight:600;cursor:pointer;padding:0;font-size:12.5px}

/* saved lists */
.list-row{display:flex;justify-content:space-between;align-items:center;border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:8px 0;background:#fcfcfb;gap:10px}
.list-row .name{font-weight:600}
.list-row .meta{color:var(--muted);font-size:12px}

/* hint ladder — earned hints shown under the board */
.hint-area{text-align:center}
.hint-area .hint-line{display:block}

/* hint-ladder checkbox (session-size screen) */
.checkbox-row{display:flex;align-items:flex-start;gap:8px;margin:12px 0;font-size:13px;color:var(--ink);cursor:pointer}
.checkbox-row input{margin:3px 0 0;flex:0 0 auto;accent-color:var(--accent)}

/* session join code */
.join-code{font-size:2.4rem;font-weight:700;letter-spacing:0.25em;text-align:center;background:var(--accent-bg);color:#00461f;border-radius:10px;padding:14px;margin:10px 0}

/* session QR code — print/beamer-friendly: dark modules on a white card */
.qr-block{flex-direction:column;align-items:center;gap:6px;margin:16px 0 4px}
.qr-card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:12px;line-height:0}
.qr-card svg{display:block;width:188px;height:188px}
.qr-caption{margin:0}

/* leaderboard */
.leaderboard{width:100%;border-collapse:collapse;font-size:13px;margin-top:14px}
.leaderboard th,.leaderboard td{text-align:left;border-bottom:1px solid var(--line);padding:7px 6px}
.leaderboard th{color:var(--muted);font-weight:600;font-size:11.5px;text-transform:uppercase}
.leaderboard td.score{font-weight:700;color:var(--accent)}

@media (max-width:480px){
  .tile{width:40px;height:40px;font-size:1.15rem}
  .key{padding:0.65rem 0.4rem;min-width:1.7rem;font-size:0.78rem}
}
