/* SeeBubble 64 – Oberfläche (SeeBubble Media Design: dunkles Glas, Plus Jakarta Sans) */
:root {
  --bg: #050308;
  --bg-2: #0a0812;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.68);
  --text-3: rgba(255, 255, 255, 0.45);
  --accent: #4d9eff;
  --accent-2: #8b5cf6;
  --ok: #34d399;
  --warn: #fbbf24;
  --err: #ff5e62;
  --grad: linear-gradient(135deg, #ff4d5e 0%, #ff9f43 25%, #ffd93d 50%, #4dd599 75%, #4d9eff 100%);
  --grad-soft: linear-gradient(135deg, rgba(77, 158, 255, 0.9), rgba(139, 92, 246, 0.9));
  --c64-blue: #40318d;
  --c64-light: #7869c4;
  --radius: 18px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before, body::after {
  content: "";
  position: fixed;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
body::before { top: -25vw; left: -20vw; background: #4d9eff; }
body::after { bottom: -30vw; right: -20vw; background: #8b5cf6; }

button, input, select { font-family: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Kopfleiste ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: rgba(5, 3, 8, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.2px; }
.brand-sub { font-size: 0.72rem; color: var(--text-3); font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; }
.topbar-spacer { flex: 1; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); box-shadow: 0 0 0 0 transparent; transition: background 0.15s, box-shadow 0.15s; }
.dot.ok { background: var(--ok); box-shadow: 0 0 10px rgba(52, 211, 153, 0.7); }
.dot.warn { background: var(--warn); box-shadow: 0 0 10px rgba(251, 191, 36, 0.6); }
.dot.err { background: var(--err); box-shadow: 0 0 10px rgba(255, 94, 98, 0.6); }
.dot.led-on { background: #ff3b3b; box-shadow: 0 0 12px rgba(255, 59, 59, 0.95); }
.lang-toggle, .home-link {
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
}
.lang-toggle:hover, .home-link:hover { border-color: var(--border-hover); text-decoration: none; }

/* ---------- Layout ---------- */
.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 22px 24px 40px;
}
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
}
.glass {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- Bildschirm ---------- */
.stage { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.monitor {
  position: relative;
  padding: 18px;
  border-radius: 26px;
  background: linear-gradient(160deg, #17132a 0%, #0b0915 100%);
  border: 1px solid var(--border);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.monitor::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 26px;
  padding: 1px;
  background: var(--grad);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.35;
  pointer-events: none;
}
.screen {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
}
.screen canvas {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
  outline: none;
}
.screen.pixelated canvas { image-rendering: pixelated; image-rendering: crisp-edges; }
.screen:fullscreen { border-radius: 0; aspect-ratio: auto; }
.monitor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 4px 0;
  color: var(--text-3);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.monitor-foot .rainbow { width: 90px; height: 6px; border-radius: 3px; background: var(--grad); opacity: 0.85; }

/* Einschalt- und Ablage-Overlays */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(64, 49, 141, 0.55), rgba(5, 3, 8, 0.94) 70%);
  z-index: 5;
}
.overlay[hidden] { display: none; }
.overlay h2 { margin: 0; font-size: clamp(1.3rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: -0.5px; }
.overlay p { margin: 0; color: var(--text-2); max-width: 520px; font-size: 0.95rem; line-height: 1.55; }
.power-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 30px;
  border: 0;
  border-radius: 16px;
  background: var(--grad-soft);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(77, 158, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.power-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 50px rgba(77, 158, 255, 0.45); }
.power-btn:disabled { opacity: 0.55; cursor: progress; transform: none; }
.drop-overlay {
  background: rgba(77, 158, 255, 0.16);
  border: 3px dashed rgba(77, 158, 255, 0.85);
  border-radius: 14px;
  z-index: 6;
  pointer-events: none;
}

/* ---------- Werkzeugleisten ---------- */
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
}
.tb-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tb-sep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--panel-strong);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--border-hover); background: rgba(255, 255, 255, 0.09); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary { background: var(--grad-soft); border-color: transparent; }
.btn.danger { color: #ffb4b6; }
.btn.active { border-color: rgba(77, 158, 255, 0.8); background: rgba(77, 158, 255, 0.18); }
.btn .ico { font-size: 0.95rem; line-height: 1; }
.btn-basic { font-family: var(--mono); font-weight: 700; letter-spacing: 0.3px; color: #c9c2ff; }
.cmd-form { display: flex; gap: 6px; flex: 1 1 260px; min-width: 220px; }
.cmd-input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
  color: #d9d4ff;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
}
.cmd-input:focus { outline: none; border-color: rgba(77, 158, 255, 0.8); }

/* ---------- Seitenleiste ---------- */
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel { padding: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.panel-title { margin: 0; font-size: 0.92rem; font-weight: 800; letter-spacing: -0.1px; display: flex; align-items: center; gap: 8px; }
.panel-note { margin: 10px 0 0; font-size: 0.76rem; color: var(--text-3); line-height: 1.5; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 8px; }

/* Laufwerk */
.drive {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, #1d1935, #110e20);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.drive:hover, .drive.dragover { border-color: rgba(77, 158, 255, 0.7); }
.floppy {
  position: relative;
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 6px;
  background: #1a1730;
  border: 2px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.floppy::before { content: ""; position: absolute; left: 12px; right: 12px; top: -2px; height: 18px; background: #0b0918; border: 2px solid rgba(255, 255, 255, 0.14); border-top: 0; }
.floppy::after { content: ""; position: absolute; left: 0; right: 0; bottom: 8px; height: 12px; background: var(--grad); opacity: 0.25; }
.drive.has-disk .floppy::after { opacity: 0.95; }
.drive-info { min-width: 0; flex: 1; }
.drive-label { font-size: 0.7rem; color: var(--text-3); font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.drive-name { margin-top: 3px; font-weight: 800; font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drive-mode { margin-top: 3px; font-size: 0.74rem; color: var(--text-2); }
.drive-led { position: absolute; top: 12px; right: 12px; }

/* Verzeichnis im C64-Stil */
.dir {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px 12px 10px;
  background: var(--c64-blue);
  border: 6px solid var(--c64-light);
  color: var(--c64-light);
  font-family: var(--mono);
  font-size: 0.76rem;
  line-height: 1.45;
  max-height: 290px;
  overflow: auto;
}
.dir[hidden] { display: none; }
.dir-head { color: var(--c64-blue); background: var(--c64-light); display: inline-block; padding: 0 4px; margin-bottom: 4px; white-space: pre; }
.dir-entry {
  display: grid;
  grid-template-columns: 3.4em minmax(0, 1fr) 2.8em;
  gap: 6px;
  width: 100%;
  padding: 2px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  white-space: pre;
}
.dir-entry:hover, .dir-entry:focus-visible { background: var(--c64-light); color: var(--c64-blue); outline: none; }
.dir-entry[disabled] { cursor: default; opacity: 0.6; }
.dir-entry[disabled]:hover { background: transparent; color: inherit; }
.dir-foot { margin-top: 4px; white-space: pre; }

/* Umschalter */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); }
.seg button {
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.seg button.on { background: rgba(77, 158, 255, 0.22); color: #fff; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; font-size: 0.84rem; color: var(--text-2); cursor: pointer; }
.switch input { appearance: none; width: 40px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); position: relative; cursor: pointer; transition: background 0.15s; flex: 0 0 auto; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.kbd { font-family: var(--mono); font-size: 0.72rem; padding: 1px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); color: var(--text); }

/* ROM-Steckplätze */
.roms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rom-slot { padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); min-width: 0; }
.rom-slot .rom-type { font-size: 0.68rem; color: var(--text-3); font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; display: flex; align-items: center; gap: 6px; min-width: 0; }
.rom-slot .rom-type .dot { flex: 0 0 auto; }
.rom-slot .rom-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rom-slot .rom-name { margin-top: 4px; font-size: 0.78rem; font-weight: 700; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.volume { width: 100%; accent-color: var(--accent); }

/* ---------- Virtuelle Tastatur ---------- */
.keyboard-dock {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto 28px;
  padding: 0 24px;
}
.keyboard-dock[hidden] { display: none; }
.c64kb {
  padding: 16px 16px 14px;
  border-radius: 20px;
  background: linear-gradient(170deg, #2a2438 0%, #16121f 100%);
  border: 1px solid var(--border);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overflow-x: auto;
}
.kb-rows { display: flex; flex-direction: column; gap: 6px; min-width: 820px; }
.kb-row { display: flex; gap: 6px; }
.kb-main { display: flex; gap: 14px; }
.kb-left { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.kb-fkeys { width: 70px; display: flex; flex-direction: column; gap: 6px; }
.key {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: 46px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #4b4358 0%, #3a3346 100%);
  box-shadow: 0 3px 0 #1c1826, inset 0 1px 0 rgba(255, 255, 255, 0.1);
  color: #f4f1ff;
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1.05;
  transition: transform 0.05s, box-shadow 0.05s, background 0.1s;
}
.key small { display: block; font-size: 0.6rem; font-weight: 600; color: rgba(244, 241, 255, 0.55); margin-bottom: 2px; }
.key.pressed, .key:active { transform: translateY(2px); box-shadow: 0 1px 0 #1c1826; background: linear-gradient(180deg, #5b5170, #463d56); }
.key.latched { background: linear-gradient(180deg, #3f6fb8, #2f5896); box-shadow: 0 3px 0 #1a2f52, 0 0 14px rgba(77, 158, 255, 0.45); }
.key.w15 { flex-grow: 1.5; }
.key.w2 { flex-grow: 2; }
.key.space { flex-grow: 9; }
.key.fkey { flex: 1 1 auto; background: linear-gradient(180deg, #b36b2a 0%, #8e531f 100%); box-shadow: 0 3px 0 #4a2a0e, inset 0 1px 0 rgba(255, 255, 255, 0.15); }
.key.fkey.pressed, .key.fkey:active { background: linear-gradient(180deg, #c77d38, #a0612a); box-shadow: 0 1px 0 #4a2a0e; }
.key.cbm { background: linear-gradient(180deg, #5a4f70, #43395a); }
.key-spacer { flex: 0.5 1 0; }
.kb-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; color: var(--text-3); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.5px; }

/* ---------- Touch-Joystick ---------- */
.touchpad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
  pointer-events: none;
}
.touchpad[hidden] { display: none; }
.stick-zone, .fire-zone { pointer-events: auto; touch-action: none; }
.stick-zone {
  position: relative;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: rgba(20, 16, 34, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 70px;
  height: 70px;
  margin: -35px 0 0 -35px;
  border-radius: 50%;
  background: var(--grad-soft);
  box-shadow: 0 10px 26px rgba(77, 158, 255, 0.45);
  transition: transform 0.06s;
}
.fire-zone {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 0;
  background: radial-gradient(circle at 35% 30%, #ff7a7f, #d8303a 70%);
  box-shadow: 0 12px 30px rgba(216, 48, 58, 0.5), inset 0 -6px 0 rgba(0, 0, 0, 0.25);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1px;
}
.fire-zone.pressed { transform: scale(0.95); box-shadow: 0 6px 16px rgba(216, 48, 58, 0.5), inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
.touch-port { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 0.72rem; font-weight: 800; color: var(--text-2); white-space: nowrap; }

/* ---------- Dialoge & Meldungen ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 2, 6, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(640px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 26px;
  border-radius: 22px;
  background: linear-gradient(170deg, #17132a, #0c0a16);
  border: 1px solid var(--border);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6);
}
.modal h2 { margin: 0 0 8px; font-size: 1.35rem; font-weight: 800; letter-spacing: -0.3px; }
.modal p { color: var(--text-2); line-height: 1.6; font-size: 0.92rem; margin: 0 0 12px; }
.modal ul { color: var(--text-2); line-height: 1.6; font-size: 0.88rem; padding-left: 20px; margin: 0 0 14px; }
.modal .actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.option-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--panel);
  margin-bottom: 10px;
}
.option-card h3 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 800; }
.option-card p { margin: 0 0 10px; font-size: 0.84rem; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.85rem; color: var(--text-2); margin-bottom: 14px; }

.toasts { position: fixed; top: 76px; right: 20px; z-index: 70; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 40px)); }
.toast {
  padding: 12px 14px;
  border-radius: 13px;
  background: rgba(23, 19, 42, 0.95);
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--text);
  animation: toast-in 0.2s ease-out;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.45); }
.toast.warn { border-color: rgba(251, 191, 36, 0.5); }
.toast.err { border-color: rgba(255, 94, 98, 0.55); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

.unsupported { margin: 40px auto; max-width: 640px; padding: 24px; text-align: center; }
.unsupported[hidden] { display: none; }

footer.site {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 24px 40px;
  color: var(--text-3);
  font-size: 0.78rem;
  line-height: 1.6;
  border-top: 1px solid var(--border);
}
footer.site .links { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 8px; }
footer.site .links a { color: var(--text-2); font-weight: 600; }

@media (max-width: 640px) {
  .topbar { padding: 10px 14px; flex-wrap: wrap; }
  .chips { order: 3; width: 100%; }
  .layout { padding: 14px; }
  .monitor { padding: 10px; border-radius: 18px; }
  .btn { padding: 8px 10px; font-size: 0.78rem; }
  .stick-zone { width: 140px; height: 140px; }
  .fire-zone { width: 100px; height: 100px; }
}
