/* Super Sláinte. Responsive WebGL player with touch D-pad. */
:root { color-scheme: dark; --bg:#091510; --panel:#10231a; --fg:#f4fbf6; --muted:#b0c4b7; --accent:#92efb3; }
* { box-sizing: border-box; }
html { min-height:100%; background:var(--bg); }
body { margin:0; min-height:100vh; font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; color:var(--fg); background:var(--bg); }
button { font:inherit; }
button:focus-visible, a:focus-visible { outline:3px solid var(--accent); outline-offset:4px; }
.page-shell { min-height:100vh; display:flex; flex-direction:column; }
.site-header, .main-content, .site-footer { width:min(100% - 48px, 1360px); margin-inline:auto; }
.site-header { min-height:92px; display:flex; align-items:center; justify-content:space-between; gap:16px; border-bottom:1px solid #264332; }
.wordmark { color:var(--fg); font-size:1.45rem; font-weight:800; letter-spacing:-0.07em; text-decoration:none; }
.wordmark span { color:var(--accent); }
.header-caption, .intro-kicker { font-size:0.66rem; letter-spacing:0.18em; font-weight:700; color:var(--muted); }
.main-content { flex:1; padding-block:38px 42px; }
.intro { max-width:780px; margin-inline:auto; display:flex; gap:20px; align-items:end; justify-content:space-between; margin-bottom:20px; }
.intro-kicker { margin:0 0 8px; }
h1 { font-size:clamp(1.7rem,4vw,3rem); line-height:1.08; letter-spacing:-0.045em; margin:0; }
.intro-description { color:var(--muted); margin:0 0 5px; font-size:0.92rem; }
.player-frame { width:100%; max-width:780px; margin-inline:auto; }
.game-stage { width:100%; max-width:780px; margin-inline:auto; aspect-ratio:1/1; position:relative; overflow:hidden; isolation:isolate; background:#0b1d15; border:1px solid #315440; border-radius:12px; box-shadow:0 22px 80px #0008; }
.game-canvas { position:absolute; inset:0; width:100%; height:100%; background:#000; overflow:hidden; }
.game-canvas canvas { display:block; width:100% !important; height:100% !important; outline:none; object-fit:contain; touch-action:none; }
.loading-overlay, .error-overlay { z-index:5; position:absolute; inset:0; display:grid; place-items:center; padding:20px; background:radial-gradient(circle at 50% 40%,#234e34 0%,#10251b 45%,#091510 92%); text-align:center; }
.loading-overlay.is-hidden { opacity:0; visibility:hidden; pointer-events:none; transition:opacity 350ms,visibility 350ms; }
.loading-content, .error-content { width:min(100%,350px); display:flex; flex-direction:column; align-items:center; gap:13px; }
.loader-mark { display:inline-block; width:44px; height:44px; border-radius:50%; border:3px solid #3a6650; border-top-color:var(--accent); animation:spin 900ms linear infinite; margin-bottom:5px; }
.eyebrow { display:block; color:var(--accent); letter-spacing:0.19em; font-weight:800; font-size:0.67rem; }
.loading-content h2, .error-content h2 { margin:0; font-size:clamp(1.05rem,2vw,1.35rem); font-weight:650; letter-spacing:-.02em; }
.subtle, .error-content p { color:var(--muted); font-size:0.79rem; line-height:1.55; margin:0; }
.progress-track { height:6px; width:100%; border-radius:20px; overflow:hidden; background:#374151; margin-top:8px; }
.progress-fill { width:0; height:100%; background:linear-gradient(90deg,#43b876,#b2fbd0); border-radius:20px; transition:width 200ms ease; }
.percentage { font-size:0.74rem; font-variant-numeric:tabular-nums; color:#d2dce8; }
.slow-hint { font-size:0.74rem; color:var(--muted); line-height:1.5; margin:0; }
.fullscreen-button { z-index:7; position:absolute; top:12px; right:12px; width:38px; height:38px; display:grid; place-items:center; border:1px solid #ffffff42; background:#091b12d9; border-radius:8px; color:white; cursor:pointer; backdrop-filter:blur(12px); }
.fullscreen-button:hover { background:#163b28; }
.fullscreen-button svg { width:19px; height:19px; }
.retry-button { margin-top:10px; cursor:pointer; background:var(--accent); color:#0b0f17; font-weight:700; border:0; padding:10px 17px; border-radius:7px; }
.player-toast { z-index:8; position:absolute; left:50%; bottom:20px; transform:translateX(-50%); max-width:calc(100% - 24px); background:#0c1823e6; border:1px solid #6f8697; border-radius:7px; padding:8px 12px; font-size:0.77rem; text-align:center; color:white; opacity:0; pointer-events:none; transition:opacity .2s; }
.player-toast.visible { opacity:1; }
.player-footer { max-width:780px; margin:13px auto 0; display:flex; justify-content:space-between; gap:12px; color:var(--muted); font-size:0.76rem; }
.site-footer { margin-top:auto; padding:24px 0; border-top:1px solid #264332; font-size:0.64rem; letter-spacing:0.14em; color:#8a95a6; }
.site-footer span { padding-inline:8px; }
[hidden] { display:none !important; }
.player-frame:fullscreen, .player-frame:-webkit-full-screen, .player-frame.mobile-expanded {
  width:100%; max-width:none; margin:0; height:100dvh; min-height:0; background:var(--bg);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:max(10px,env(safe-area-inset-top)) 12px max(12px,env(safe-area-inset-bottom));
  overflow:auto;
}
.player-frame.mobile-expanded { position:fixed; inset:0; z-index:1000; }
html.mobile-expanded, body.mobile-expanded { overflow:hidden; }
.player-frame:fullscreen .game-stage, .player-frame:-webkit-full-screen .game-stage, .player-frame.mobile-expanded .game-stage {
  width:min(100%, 74dvh, 780px); max-width:780px; flex:none;
}
.player-frame:fullscreen .touch-controls, .player-frame:-webkit-full-screen .touch-controls, .player-frame.mobile-expanded .touch-controls { width:min(100%,780px); flex:none; }

.embed-mode { min-height:0; width:100%; overflow:auto; }
.embed-wrapper { width:100%; max-width:780px; margin:0 auto; padding:0; }
.embed-mode .game-stage { width:100%; max-width:none; border-radius:0; box-shadow:none; }
.embed-mode .touch-controls { border-radius:0; }
.embed-open { margin:12px auto 16px; text-align:center; font-size:.76rem; }
.embed-open a { color:var(--accent); text-underline-offset:3px; }
.visually-hidden { position:absolute!important; width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
@keyframes spin { to { transform:rotate(360deg); } }
@media (max-width:700px) {
 .site-header,.main-content,.site-footer { width:min(100% - 28px, 1360px); }
 .site-header { min-height:65px; }
 .header-caption { font-size:.55rem; }
 .main-content { padding-block:22px 32px; }
 .intro { align-items:start; flex-direction:column; gap:7px; }
 .intro-description { font-size:.8rem; }
 .game-stage { border-radius:8px; }
 .player-footer { flex-direction:column; gap:4px; font-size:.7rem; }
 .loading-content,.error-content { gap:7px; }
 .loader-mark { width:30px; height:30px; }
 .loading-content h2,.error-content h2 { font-size:1rem; }
 .loading-overlay,.error-overlay { padding:10px; }
 .slow-hint { display:none; }
 .fullscreen-button { top:8px;right:8px;width:32px;height:32px; }
}

/* Touch controller: browser keyboard events keep the compiled Unity game unchanged. */
.touch-controls { margin:12px auto 0; padding:14px 18px 16px; border:1px solid #315440; border-radius:12px; background:linear-gradient(150deg,#142a1f,#0c1d15); box-shadow:0 12px 35px #0004; user-select:none; -webkit-user-select:none; }
.controls-heading { display:flex; justify-content:space-between; align-items:flex-start; gap:16px; }
.controls-heading h2 { margin:0 0 4px; font-size:.95rem; letter-spacing:-.015em; }
.controls-heading p { margin:0; font-size:.73rem; line-height:1.45; color:var(--muted); }
.mapping-button { flex:none; min-height:34px; padding:6px 10px; border:1px solid #477256; background:#203f2c; color:#d8f7e1; font-weight:650; font-size:.7rem; border-radius:7px; cursor:pointer; }
.mapping-button.is-wasd { border-color:var(--accent); background:#2a5139; }
.controls-play-area { display:flex; align-items:center; justify-content:center; gap:clamp(30px,9vw,98px); padding:12px 10px 2px; }
.direction-pad { --key-size:54px; display:grid; grid-template-columns:repeat(3,var(--key-size)); grid-template-rows:repeat(2,var(--key-size)); gap:4px; touch-action:none; }
.control-button { touch-action:none; -webkit-tap-highlight-color:transparent; cursor:pointer; border:1px solid #60866b; background:linear-gradient(180deg,#28533a,#1b3a29); color:var(--fg); border-radius:12px; box-shadow:0 5px 0 #092014, 0 10px 18px #0003; display:flex; justify-content:center; align-items:center; font-weight:800; transition:filter 90ms,transform 90ms,box-shadow 90ms; }
.control-button:active, .control-button.is-pressed { background:linear-gradient(180deg,#7cdfa1,#55b67b); color:#092516; border-color:#b9ffd1; box-shadow:0 1px 0 #092014, inset 0 2px 10px #143a2630; transform:translateY(4px); }
.control-button.direction { width:var(--key-size); height:var(--key-size); font-size:23px; line-height:1; }
.direction.up { grid-column:2; grid-row:1; }
.direction.left { grid-column:1; grid-row:2; }
.direction.down { grid-column:2; grid-row:2; }
.direction.right { grid-column:3; grid-row:2; }
.action-pad { display:flex; align-items:center; gap:12px; }
.action-button, .start-button { min-width:80px; height:78px; flex-direction:column; gap:5px; padding:9px; font-size:.65rem; letter-spacing:.06em; }
.action-symbol { display:grid; place-items:center; width:30px; height:30px; border:2px solid currentColor; border-radius:50%; font-size:.95rem; letter-spacing:0; }
.start-symbol { font-size:1.6rem; line-height:1.05; }
.controls-footnote { margin:6px 0 0; text-align:center; font-size:.69rem; line-height:1.45; color:var(--muted); }
@media (hover:hover) and (pointer:fine) { .control-button:not(.is-pressed):hover { filter:brightness(1.17); } }
@media (max-width:500px) {
  .touch-controls { padding:12px 10px 14px; margin-top:8px; }
  .controls-heading { gap:8px; }
  .controls-heading h2 { font-size:.85rem; }
  .controls-heading p { font-size:.68rem; }
  .mapping-button { font-size:.64rem; padding-inline:6px; }
  .controls-play-area { gap:clamp(12px,5vw,36px); padding:12px 0 2px; }
  .direction-pad { --key-size:clamp(46px,14.2vw,58px); gap:3px; }
  .control-button.direction { font-size:21px; border-radius:10px; }
  .action-pad { flex-direction:column; gap:10px; }
  .action-button,.start-button { min-width:76px; width:76px; height:62px; flex-direction:row; gap:5px; padding:7px; font-size:.6rem; }
  .action-symbol { flex:none; width:23px; height:23px; font-size:.72rem; border-width:1px; }
  .start-symbol { font-size:1.25rem; }
  .controls-footnote { font-size:.64rem; }
}
@media (orientation:landscape) and (max-height:540px) {
  .player-frame:fullscreen, .player-frame:-webkit-full-screen, .player-frame.mobile-expanded { flex-direction:row; gap:12px; align-items:center; padding-block:7px; }
  .player-frame:fullscreen .game-stage, .player-frame:-webkit-full-screen .game-stage, .player-frame.mobile-expanded .game-stage { width:min(56vw,94dvh); }
  .player-frame:fullscreen .touch-controls, .player-frame:-webkit-full-screen .touch-controls, .player-frame.mobile-expanded .touch-controls { flex:1; min-width:0; margin:0; }
  .player-frame:fullscreen .controls-play-area, .player-frame:-webkit-full-screen .controls-play-area, .player-frame.mobile-expanded .controls-play-area { gap:8px; }
  .player-frame:fullscreen .direction-pad, .player-frame:-webkit-full-screen .direction-pad, .player-frame.mobile-expanded .direction-pad { --key-size:clamp(38px,10dvh,52px); }
  .player-frame:fullscreen .controls-footnote, .player-frame:-webkit-full-screen .controls-footnote, .player-frame.mobile-expanded .controls-footnote { display:none; }
}

@media (prefers-reduced-motion:reduce) {
 .loader-mark { animation:none; }
 .loading-overlay.is-hidden,.progress-fill,.player-toast,.control-button { transition:none; }
}
