/* Design „Handheld“ – frühe Taschenkonsole mit 4-Ton-Grün-Display.
   Schrift: Silkscreen aus /themes/fonts.css (SIL OFL 1.1).
   Änderungen gegenüber der Vorlage sind mit "Anpassung" markiert. */

[data-theme="handheld"] {
  /* Gehäuse (Hintergrund) + 4 LCD-Grüntöne:
     #9bbc0f (Hellstes Gelbgrün)
     #8bac0f (Mittelhelles Olivgrün)
     #306230 (Dunkles Waldgrün)
     #0f380f (Tiefstes Schwarz-Oliv) */
  --bg: #c6c3b8;
  --surface: #9bbc0f;
  --surface-2: #8bac0f;
  --line: #0f380f;
  --text: #0f380f;
  --muted: #214a21;
  --accent: #0f380f;
  --accent-ink: #9bbc0f;
  --like: #0f380f;
  --nope: #306230;
  --sale: #0f380f;
  --sale-ink: #9bbc0f;
  --radius: 2px;
  --radius-lg: 4px;
  --card-shadow: 4px 4px 0 #0f380f;
  --border-w: 3px;
  --font: ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, monospace;
  --font-head: 'Silkscreen', 'Courier New', monospace;
  --head-transform: uppercase;
  --head-spacing: 0.04em;
  --head-weight: 700;
  --mono: ui-monospace, 'Cascadia Code', Menlo, Consolas, monospace;
  color-scheme: light;

  background-color: var(--bg);
  background-image: repeating-linear-gradient(
    45deg,
    rgba(15, 56, 15, 0.03) 0px,
    rgba(15, 56, 15, 0.03) 2px,
    transparent 2px,
    transparent 6px
  );
  color: var(--text);
  font-family: var(--font);
}

/* Anpassung: body durchsichtig, sonst verdeckt er das Gehäusemuster */
[data-theme="handheld"] body {
  background: transparent;
}

/* Deutlicher Tastatur-Fokus */
[data-theme="handheld"] :focus-visible {
  outline: 3px dashed #0f380f;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #9bbc0f;
}

/* Topbar & Gehäuse-Kopf */
[data-theme="handheld"] .topbar {
  background: #b5b1a4;
  border-bottom: 4px solid #0f380f;
  box-shadow: 0 3px 0 #8a8679;
}

[data-theme="handheld"] .brand {
  font-family: var(--font-head);
  text-transform: uppercase;
  color: #0f380f;
  letter-spacing: 0.05em;
}

[data-theme="handheld"] .brand b {
  background: #0f380f;
  color: #9bbc0f;
  padding: 1px 5px;
  border-radius: 2px;
}

[data-theme="handheld"] .me .avatar {
  border: 3px solid #0f380f;
  border-radius: 2px;
  box-shadow: 2px 2px 0 #306230;
}

/* Navigation & Modul-Zähler */
[data-theme="handheld"] .nav button {
  font-family: var(--font-head);
  font-size: 0.74rem;
  text-transform: uppercase;
  color: #0f380f;
  background: #9bbc0f;
  border: 2px solid #0f380f;
  border-radius: 2px;
  box-shadow: 2px 2px 0 #0f380f;
  transition: transform 0.06s steps(2), box-shadow 0.06s steps(2);
}

[data-theme="handheld"] .nav button:hover {
  background: #8bac0f;
}

[data-theme="handheld"] .nav button[aria-current="page"] {
  background: #0f380f;
  color: #9bbc0f;
  transform: translate(2px, 2px);
  box-shadow: none;
}

[data-theme="handheld"] .nav .count {
  font-family: var(--font-head);
  font-size: 0.66rem;
  background: #8bac0f;
  color: #0f380f;
  border: 2px solid #0f380f;
  border-radius: 2px;
  padding: 0 5px;
}

[data-theme="handheld"] .nav button[aria-current="page"] .count {
  background: #9bbc0f;
  color: #0f380f;
  border-color: #9bbc0f;
}

/* LCD-Display-Flächen mit feinem Punktmatrix-Raster */
[data-theme="handheld"] .card,
[data-theme="handheld"] .panel,
[data-theme="handheld"] .tile,
[data-theme="handheld"] .stat,
[data-theme="handheld"] .pick,
[data-theme="handheld"] .sheet,
[data-theme="handheld"] .row {
  background-color: var(--surface);
  background-image:
    linear-gradient(to right, rgba(15, 56, 15, 0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(15, 56, 15, 0.08) 1px, transparent 1px);
  background-size: 3px 3px;
  border: var(--border-w) solid #0f380f;
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  color: var(--text);
}

/* Anpassung: Kopf des Blattes in Displayfarbe (sonst grauer Streifen über grünem Inhalt) */
[data-theme="handheld"] .sheet-head {
  background: #8bac0f;
  border-bottom: 3px solid #0f380f;
}

[data-theme="handheld"] .card {
  border-width: 4px;
  box-shadow:
    inset 0 0 0 3px #8bac0f,
    6px 6px 0 #0f380f;
}

[data-theme="handheld"] .card.behind {
  background-color: #8bac0f;
  box-shadow: 4px 4px 0 #306230;
}

[data-theme="handheld"] .card.behind2 {
  background-color: #8bac0f;
  border-style: dashed;
  box-shadow: none;
}

[data-theme="handheld"] .card.dragging {
  box-shadow: 10px 10px 0 #0f380f;
}

/* Spielbild: Originalfarben, eingerahmt wie ein dicker Display-Ausschnitt */
[data-theme="handheld"] .card .shot {
  border: 6px solid #306230;
  outline: 3px solid #0f380f;
  margin: 6px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 2px #0f380f;
}

[data-theme="handheld"] .more-pics,
[data-theme="handheld"] .trailer-pill {
  font-family: var(--font-head);
  font-size: 0.66rem;
  text-transform: uppercase;
  background: #0f380f;
  color: #9bbc0f;
  border: 2px solid #9bbc0f;
  border-radius: 2px;
  box-shadow: 2px 2px 0 #0f380f;
}

[data-theme="handheld"] .card .title {
  font-family: var(--font-head);
  text-transform: var(--head-transform);
  letter-spacing: var(--head-spacing);
  font-weight: var(--head-weight);
  color: #0f380f;
  /* Anpassung: Pixel-Schrift läuft breit */
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

[data-theme="handheld"] .card .meta {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.84rem;
}

[data-theme="handheld"] .desc {
  color: #0f380f;
  line-height: 1.5;
  opacity: 1;
}

/* Bewertungen: Unterschieden durch Tonwert + Rahmenstil
   Anpassung: Innenabstand */
[data-theme="handheld"] .review.good,
[data-theme="handheld"] .review.mid,
[data-theme="handheld"] .review.bad {
  padding: 1px 6px;
  border-radius: 2px;
}

[data-theme="handheld"] .review.good {
  background: #0f380f;
  color: #9bbc0f;
  border: 2px solid #0f380f;
  font-weight: 700;
}

[data-theme="handheld"] .review.mid {
  background: #8bac0f;
  color: #0f380f;
  border: 2px solid #0f380f;
  font-weight: 700;
}

[data-theme="handheld"] .review.bad {
  background: #9bbc0f;
  color: #0f380f;
  border: 2px dashed #0f380f;
  font-weight: 700;
}

[data-theme="handheld"] .players .pl {
  background: #8bac0f;
  color: #0f380f;
  border: 2px solid #0f380f;
  border-radius: 2px;
}

[data-theme="handheld"] .players .pl.hot {
  background: #0f380f;
  color: #9bbc0f;
}

[data-theme="handheld"] .tags .tag {
  background: #9bbc0f;
  color: #0f380f;
  border: 2px solid #306230;
  border-radius: 2px;
  font-size: 0.78rem;
  /* Anpassung */
  padding: 1px 6px;
}

/* Anpassung: keine Trennpunkte, die Kästchen trennen schon */
[data-theme="handheld"] .tag + .tag::before {
  content: none;
}

/* Preisleiste & Rabatt
   Anpassung: Fläche bis an den Kartenrand */
[data-theme="handheld"] .pricebar {
  background: #8bac0f;
  border-top: 3px solid #0f380f;
  margin: auto -16px -12px;
  padding: 10px 16px 12px;
}

[data-theme="handheld"] .price .now {
  font-family: var(--font-head);
  color: #0f380f;
}

[data-theme="handheld"] .price .was {
  color: var(--muted);
}

[data-theme="handheld"] .sale {
  font-family: var(--font-head);
  font-size: 0.7rem;
  background: #0f380f;
  color: #9bbc0f;
  border: 2px solid #0f380f;
  border-radius: 2px;
}

[data-theme="handheld"] .deals,
[data-theme="handheld"] .owned-badge,
[data-theme="handheld"] .pick-kicker {
  font-family: var(--font-head);
  font-size: 0.66rem;
  text-transform: uppercase;
  background: #9bbc0f;
  color: #0f380f;
  border: 2px solid #0f380f;
  border-radius: 2px;
  /* Anpassung */
  padding: 3px 7px;
  align-self: flex-start;
}

/* Stempel: LIKE vs. NÖ über Helligkeit UND Rahmenform getrennt */
[data-theme="handheld"] .stamp.like,
[data-theme="handheld"] .stamp.nope {
  font-family: var(--font-head);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 2px;
}

[data-theme="handheld"] .stamp.like {
  background: #0f380f;
  color: #9bbc0f;
  border: 4px solid #9bbc0f;
  outline: 3px solid #0f380f;
  box-shadow: 4px 4px 0 #0f380f;
}

[data-theme="handheld"] .stamp.nope {
  background: #9bbc0f;
  color: #0f380f;
  border: 4px dashed #0f380f;
  box-shadow: 4px 4px 0 #306230;
}

/* Aktionsknöpfe: Runde A/B-Tasten auf dem Gehäuse */
[data-theme="handheld"] .actions .act {
  border-radius: 50%;
  border: 3px solid #0f380f;
  font-family: var(--font-head);
  box-shadow: 3px 4px 0 #0f380f;
  transition: transform 0.05s steps(2), box-shadow 0.05s steps(2);
}

/* Anpassung: auch die Rückmeldung nach Tastendruck (.hit) drückt die Taste */
[data-theme="handheld"] .actions .act:active,
[data-theme="handheld"] .actions .act.hit {
  transform: translate(3px, 4px);
  box-shadow: none;
  animation: none;
}

/* Like = dunkle, massive A-Taste mit durchgehendem Doppelrand */
[data-theme="handheld"] .actions .act.like {
  background: #0f380f;
  color: #9bbc0f;
  outline: 3px solid #9bbc0f;
  outline-offset: -6px;
}

/* Nö = hellere B-Taste mit gestricheltem Innenring */
[data-theme="handheld"] .actions .act.nope {
  background: #8bac0f;
  color: #0f380f;
  border-style: dashed;
  border-width: 4px;
}

[data-theme="handheld"] .actions .act.skip {
  background: #9bbc0f;
  color: #0f380f;
}

[data-theme="handheld"] .actions .act.undo {
  background: #306230;
  color: #9bbc0f;
}

/* Anpassung: Beschriftung unter den Tasten auf dem grauen Gehäuse */
[data-theme="handheld"] .act-label {
  font-family: var(--font-head);
  font-size: 0.62rem;
  text-transform: uppercase;
  color: #0f380f;
}

/* Normale Buttons als flache Start/Select-Gummitasten */
[data-theme="handheld"] .btn {
  font-family: var(--font-head);
  font-size: 0.72rem;
  text-transform: uppercase;
  background: #8a8679;
  color: #0f380f;
  border: 3px solid #0f380f;
  border-radius: 999px;
  box-shadow: 2px 3px 0 #0f380f;
  transition: transform 0.05s steps(2), box-shadow 0.05s steps(2);
}

[data-theme="handheld"] .btn:active {
  transform: translate(2px, 3px);
  box-shadow: none;
}

[data-theme="handheld"] .btn.primary {
  background: #0f380f;
  color: #9bbc0f;
}

[data-theme="handheld"] .btn.danger {
  background: #9bbc0f;
  color: #0f380f;
  border-style: dashed;
}

[data-theme="handheld"] .btn.ghost {
  background: #9bbc0f;
  color: #0f380f;
  box-shadow: none;
}

[data-theme="handheld"] .btn.small {
  font-size: 0.64rem;
}

/* Chips & Segment-Schalter */
[data-theme="handheld"] .chip,
[data-theme="handheld"] .seg button {
  /* Anpassung: klare Kontur auch im nicht gewählten Zustand */
  border: 2px solid #0f380f;
  background: #9bbc0f;
  color: #0f380f;
  border-radius: 2px;
}

[data-theme="handheld"] .chip[aria-pressed="true"],
[data-theme="handheld"] .seg button[aria-pressed="true"] {
  background: #0f380f;
  color: #9bbc0f;
  border: 2px solid #0f380f;
  font-weight: 700;
}

/* Formulare & Listen */
[data-theme="handheld"] .flabel,
[data-theme="handheld"] .sheet-head h2 {
  font-family: var(--font-head);
  text-transform: uppercase;
  color: #0f380f;
}

[data-theme="handheld"] .flabel {
  font-size: 0.74rem;
}

[data-theme="handheld"] .input,
[data-theme="handheld"] .select {
  background: #9bbc0f;
  color: #0f380f;
  border: 3px solid #0f380f;
  border-radius: 2px;
  font-family: var(--font);
  box-shadow: inset 2px 2px 0 #8bac0f;
}

/* Anpassung: Platzhaltertext lesbar */
[data-theme="handheld"] .input::placeholder {
  color: #306230;
}

[data-theme="handheld"] .range,
[data-theme="handheld"] .check input {
  accent-color: #0f380f;
}

/* Punktmatrix-Balkenanzeige */
[data-theme="handheld"] .meter i {
  background: #8bac0f;
  border: 1px solid #306230;
  border-radius: 0;
}

[data-theme="handheld"] .meter i.on {
  background: #0f380f;
  border-color: #0f380f;
}

[data-theme="handheld"] .stat b {
  font-family: var(--font-head);
}

/* Zufalls-Roll & Medien */
[data-theme="handheld"] .big-roll {
  font-family: var(--font-head);
  text-transform: uppercase;
  background: #0f380f;
  color: #9bbc0f;
  border: 3px solid #0f380f;
  border-radius: 2px;
  box-shadow: 4px 4px 0 #306230;
}

[data-theme="handheld"] .player,
[data-theme="handheld"] .shot-btn img {
  border: 3px solid #0f380f;
  border-radius: 2px;
}

/* Anpassung: Nur der runde Abspielknopf wird grün, damit das Vorschaubild sichtbar bleibt */
[data-theme="handheld"] .play-overlay {
  background: rgba(15, 56, 15, 0.25);
}

[data-theme="handheld"] .play-overlay svg {
  background: #9bbc0f;
  color: #0f380f;
  border: 3px solid #0f380f;
  border-radius: 2px;
  box-shadow: 3px 3px 0 #0f380f;
}

[data-theme="handheld"] .lightbox {
  background: rgba(15, 56, 15, 0.92);
}

/* Anpassung: Rückmeldung über der Karte im Display-Stil */
[data-theme="handheld"] .decision {
  background: #9bbc0f;
  color: #0f380f;
  border: 3px solid #0f380f;
  border-radius: 2px;
  box-shadow: 4px 4px 0 #0f380f;
}

[data-theme="handheld"] .decision.nope {
  border-style: dashed;
}

[data-theme="handheld"] .decision small {
  color: #214a21;
}

/* Anpassung: Herzchen dunkel auf Grün */
[data-theme="handheld"] .particle {
  color: #0f380f;
}

/* Toasts & Skeleton */
[data-theme="handheld"] .toast {
  font-family: var(--font-head);
  font-size: 0.74rem;
  background: #9bbc0f;
  color: #0f380f;
  border: 3px solid #0f380f;
  border-radius: 2px;
  box-shadow: 4px 4px 0 #0f380f;
}

[data-theme="handheld"] .toast.match {
  background: #0f380f;
  color: #9bbc0f;
  border-color: #9bbc0f;
  outline: 3px solid #0f380f;
}

[data-theme="handheld"] .skeleton {
  background: repeating-linear-gradient(
    90deg,
    #8bac0f 0px,
    #8bac0f 12px,
    #9bbc0f 12px,
    #9bbc0f 24px
  );
  background-size: 48px 100%;
  animation: handheld-lcd-scroll 1.2s steps(4) infinite;
}

[data-theme="handheld"] .theme-opt[aria-pressed="true"] {
  border-color: #0f380f;
  border-style: dashed;
}

/* Breakpoints: Tablet & Handy */
@media (max-width: 900px) {
  [data-theme="handheld"] .card {
    box-shadow: 4px 4px 0 #0f380f;
  }
}

@media (max-width: 720px) {
  [data-theme="handheld"] .nav {
    background: #b5b1a4;
    border-top: 4px solid #0f380f;
    /* Anpassung: Abstand zwischen den Tasten */
    gap: 6px;
  }

  [data-theme="handheld"] .nav button {
    font-size: 0.6rem;
    border-radius: 999px;
    background: #8a8679;
  }

  [data-theme="handheld"] .nav button[aria-current="page"] {
    background: #0f380f;
    color: #9bbc0f;
  }

  [data-theme="handheld"] .card .title {
    font-size: 18px;
  }

  /* Anpassung: dünnerer Bildrahmen, damit auf kleinen Displays genug Platz bleibt */
  [data-theme="handheld"] .card .shot {
    border-width: 4px;
    margin: 4px;
  }

  /* Anpassung: Handy-Blatt nur oben abgerundet */
  [data-theme="handheld"] .sheet {
    border-bottom: 0;
  }
}

@keyframes handheld-lcd-scroll {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 48px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-theme="handheld"] .skeleton {
    animation: none;
  }

  [data-theme="handheld"] .nav button,
  [data-theme="handheld"] .actions .act,
  [data-theme="handheld"] .btn {
    transition: none;
  }
}
