:root {
  color-scheme: dark;
  --bg: #171918;
  --border: #363a35;
  --text: #f1f4ed;
  --accent: #d3f76b;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, a, select { font: inherit; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button, select { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .35; cursor: default; }
.workspace { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100vh; height: 100dvh; }
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left));
}
#game-picker {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
}
.quiet-button, .icon-button, .next-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-weight: 500;
}
.icon-button { width: 44px; flex-shrink: 0; padding: 10px; }
.player { position: relative; min-height: 0; overflow: hidden; background: white; color: var(--bg); }
.game-pane { position: absolute; inset: 0; background: white; }
.game-pane[hidden], .loading[hidden] { display: none; }
iframe { display: block; width: 100%; height: 100%; border: 0; background: white; color-scheme: normal; }
.sequence {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.sequence button { min-height: 48px; }
.next-button { background: var(--accent); color: #1a2510; border-color: var(--accent); font-weight: 600; }
.direct-play, .loading { height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px; }
.loading { position: absolute; inset: 0; background: #fff; color: #626a59; }
@media (hover: hover) {
  .quiet-button:hover, .icon-button:hover { background: #2d322a; }
  .next-button:hover { background: #e0ff90; }
}
@media (min-width: 768px) {
  .toolbar { gap: 12px; padding: 12px 24px; }
  #game-picker { flex: 0 1 280px; }
  #reload { margin-left: auto; }
  .sequence { display: flex; justify-content: space-between; padding: 12px 24px; }
  .sequence button { min-width: 160px; }
}
