/* SchoolBros skin for the Boxedwine runner */
:root { color-scheme: dark; --sb-accent: #ccff00; --sb-muted: rgba(236, 241, 255, 0.62); --sb-stroke: rgba(255, 255, 255, 0.14); }
html, body { background: #05060b !important; color: #ecf1ff !important; margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif !important; }
body { min-height: 100vh; }

/* Hide legacy Boxedwine loading DOM - replaced by modern SchoolBros game card */
#loading { display: none !important; }

#sb-panel { max-width: 680px; margin: 0 auto; padding: 48px 20px 24px; }
.sb-card { background: rgba(16, 20, 28, 0.85); backdrop-filter: blur(20px); border: 1px solid rgba(204, 255, 0, 0.2); border-radius: 20px; padding: 28px 32px; box-shadow: 0 16px 40px rgba(0,0,0,0.6); }
.sb-game-badge { display: inline-block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; color: var(--sb-accent); background: rgba(204, 255, 0, 0.12); border: 1px solid rgba(204, 255, 0, 0.3); padding: 3px 10px; border-radius: 999px; }
#sb-panel h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); letter-spacing: -0.02em; margin: 0 0 0.4rem; font-weight: 900; color: #fff; }
.sb-sub { color: var(--sb-muted); font-size: 0.95rem; line-height: 1.5; margin: 0 0 1.2rem; }
.sb-bar-track { width: 100%; height: 10px; background: rgba(255,255,255,0.08); border: 1px solid rgba(204,255,0,0.25); border-radius: 999px; overflow: hidden; margin: 16px 0 8px; position: relative; }
.sb-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #7fc28c, var(--sb-accent)); border-radius: 999px; transition: width 0.25s ease; box-shadow: 0 0 12px var(--sb-accent); }
.sb-progress-info { display: flex; justify-content: space-between; align-items: center; font-size: 0.88rem; font-weight: 600; color: #fff; }
.sb-progress-info #sb-custom-pct { color: var(--sb-accent); font-family: ui-monospace, monospace; font-size: 0.95rem; }
.sb-tips { background: rgba(255,255,255,0.04); border: 1px solid var(--sb-stroke); border-radius: 12px; padding: 12px 16px; margin-top: 20px; font-size: 0.85rem; color: var(--sb-muted); line-height: 1.5; }
.sb-tips code { background: rgba(255,255,255,0.12); color: #fff; padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, monospace; }
#sb-status { min-height: 1.4em; font-size: 0.92rem; margin: 0.6rem 0 0; color: var(--sb-muted); }
#sb-status[data-tone="error"] { color: #ff9b8f; }
#sb-status[data-tone="ok"] { color: #e3ff7a; }

#controls { display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: center; padding: 6px 12px 14px; color: var(--sb-muted); font-size: 0.85rem; }
#controls input[type="checkbox"] { accent-color: var(--sb-accent); }
#controls button, .modalDialog button, .sb-btn-main {
  height: 42px; padding: 0 20px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 0.95rem; font-weight: 650; line-height: 1;
  background: var(--sb-accent); color: #0b0e00; border: 0; box-shadow: 0 8px 24px rgba(204, 255, 0, 0.18);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform 0.15s ease, box-shadow 0.15s ease; text-decoration: none;
}
.sb-btn-main:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(204, 255, 0, 0.35); color: #0b0e00; }
.sb-btn-sub {
  height: 42px; padding: 0 18px; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 0.88rem; font-weight: 600; line-height: 1;
  background: rgba(255, 255, 255, 0.08); color: #ecf1ff; border: 1px solid var(--sb-stroke);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: all 0.15s ease; text-decoration: none;
}
.sb-btn-sub:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.3); color: #fff; }
#controls button:disabled, .sb-btn-main:disabled { opacity: 0.55; cursor: progress; }
#downloadbtn, #savejitbtn { display: none !important; }

#dropzone { display: flex; justify-content: center; padding: 0 12px 24px; }
.emscripten_border { border: 1px solid var(--sb-stroke) !important; border-radius: 14px; overflow: hidden; background: #000; max-width: 100%; }
canvas.emscripten { display: block; max-width: 100%; height: auto; }
#console textarea { width: min(1024px, 96vw); display: block; margin: 0 auto 24px; background: #0b0d14; color: #9aa3b8;
  border: 1px solid var(--sb-stroke); border-radius: 10px; font: 12px/1.5 ui-monospace, Menlo, monospace; }
hr { display: none; }

/* Running game view */
body.sb-running { overflow: hidden !important; }
body.sb-running #sb-panel { display: none !important; }
body.sb-running #controls { display: none !important; }
body.sb-running #console { display: none !important; }
body.sb-running #loading { display: none !important; }
body.sb-running #app { height: 100vh !important; width: 100vw !important; padding: 0 !important; margin: 0 !important; }
body.sb-running #dropzone { height: 100vh !important; width: 100vw !important; padding: 0 !important; margin: 0 !important; }
body.sb-running div.emscripten_border {
  --boxedwine-canvas-width: 1024;
  --boxedwine-canvas-height: 768;
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  border: 0 !important;
  border-radius: 0 !important;
  aspect-ratio: auto !important;
}
body.sb-running canvas.emscripten {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
}

.modalDialog > div { background: #10131c !important; color: #ecf1ff !important; border: 1px solid var(--sb-stroke); border-radius: 16px !important; }
.modalDialog .close { background: rgba(255,255,255,0.12) !important; color: #fff !important; box-shadow: none !important; }
#items li { cursor: pointer; padding: 6px 8px; border-radius: 8px; }
#items li:hover { background: rgba(255, 255, 255, 0.08); }
