/* Page « Jouer » : style repris de la page web de Phosphoric (~/Oric1/web/shell.html, même auteur, EUPL-1.2) —
   thème sombre, rail d'icônes, cadre de l'écran, clavier translucide en surimpression, filtre CRT. */
:root { color-scheme: dark; --bg:#0a0a0e; --panel:#15151f; --line:#2a2a40;
        --ink:#e2e2ea; --dim:#8a8a99; --accent:#7aa2ff; --hot:#ffb454; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: radial-gradient(1200px 600px at 50% -10%, #16162a 0%, var(--bg) 60%);
  color: var(--ink); font-family: ui-monospace, "Cascadia Code", Menlo, Consolas, monospace;
  display: flex; min-height: 100vh;
}
a { color: var(--accent); }

/* ── rail d'icônes ─────────────────────────────────────────────── */
#rail {
  width: 72px; flex: 0 0 72px; background: rgba(18,18,28,.72);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 14px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.rbtn { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); cursor: pointer; position: relative; text-decoration: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 0;
  font: inherit; transition: background .12s, border-color .12s, transform .05s; }
.rbtn:hover { border-color: #44446a; background: #1b1b2a; }
.rbtn:active { transform: scale(.94); }
.rbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.rbtn svg { width: 22px; height: 22px; stroke: currentColor; fill: none;
            stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.rbtn .cap { font-size: 8.5px; letter-spacing: .02em; color: var(--dim); line-height: 1; white-space: nowrap; }
.rbtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.rbtn[aria-pressed="true"] .cap { color: var(--accent); }
.rspacer { flex: 1; }

/* ── scène ──────────────────────────────────────────────────────── */
#stage { flex: 1; display: flex; flex-direction: column; align-items: center;
         gap: 12px; padding: 18px 14px 26px; min-width: 0; }
h1 { font-size: 14px; font-weight: 600; letter-spacing: .05em; margin: 2px 0 0; color: #c9c9d6;
     display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; text-align: center; }
h1 small { color: var(--dim); font-weight: 400; }
#lang { font: inherit; font-size: 11px; padding: 3px 9px; border-radius: 8px; border: 1px solid var(--line);
        background: var(--panel); color: var(--dim); cursor: pointer; }
#lang:hover { color: var(--ink); border-color: #44446a; }
#frame { background: #000; border: 1px solid var(--line); border-radius: 10px;
         padding: 10px; box-shadow: 0 10px 50px rgba(0,0,0,.6); position: relative; }
#canvas { display: block; width: 760px; max-width: calc(100vw - 72px - 50px); max-height: calc(100vh - 170px);
          aspect-ratio: 4/3; object-fit: contain; image-rendering: pixelated; background: #000; border-radius: 5px; outline: none; }
#frame:fullscreen { width: 100vw; height: 100vh; padding: 0; border: 0; border-radius: 0;
                    display: flex; align-items: center; justify-content: center; }
#frame:fullscreen #canvas { width: auto; height: 100vh; max-width: 100vw; max-height: 100vh; border-radius: 0; }
.drop { position: absolute; inset: 6px; border: 2px dashed var(--accent); border-radius: 7px;
  display: none; align-items: center; justify-content: center;
  background: rgba(10,10,18,.8); color: var(--accent); font-size: 14px; z-index: 9; pointer-events: none; }
#frame.dragging .drop { display: flex; }
#status { font-size: 12px; color: var(--dim); min-height: 1.2em; text-align: center; }
.help { font-size: 11px; color: var(--dim); max-width: 760px; text-align: center; line-height: 1.5; margin: 0; }

/* filtre CRT : trames + vignettage, léger regain de phosphore */
.scan { position: absolute; inset: 10px; border-radius: 5px; pointer-events: none; z-index: 6;
  mix-blend-mode: multiply; opacity: 0; transition: opacity .2s;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.22) 0, rgba(0,0,0,.22) 1px, transparent 1px, transparent 3px),
    radial-gradient(125% 125% at 50% 50%, transparent 58%, rgba(0,0,0,.5) 100%); }
#frame:fullscreen .scan { inset: 0; }
#frame.crt .scan { opacity: 1; }
#frame.crt #canvas { filter: saturate(1.2) contrast(1.06) brightness(1.06); }

/* ── clavier virtuel : en surimpression sur l'écran, masquable ───── */
#kbd {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 8;
  background: linear-gradient(180deg, rgba(26,26,42,.50), rgba(12,12,22,.46));
  backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px);
  border: 1px solid rgba(120,130,180,.22); border-radius: 12px;
  padding: 8px; display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 6px 26px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  transition: opacity .18s, transform .18s; user-select: none; -webkit-user-select: none; touch-action: none;
}
#frame.kbd-off #kbd { opacity: 0; transform: translateY(8px); pointer-events: none; }
#kbd .row { display: flex; gap: 4px; }
#kbd .key { flex: 1 1 0; min-width: 0; height: 34px; border-radius: 7px;
  background: rgba(44,46,68,.62); border: 1px solid rgba(150,160,200,.20);
  color: #eef0f8; display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer; touch-action: none; line-height: 1;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.25); transition: background .06s, transform .04s; }
#kbd .key .sup { font-size: 8.5px; color: var(--dim); height: 9px; margin-bottom: 1px; }
#kbd .key.held { background: var(--accent); color: #06060a; transform: translateY(1px); }
#kbd .key.held .sup { color: #06060a; }
#kbd .key.mod { background: rgba(64,54,40,.6); font-size: 10px; letter-spacing: .02em; }
#kbd .key.mod.on { background: var(--hot); color: #06060a; border-color: var(--hot); }
#kbd .key.lbl { font-size: 9.5px; }

/* petit écran : rail plus étroit, clavier sous l'écran (en surimpression il cacherait tout) */
@media (max-width: 720px) {
  #rail { width: 60px; flex-basis: 60px; gap: 8px; }
  .rbtn { width: 44px; height: 44px; flex-basis: 44px; }
  #stage { padding: 12px 8px 20px; }
  #canvas { max-width: calc(100vw - 60px - 38px); }
  #kbd { position: static; margin-top: 8px; padding: 5px; gap: 3px; }
  #kbd .row { gap: 3px; }
  #kbd .key { height: 30px; font-size: 10.5px; }
  #kbd .key.lbl { font-size: 8.5px; }
  #frame.kbd-off #kbd { display: none; }
}
