@import url("https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap");
@import url("https://fonts.googleapis.com/css2?family=Sora:wght@400;600;700&display=swap");

:root {
  --bg: #0a0a0d;
  --bg-soft: #111116;
  --panel: #15151c;
  --panel-alt: #20202a;
  --panel-edge: #2b2b38;
  --text: #ececf2;
  --muted: #9a9aab;
  --accent: #d7b57a;
  --danger: #d78484;
  --good: #92c8a0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #000;
  background-color: #000;
  color: var(--text);
  font-family: "Segoe UI", Inter, Arial, sans-serif;
  min-height: 100vh;
  letter-spacing: 0.2px;
  display: grid;
  place-items: center;
}

#app {
  position: relative;
  width: min(1200px, 94vw);
  margin: 0;
  padding: 24px 20px 18px;
  isolation: isolate;
}

#app::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(1536px, 100vw);
  aspect-ratio: 1536 / 871;
  max-height: 100vh;
  background: url("../public/bg.webp") center center / 100% 100% no-repeat;
  z-index: 3;
  pointer-events: none;
}

/* Background music: rechts oben über dem Artwork (nach Start sichtbar) */
.game-music-toggle {
  position: absolute;
  top: max(8px, env(safe-area-inset-top, 0px) + 4px);
  right: max(6px, env(safe-area-inset-right, 0px) + 2px);
  z-index: 18;
  width: 42px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 2px solid rgba(215, 181, 122, 0.58);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(44, 42, 58, 0.94), rgba(22, 21, 32, 0.96));
  color: #e8d4a8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 3px 0 rgba(0, 0, 0, 0.42),
    0 8px 22px rgba(0, 0, 0, 0.35);
  transition:
    border-color 0.14s ease,
    color 0.14s ease,
    filter 0.14s ease,
    opacity 0.14s ease;
}

.game-music-toggle:hover {
  border-color: rgba(232, 212, 168, 0.85);
  color: #fff6dc;
  filter: brightness(1.06);
}

.game-music-toggle:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(0, 0, 0, 0.35);
}

.game-music-toggle.is-muted {
  opacity: 0.82;
  border-color: rgba(140, 138, 155, 0.55);
  color: rgba(200, 198, 215, 0.85);
}

.game-music-toggle.is-muted:hover {
  border-color: rgba(215, 181, 122, 0.45);
  color: #e8d4a8;
}

.game-music-toggle:focus-visible {
  outline: 2px solid rgba(215, 181, 122, 0.65);
  outline-offset: 3px;
}

.game-music-toggle__icon {
  grid-area: 1 / 1;
}

.screen {
  display: grid;
  gap: 18px;
}

.hidden {
  display: none !important;
}

.hud-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #22222e;
  padding-bottom: 10px;
}

.hud-row h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 650;
  letter-spacing: 0.7px;
}

#day-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

#monitor-shell {
  background: rgba(14, 14, 18, 0.22);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  width: min(900px, 72vw);
  height: 580px;
  min-height: 580px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
  transform: translate(2.5%, calc(-10% - 34px));
  position: relative;
  z-index: 2;
  overflow: hidden;
}

#monitor-header {
  display: grid;
  /* Title row + skip; title cluster flexes (name + external icon) */
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid #2f2f3f;
  gap: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 34%, rgba(0, 0, 0, 0.12) 100%),
    linear-gradient(90deg, rgba(23, 23, 34, 0.86) 0%, rgba(34, 34, 48, 0.92) 50%, rgba(23, 23, 34, 0.86) 100%);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.06);
  position: relative;
}

#monitor-header::after {
  content: "";
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(215, 181, 122, 0.7) 50%, transparent 100%);
}

.monitor-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  min-width: 0;
}

.monitor-title-cluster {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

#monitor-title {
  margin: 0;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: 0.9px;
  font-family: "Press Start 2P", "Courier New", monospace;
  line-height: 1.45;
  color: #f8f5ff;
  text-shadow:
    0 0 14px rgba(215, 181, 122, 0.35),
    1px 1px 0 rgba(0, 0, 0, 0.65);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
}

.monitor-submit-early {
  flex-shrink: 0;
  margin-left: auto;
  align-self: center;
  padding: 7px 12px;
  font-size: 0.52rem;
  font-family: "Press Start 2P", "Courier New", monospace;
  line-height: 1.5;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f4efe8;
  cursor: pointer;
  border: 2px solid rgba(215, 181, 122, 0.55);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(48, 44, 62, 0.98), rgba(22, 21, 32, 0.99));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.4);
  transition:
    border-color 0.12s ease,
    color 0.12s ease,
    filter 0.12s ease,
    opacity 0.12s ease;
}

.monitor-submit-early:hover:not(:disabled) {
  border-color: rgba(232, 212, 168, 0.88);
  color: #fffef8;
  filter: brightness(1.06);
}

.monitor-submit-early:active:not(:disabled) {
  transform: translateY(1px);
}

.monitor-submit-early:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.monitor-open-external {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  padding: 0;
  margin: 0;
  border: 2px solid rgba(215, 181, 122, 0.55);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(40, 38, 52, 0.95), rgba(22, 21, 30, 0.98));
  color: #e8d4a8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 0 rgba(0, 0, 0, 0.45);
  cursor: pointer;
  transition:
    border-color 0.12s ease,
    color 0.12s ease,
    box-shadow 0.12s ease;
}

.monitor-open-external:hover {
  border-color: rgba(232, 212, 168, 0.85);
  color: #fff6dc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 0 12px rgba(215, 181, 122, 0.35);
}

.monitor-open-external:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.monitor-open-external-icon {
  display: block;
  flex-shrink: 0;
}

#monitor-content {
  padding: 0;
  position: relative;
  z-index: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Idea grid / text screens: keep comfortable inset */
#monitor-content > .grid {
  padding: 12px;
  box-sizing: border-box;
}

#monitor-content > div:not(.grid) {
  padding: 12px;
  box-sizing: border-box;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

/*
 * Prototyp: volle Fläche, kein Scroll auf dem Shell-Wrapper.
 * Wichtig: Spezifität > #monitor-content > div:not(.grid) (overflow: auto),
 * sonst gewinnt „auto“ und erzeugt Scrollbalken am Monitor-Inhalt.
 */
#monitor-content > div.prototype-iframe-zoom:not(.grid) {
  padding: 0 !important;
  overflow: hidden !important;
}

/* In-monitor dialogs (confirmations) — only dims #monitor-shell */
.monitor-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.42);
  border-radius: inherit;
}

.monitor-modal-overlay.hidden {
  display: none !important;
}

/* “Cursor composer” vibe — build prompt before iframe */
#build-prompt-layer {
  z-index: 55;
  padding: 12px;
  background: transparent;
}

#build-prompt-layer .cursor-build-scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 9, 14, 0.58);
  backdrop-filter: blur(8px);
  pointer-events: none;
}

#build-prompt-layer.build-prompt-leaving .cursor-build-scrim {
  opacity: 0;
  transition: opacity 0.4s ease;
}

#build-prompt-layer.build-prompt-leaving .cursor-build-sheet {
  opacity: 0;
  transform: translateY(-8px) scale(0.98);
  transition:
    opacity 0.42s ease,
    transform 0.48s cubic-bezier(0.22, 1, 0.36, 1);
}

.cursor-build-sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: min(468px, 86%);
  filter: drop-shadow(0 20px 50px rgba(0, 0, 0, 0.55));
}

.cursor-build-window {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: min(448px, 82vh);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, #1f1f24 0%, #121217 52%, #0d0e12 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(0, 0, 0, 0.45);
  color: #e8e8ec;
  font-family:
    ui-sans-serif,
    system-ui,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-size: 13px;
  line-height: 1.48;
}

.cursor-build-window.mono,
.cursor-build-window .mono {
  font-family:
    ui-monospace,
    "Cascadia Code",
    "Consolas",
    "SF Mono",
    monospace;
}

.cursor-build-top {
  padding: 10px 14px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  flex-shrink: 0;
}

.cursor-build-traffic {
  display: flex;
  gap: 7px;
  margin-bottom: 8px;
  opacity: 0.92;
}

.cursor-build-traffic span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.cursor-build-traffic span:nth-child(1) {
  background: #ff5f57;
}

.cursor-build-traffic span:nth-child(2) {
  background: #febc2e;
}

.cursor-build-traffic span:nth-child(3) {
  background: #28c840;
}

.cursor-build-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cursor-build-title {
  font-weight: 600;
  letter-spacing: 0.03em;
  font-size: 14px;
  color: #f6f6f8;
}

.cursor-build-badge {
  font-size: 11px;
  font-weight: 500;
  color: rgba(200, 200, 220, 0.78);
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(99, 120, 255, 0.12);
  border: 1px solid rgba(99, 140, 255, 0.22);
}

.cursor-build-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.cursor-build-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 206, 120, 0.12);
  border: 1px solid rgba(215, 181, 122, 0.35);
  color: #efd9a9;
}

.cursor-build-scope {
  font-size: 11px;
  color: rgba(160, 160, 180, 0.85);
  word-break: break-all;
}

.cursor-build-main {
  flex: 1;
  min-height: 140px;
  overflow: hidden;
  padding: 12px 14px;
  background: radial-gradient(
    ellipse 120% 70% at 50% -20%,
    rgba(82, 120, 255, 0.08),
    transparent 55%
  );
}

.cursor-build-msg {
  min-height: 120px;
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #dce0ea;
}

.cursor-build-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 1px;
  vertical-align: text-bottom;
  background: rgba(147, 197, 255, 0.95);
  animation: cursor-build-caret-blink 0.95s ease-in-out infinite;
}

.cursor-build-caret--off {
  animation: none;
  opacity: 0;
}

@keyframes cursor-build-caret-blink {
  0%,
  46% {
    opacity: 1;
  }

  50%,
  100% {
    opacity: 0.12;
  }
}

.cursor-build-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.cursor-build-hint {
  font-size: 11px;
  color: rgba(148, 150, 172, 0.88);
}

.cursor-build-send {
  position: relative;
  appearance: none;
  border: 1px solid rgba(147, 197, 255, 0.35);
  border-radius: 8px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  color: #eaf2ff;
  cursor: pointer;
  background: linear-gradient(180deg, #3f4c6f 0%, #2e3754 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 8px 20px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  transition:
    transform 0.14s ease,
    border-color 0.16s ease,
    filter 0.16s ease;
}

.cursor-build-send:disabled {
  opacity: 0.45;
  cursor: default;
}

.cursor-build-send--hot:not(:disabled) {
  filter: brightness(1.08);
  border-color: rgba(173, 210, 255, 0.55);
}

.cursor-build-send--fire {
  animation: cursor-build-send-pulse 0.45s ease;
}

@keyframes cursor-build-send-pulse {
  0% {
    transform: scale(1);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 8px 20px rgba(0, 0, 0, 0.35);
  }

  40% {
    transform: scale(1.03);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      0 0 0 4px rgba(99, 160, 255, 0.25),
      0 14px 32px rgba(40, 80, 220, 0.35);
  }

  100% {
    transform: scale(1);
  }
}

.cursor-build-send-glow {
  display: none;
}

.cursor-build-send-label {
  position: relative;
  z-index: 1;
}

.cursor-build-window.is-sending .cursor-build-send {
  background: linear-gradient(180deg, #4a5878 0%, #343d5a 100%);
}

.cursor-build-status {
  margin: 0;
  padding: 0 14px 14px;
  font-size: 11px;
  color: rgba(140, 200, 255, 0.85);
  min-height: 1.3em;
  letter-spacing: 0.02em;
}

.cursor-build-window.is-sending .cursor-build-status {
  animation: cursor-build-status-flicker 1.8s linear infinite;
}

@keyframes cursor-build-status-flicker {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

/* Windows XP–style dialog */
.xp-window {
  font-family: Tahoma, "MS Sans Serif", "Segoe UI", sans-serif;
  font-size: 13px;
  color: #000;
  min-width: 260px;
  max-width: min(420px, 94%);
  background: #ece9d8;
  border: 1px solid #003c74;
  border-radius: 0;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #aca899,
    4px 4px 12px rgba(0, 0, 0, 0.35);
}

.xp-titlebar {
  display: flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  background: linear-gradient(180deg, #0c59b9 0%, #2c72c9 8%, #1660be 92%, #0949a5 100%);
  border-bottom: 1px solid #003c74;
}

.xp-title {
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 0.02em;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.xp-body {
  padding: 14px 16px 16px;
  background: #ece9d8;
}

.xp-message {
  margin: 0 0 16px;
  line-height: 1.45;
}

.xp-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.xp-btn {
  font-family: Tahoma, "MS Sans Serif", sans-serif;
  font-size: 11px;
  min-width: 76px;
  height: 23px;
  padding: 0 12px;
  cursor: pointer;
  color: #000;
  background: linear-gradient(180deg, #fff 0%, #ece9d8 45%, #ece9d8 100%);
  border: 1px solid #003c74;
  border-radius: 3px;
  box-shadow:
    inset 1px 1px 0 #fff,
    inset -1px -1px 0 #aca899;
}

.xp-btn:hover {
  filter: brightness(1.03);
}

.xp-btn:active {
  padding-top: 1px;
  box-shadow:
    inset 1px 1px 1px rgba(0, 0, 0, 0.15),
    inset -1px -1px 0 #fff;
}

#monitor-skip {
  justify-self: end;
  grid-column: 2;
  min-width: 162px;
  padding: 8px 12px;
  font-size: 0.8rem;
  border-radius: 8px;
  border-color: #5b5f77;
  background: linear-gradient(180deg, #40445a 0%, #2a2e40 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 2px 6px rgba(0, 0, 0, 0.3);
}

#monitor-skip:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

#calendar-bar {
  display: grid;
  grid-template-columns: repeat(14, 1fr);
  gap: 8px;
  align-items: end;
  width: min(900px, 72vw);
  margin: 0 auto;
  margin-top: -74px;
  position: relative;
  z-index: 4;
}

@media (min-width: 1600px) {
  #monitor-shell {
    width: 960px;
  }

  #calendar-bar {
    width: 960px;
  }
}

.day-cell {
  min-height: 84px;
  border-radius: 8px 8px 12px 12px;
  background:
    linear-gradient(180deg, #f2f0e8 0%, #d7d2c6 100%);
  border: 1px solid #b6af9f;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 3px;
  color: #2e2a21;
  box-shadow: 0 10px 16px rgba(0, 0, 0, 0.28);
  transform-origin: top center;
  position: relative;
  transition: transform 180ms ease, filter 200ms ease, opacity 200ms ease;
  overflow: hidden;
}

.tear-binding {
  width: 100%;
  height: 11px;
  border-bottom: 1px dashed rgba(60, 53, 40, 0.45);
  background:
    radial-gradient(circle at 12% 50%, rgba(90, 80, 62, 0.45) 1.6px, transparent 2px),
    radial-gradient(circle at 50% 50%, rgba(90, 80, 62, 0.45) 1.6px, transparent 2px),
    radial-gradient(circle at 88% 50%, rgba(90, 80, 62, 0.45) 1.6px, transparent 2px);
}

.tear-day-label {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 1px;
  color: #5f5747;
}

.tear-day-number {
  font-size: 24px;
  line-height: 1;
  font-weight: 650;
  position: relative;
}

.day-cell::before,
.day-cell::after {
  content: "";
  position: absolute;
  left: -14%;
  top: 50%;
  width: 128%;
  height: 7px;
  background: rgba(120, 12, 12, 0.95);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(120, 12, 12, 0.25);
  opacity: 0;
  transform-origin: 50% 50%;
  z-index: 3;
}

.day-cell::before {
  transform: translateY(-50%) scaleX(0) rotate(31deg);
}

.day-cell::after {
  transform: translateY(-50%) scaleX(0) rotate(-31deg);
}

/* Heutiges Blatt: helleres Papier; Tag wie überall — nur „mit Edding“ eingekreist */
.day-cell.current {
  filter: saturate(1.06);
  transform: translateY(-2px);
  border-color: #c9a86a;
  background:
    linear-gradient(180deg, #faf8f2 0%, #eee9df 48%, #e2dbd0 100%);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.34),
    0 0 0 1px rgba(201, 168, 106, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.day-cell.current .tear-day-label {
  color: #6b6354;
  letter-spacing: 0.12em;
}

.day-cell.current .tear-day-number {
  position: relative;
  display: inline-block;
  z-index: 1;
  margin-top: 6px;
  /* gleiche Typo wie .tear-day-number — keine Sonderfont */
}

.day-cell.current .tear-day-number::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(100% + 16px);
  height: calc(100% + 12px);
  min-width: 2.35rem;
  min-height: 2rem;
  /* Kreis etwas nach unten zur Zahl verschoben, weniger Überstand nach oben */
  transform: translate(-50%, -42%) rotate(-2.8deg);
  border: 2.5px solid rgba(183, 42, 38, 0.88);
  border-radius: 46% 54% 52% 48% / 51% 47% 49% 51%;
  pointer-events: none;
  z-index: -1;
  box-shadow:
    0 0 0 0.5px rgba(120, 28, 24, 0.12),
    1px 2px 0 rgba(183, 42, 38, 0.08);
}

.day-cell.past {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(64px) rotate(-5deg) scale(0.95);
}

.day-cell.marking::before {
  opacity: 1;
  animation: crossOutA 720ms ease forwards;
}

.day-cell.marking::after {
  opacity: 1;
  animation: crossOutB 720ms ease 160ms forwards;
}

.day-cell.falling {
  animation: tearFall 900ms cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

@keyframes crossOutA {
  0% { transform: translateY(-50%) scaleX(0) rotate(28deg); opacity: 0; }
  100% { transform: translateY(-50%) scaleX(1) rotate(28deg); opacity: 1; }
}

@keyframes crossOutB {
  0% { transform: translateY(-50%) scaleX(0) rotate(-28deg); opacity: 0; }
  100% { transform: translateY(-50%) scaleX(1) rotate(-28deg); opacity: 1; }
}

@keyframes tearFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  20% { transform: translateY(-6px) rotate(1deg); opacity: 1; }
  100% { transform: translateY(56px) rotate(-7deg); opacity: 0; }
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.idea-grid {
  gap: 22px;
}

@keyframes idea-card-enter {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.idea-grid .idea-card {
  animation: idea-card-enter 0.42s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.idea-grid .idea-card:nth-child(1) {
  animation-delay: 0.02s;
}

.idea-grid .idea-card:nth-child(2) {
  animation-delay: 0.07s;
}

.idea-grid .idea-card:nth-child(3) {
  animation-delay: 0.12s;
}

.idea-grid .idea-card:nth-child(4) {
  animation-delay: 0.17s;
}

.idea-grid .idea-card:nth-child(5) {
  animation-delay: 0.22s;
}

.idea-grid .idea-card:nth-child(6) {
  animation-delay: 0.27s;
}

@media (prefers-reduced-motion: reduce) {
  .idea-grid .idea-card {
    animation: none;
  }
}

.idea-card {
  --card-glow: rgba(215, 181, 122, 0.14);
  position: relative;
  border: 1px solid rgba(55, 55, 72, 0.95);
  border-radius: 16px;
  padding: 20px 18px 18px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, transparent 42%),
    linear-gradient(180deg, rgba(28, 28, 38, 0.98) 0%, rgba(16, 16, 22, 0.99) 100%);
  display: grid;
  gap: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    inset 0 -1px 0 rgba(0, 0, 0, 0.35),
    0 8px 28px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.35);
  isolation: isolate;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.22s ease;
}

.idea-card::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(
    90deg,
    transparent,
    hsla(var(--idea-card-hue, 42), 42%, 58%, 0.35) 20%,
    rgba(215, 181, 122, 0.75) 50%,
    hsla(var(--idea-card-hue, 42), 42%, 58%, 0.35) 80%,
    transparent
  );
  opacity: 0.95;
  pointer-events: none;
  z-index: 1;
}

.idea-card__shine {
  position: absolute;
  inset: -40% -20% 55% -20%;
  background: linear-gradient(
    125deg,
    transparent 35%,
    rgba(255, 255, 255, 0.06) 48%,
    transparent 62%
  );
  pointer-events: none;
  z-index: 0;
}

.idea-card:hover {
  transform: translateY(-3px);
  border-color: rgba(215, 181, 122, 0.35);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 14px 36px rgba(0, 0, 0, 0.5),
    0 0 32px var(--card-glow),
    0 0 0 1px rgba(215, 181, 122, 0.12);
}

.idea-card:active {
  transform: translateY(-1px);
}

.idea-card__top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 0;
}

.idea-card__index {
  flex-shrink: 0;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.52rem;
  line-height: 1.5;
  color: rgba(215, 181, 122, 0.55);
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(215, 181, 122, 0.2);
  letter-spacing: 0.04em;
}

.idea-card__title,
.idea-card h3 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: 0.62rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.06em;
  color: #f2eef8;
  text-shadow:
    0 0 12px rgba(215, 181, 122, 0.22),
    1px 1px 0 rgba(0, 0, 0, 0.5);
  text-transform: uppercase;
}

.idea-card__blurb,
.idea-card p {
  margin: 0;
  position: relative;
  z-index: 2;
  font-size: 0.86rem;
  line-height: 1.58;
  color: rgba(212, 212, 224, 0.92);
}

.idea-card__chips {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.idea-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 8, 12, 0.55);
  color: var(--muted);
}

.idea-chip--genre {
  border-color: hsla(var(--idea-card-hue, 42), 35%, 50%, 0.28);
  background: linear-gradient(180deg, hsla(var(--idea-card-hue, 42), 22%, 22%, 0.5), rgba(10, 10, 14, 0.75));
  color: rgba(200, 200, 215, 0.95);
}

.idea-chip--cost {
  border-color: rgba(215, 181, 122, 0.25);
  color: rgba(215, 201, 168, 0.95);
  background: rgba(215, 181, 122, 0.07);
}

.idea-chip__icon {
  font-size: 12px;
  opacity: 0.85;
}

.idea-card .idea-card__cta,
.idea-card .btn.primary {
  position: relative;
  z-index: 2;
  margin-top: 4px;
  width: 100%;
  justify-self: stretch;
  border-width: 2px;
  border-color: rgba(173, 146, 100, 0.85);
  border-radius: 10px;
  padding: 12px 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  background: linear-gradient(180deg, #e8cf98 0%, #c9a75a 48%, #a88442 100%);
  color: #1a1410;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 3px 0 rgba(70, 56, 30, 0.65),
    0 6px 16px rgba(215, 181, 122, 0.2);
  transition:
    filter 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease;
}

.idea-card .idea-card__cta:hover,
.idea-card .btn.primary:hover {
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    0 4px 0 rgba(70, 56, 30, 0.55),
    0 10px 24px rgba(215, 181, 122, 0.28);
}

.idea-card .idea-card__cta:active,
.idea-card .btn.primary:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    0 1px 0 rgba(70, 56, 30, 0.5);
}

.idea-meta {
  color: var(--muted);
  font-size: 13px;
}

.btn {
  border: 1px solid #343444;
  background: #242432;
  color: var(--text);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn.primary {
  background: var(--accent);
  color: #1a1710;
  border-color: #ad9264;
  font-weight: 600;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 7, 0.86);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 40;
}

#start-overlay {
  background: radial-gradient(ellipse 120% 80% at 50% 35%, #12121a 0%, #050508 55%, #020203 100%);
  z-index: 70;
}

.start-screen-stage {
  width: min(560px, 94vw);
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
}

.start-screen-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 4vh, 36px);
  width: 100%;
}

#start-logo {
  width: min(420px, 78%);
  height: auto;
  max-height: min(28vh, 220px);
  object-fit: contain;
  filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.55));
}

.start-cta-pixel {
  margin: 0;
  padding: 0;
  cursor: pointer;
  border: 3px solid rgba(215, 181, 122, 0.75);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(52, 48, 68, 0.98) 0%, rgba(24, 22, 34, 0.99) 48%, rgba(14, 13, 20, 1) 100%);
  color: #f8f5ff;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(0.62rem, 2.6vw, 0.78rem);
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
  text-shadow:
    0 0 14px rgba(215, 181, 122, 0.45),
    2px 2px 0 rgba(0, 0, 0, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -2px 6px rgba(0, 0, 0, 0.35),
    0 4px 0 rgba(0, 0, 0, 0.55),
    0 0 24px rgba(215, 181, 122, 0.22);
  min-width: min(260px, 88vw);
  padding: 18px 28px 16px;
  transition:
    border-color 0.14s ease,
    color 0.14s ease,
    box-shadow 0.14s ease,
    transform 0.12s ease,
    filter 0.14s ease;
}

.start-cta-pixel:hover {
  border-color: rgba(232, 212, 168, 0.95);
  color: #fffef8;
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -2px 6px rgba(0, 0, 0, 0.35),
    0 4px 0 rgba(0, 0, 0, 0.45),
    0 0 28px rgba(215, 181, 122, 0.42);
}

.start-cta-pixel:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 2px 8px rgba(0, 0, 0, 0.45),
    0 1px 0 rgba(0, 0, 0, 0.5);
}

.noot-branding {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-decoration: none;
  color: inherit;
  transition: opacity 0.2s ease;
}

.noot-branding:hover .noot-branding__label {
  color: #a8a8b8;
}

.noot-branding:hover .noot-branding__wordmark {
  color: rgba(255, 255, 255, 0.95);
}

.noot-branding:hover .noot-branding__icon {
  transform: scale(1.08);
}

.noot-branding__label {
  font-family: "Sora", sans-serif;
  font-weight: 700;
  font-size: 7.5px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #6b6b7a;
  line-height: 1;
  transition: color 0.2s ease;
}

@media (min-width: 768px) {
  .noot-branding__label {
    font-size: 8.5px;
  }
}

.noot-branding__row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.noot-branding__icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

@media (min-width: 768px) {
  .noot-branding__icon {
    width: 20px;
    height: 20px;
  }
}

.noot-branding__wordmark {
  font-family: "Sora", sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: -0.02em;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  transition: color 0.2s ease;
}

@media (min-width: 768px) {
  .noot-branding__wordmark {
    font-size: 13px;
  }
}

.noot-branding__ot {
  opacity: 0.4;
}

.noot-branding__code {
  margin-left: 1px;
}

#intro-video {
  width: 100%;
  aspect-ratio: 2 / 1;
  height: auto;
  max-height: min(871px, 90vh);
  display: block;
  border-radius: 12px;
  object-fit: contain;
  background: #000;
}

#intro-overlay {
  background: rgba(0, 0, 0, 1);
  z-index: 60;
  opacity: 1;
  transition: opacity 2200ms ease, background-color 1800ms ease;
}

#intro-overlay.is-fading {
  opacity: 0;
  background: rgba(0, 0, 0, 0);
}

#intro-overlay.is-fading #intro-video {
  opacity: 0;
  transition: opacity 2200ms ease;
}

.intro-media {
  position: relative;
  width: min(1536px, 96vw);
}

#intro-skip {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  background: rgba(10, 10, 14, 0.72);
  border-color: rgba(230, 230, 240, 0.32);
  backdrop-filter: blur(4px);
}

.modal-card {
  width: min(680px, 96vw);
  background: linear-gradient(170deg, rgba(255, 255, 255, 0.02), transparent 52%), var(--panel);
  border: 1px solid var(--panel-edge);
  border-radius: 16px;
  padding: 18px;
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.45);
}

/*
 * Laptop-Viewport: iframe hat feste logische Größe (siehe prototypePlayer.js).
 * Contain-Skalierung (--laptop-fit-scale): gesamter Viewport sichtbar; Leerraum an den Seiten oder oben/unten möglich.
 */
.prototype-iframe-zoom {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-self: stretch;
  position: relative;
  overflow: hidden;
  background: #08080b;
  --laptop-fit-scale: 1;
}

.prototype-iframe-inner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(var(--laptop-fit-scale));
  transform-origin: center center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.prototype-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: #08080b;
  box-shadow: none;
  overflow: hidden;
  overscroll-behavior: none;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #1e1930;
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}

.vote-row {
  display: grid;
  grid-template-columns: 160px 1fr 56px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.vote-bar {
  height: 12px;
  border-radius: 999px;
  background: #1b1b24;
  overflow: hidden;
}

.vote-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7f9f88 0%, #b8d8be 100%);
}

#ending-overlay,
#result-overlay {
  padding: 0;
  z-index: 45;
}

#result-overlay {
  /* Volle Fläche deckend — nichts vom Spiel darunter durchscheinen */
  background:
    radial-gradient(ellipse 120% 70% at 50% 0%, rgba(215, 181, 122, 0.14), transparent 52%),
    radial-gradient(ellipse 85% 55% at 85% 95%, rgba(90, 80, 140, 0.14), transparent 48%),
    radial-gradient(ellipse 55% 45% at 8% 85%, rgba(215, 181, 122, 0.07), transparent 42%),
    linear-gradient(180deg, #0c0c14 0%, #060608 38%, #030304 100%);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Shared outro + results backdrop */
.cinematic-fullscreen {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: clamp(20px, 4vw, 44px);
  box-sizing: border-box;
  background:
    radial-gradient(700px 300px at 50% 60%, rgba(210, 170, 115, 0.06), transparent 70%),
    #050507;
}

.result-screen.cinematic-fullscreen {
  padding: clamp(10px, 2.2vw, 22px);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  box-sizing: border-box;
  align-content: center;
  /* Leichte Variation zum Overlay-Grundton; bleibt deckend */
  background:
    radial-gradient(ellipse 120% 70% at 50% 0%, rgba(215, 181, 122, 0.1), transparent 55%),
    radial-gradient(ellipse 80% 50% at 80% 100%, rgba(90, 80, 140, 0.1), transparent 50%),
    radial-gradient(ellipse 60% 40% at 10% 90%, rgba(215, 181, 122, 0.05), transparent 45%),
    linear-gradient(180deg, rgba(12, 12, 18, 0.97) 0%, rgba(5, 5, 8, 0.98) 45%, #030304 100%);
}

/* Prototyp-Sandbox nach Endscreen: nur Grid + Zurück */
.result-sandbox.cinematic-fullscreen {
  padding: clamp(12px, 2.5vw, 20px);
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  box-sizing: border-box;
  align-content: center;
  background:
    radial-gradient(ellipse 100% 60% at 50% 0%, rgba(215, 181, 122, 0.1), transparent 50%),
    linear-gradient(180deg, rgba(12, 12, 18, 0.97) 0%, rgba(5, 5, 8, 0.98) 55%, #030304 100%);
}

.result-sandbox-inner {
  width: min(960px, 100%);
  max-height: min(90dvh, 880px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  overflow-y: auto;
  padding: 4px 2px 8px;
  box-sizing: border-box;
}

.sandbox-grid-host .idea-grid {
  gap: 12px;
}

.sandbox-grid-host .idea-card {
  padding: 14px 14px 12px;
  gap: 12px;
}

.result-sandbox-back {
  flex-shrink: 0;
  align-self: center;
  min-width: min(280px, 100%);
  margin-top: 4px;
}

.ending-fullscreen {
  width: 100%;
}

.ending-line {
  max-width: 22ch;
  margin: 0 auto;
  font-size: clamp(1.45rem, 3.6vw, 2.75rem);
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.35;
  color: #ececf2;
  opacity: 0;
  transition: opacity 1300ms ease;
}

.ending-line.show {
  opacity: 1;
}

/* Results screen */
.result-screen-inner {
  width: min(680px, 100%);
  max-height: min(92dvh, 860px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: clamp(10px, 2vw, 18px);
  overflow-y: auto;
  padding: 2px 0 6px;
  box-sizing: border-box;
}

.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.5vw, 12px);
  position: relative;
  flex-shrink: 0;
}

.result-logo {
  width: min(280px, 58vw);
  height: auto;
  opacity: 0;
  animation: resultLogoReveal 1.05s ease 0.12s forwards;
  filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.55));
}

@keyframes resultLogoReveal {
  from {
    opacity: 0;
    transform: translateY(-14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  width: 100%;
  max-width: 34rem;
  margin: 0 auto;
}

.result-kicker {
  margin: 0 0 4px;
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(215, 181, 122, 0.82);
}

.result-title {
  margin: 0;
  font-family: "Press Start 2P", "Courier New", monospace;
  font-size: clamp(0.48rem, 2.1vw, 0.65rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 1.55;
  text-transform: uppercase;
  color: #f8f5ff;
  text-shadow:
    0 0 20px rgba(215, 181, 122, 0.35),
    2px 2px 0 rgba(0, 0, 0, 0.45);
}

.result-hero-glow {
  width: min(240px, 60%);
  height: 2px;
  margin-top: 2px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(215, 181, 122, 0.45) 35%,
    rgba(232, 212, 168, 0.85) 50%,
    rgba(215, 181, 122, 0.45) 65%,
    transparent
  );
  box-shadow: 0 0 16px rgba(215, 181, 122, 0.3);
}

.result-panel {
  width: 100%;
  text-align: left;
  padding: clamp(12px, 2vw, 16px) clamp(12px, 2vw, 18px);
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.05) 0%, transparent 42%),
    linear-gradient(180deg, rgba(22, 22, 32, 0.92) 0%, rgba(12, 12, 18, 0.94) 100%);
  border: 1px solid rgba(215, 181, 122, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  animation: resultPanelIn 0.55s ease 0.25s forwards;
  flex: 1 1 auto;
  min-height: 0;
}

@keyframes resultPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.result-panel-accent {
  width: 3px;
  height: 1rem;
  border-radius: 2px;
  background: linear-gradient(180deg, #e8d4a8, #b89458);
  box-shadow: 0 0 12px rgba(215, 181, 122, 0.45);
  flex-shrink: 0;
}

.result-section-title {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(210, 210, 228, 0.88);
}

.result-vote-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-vote-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(6, 6, 10, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.result-vote-row:hover {
  border-color: rgba(215, 181, 122, 0.12);
  background: rgba(12, 12, 20, 0.65);
}

.result-vote-label {
  font-size: 0.78rem;
  color: #e4e0f5;
  line-height: 1.3;
}

.result-you {
  color: #d7b57a;
  font-weight: 600;
}

.result-vote-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.result-vote-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #5a7a62 0%, #9bc4a4 55%, #c8e4d0 100%);
  border-radius: inherit;
  box-shadow: 0 0 12px rgba(146, 200, 160, 0.25);
}

.result-vote-pct {
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: rgba(200, 200, 220, 0.92);
  min-width: 2.5rem;
  text-align: right;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 0;
  flex-shrink: 0;
}

@media (min-width: 560px) {
  .result-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

.result-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid rgba(215, 181, 122, 0.38);
  background: linear-gradient(180deg, rgba(38, 36, 50, 0.98) 0%, rgba(18, 17, 26, 0.99) 100%);
  color: #f0ecf8;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 4px 0 rgba(0, 0, 0, 0.35),
    0 8px 24px rgba(0, 0, 0, 0.35);
  transition:
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.12s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
}

.result-btn__glyph {
  flex-shrink: 0;
  opacity: 0.92;
}

.result-btn__text {
  white-space: nowrap;
}

.result-btn--secondary:hover {
  border-color: rgba(232, 212, 168, 0.55);
  color: #fff;
  filter: brightness(1.06);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 5px 0 rgba(0, 0, 0, 0.28),
    0 0 20px rgba(215, 181, 122, 0.15);
}

.result-btn--secondary:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.result-btn--share {
  border-color: rgba(173, 146, 100, 0.88);
  background: linear-gradient(180deg, #e8cf98 0%, #c9a75a 48%, #a88442 100%);
  color: #1a1410;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    inset 0 -1px 0 rgba(0, 0, 0, 0.12),
    0 4px 0 rgba(70, 56, 30, 0.55),
    0 12px 28px rgba(215, 181, 122, 0.22);
}

.result-btn--share .result-btn__glyph {
  opacity: 1;
  color: #1a1410;
}

.result-btn--share:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  border-color: rgba(140, 115, 75, 0.95);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 5px 0 rgba(70, 56, 30, 0.45),
    0 14px 32px rgba(215, 181, 122, 0.32);
}

.result-btn--share:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.15),
    0 2px 0 rgba(70, 56, 30, 0.5);
}

.result-btn:focus-visible {
  outline: 2px solid rgba(215, 181, 122, 0.65);
  outline-offset: 3px;
}

@media (max-width: 559px) {
  .result-vote-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .result-vote-pct {
    text-align: left;
  }
}

@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #monitor-shell {
    height: 480px;
    min-height: 480px;
  }

  #calendar-bar {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .vote-row {
    grid-template-columns: 1fr;
  }
}
