/* Seherwettstreit Trainingsorakel — Séance-Atmosphäre im Metin2-UI-Stil */

:root {
  --bg: #0d0906;
  --panel: #1a120b;
  --panel-deep: #120c07;
  --board: #211309;
  --gold: #c9a14d;
  --gold-bright: #f0cd7a;
  --gold-dim: #7a623364;
  --ink: #e8dcc2;
  --ink-dim: #a08f6f;
  --good: #7fc97f;
  --bad: #e06c5a;
  --warn: #e0b85a;
  --card-w: 82px;
  --card-h: 106px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(ellipse 90% 60% at 50% -10%, #2a1a0c 0%, transparent 60%),
    radial-gradient(ellipse 70% 50% at 85% 100%, #1c1008 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  min-height: 100vh;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 120% 90% at 50% 40%,
    transparent 55%,
    rgba(0, 0, 0, 0.55) 100%
  );
  z-index: 2;
}

main,
header.site-header,
footer {
  position: relative;
  z-index: 3;
}

/* ---------- Header ---------- */
.site-header {
  text-align: center;
  padding: 2.2rem 1rem 0.6rem;
}

.site-header .ornament {
  color: var(--gold-dim);
  letter-spacing: 1.2em;
  font-size: 0.8rem;
  padding-left: 1.2em;
}

.site-header h1 {
  font-family: "Cinzel Decorative", "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 3.4rem);
  margin: 0.2rem 0 0.1rem;
  color: var(--gold-bright);
  text-shadow:
    0 0 30px rgba(201, 161, 77, 0.35),
    0 2px 0 #000;
  letter-spacing: 0.06em;
}

.subtitle {
  color: var(--ink-dim);
  font-style: italic;
  margin: 0.2rem auto 0;
  max-width: 46rem;
}

/* ---------- Arena Layout ---------- */
.arena {
  display: grid;
  grid-template-columns: auto 150px minmax(280px, 360px);
  gap: 1.2rem;
  justify-content: center;
  align-items: stretch;
  padding: 1.4rem 1rem;
}

@media (max-width: 1100px) {
  .arena {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }
}

/* ---------- Spielbrett ---------- */
.board-frame {
  background: linear-gradient(
    180deg,
    #2b1a0d 0%,
    var(--board) 18%,
    #190e06 100%
  );
  border: 2px solid #3d2a14;
  outline: 1px solid #0a0603;
  box-shadow:
    inset 0 0 0 1px #00000088,
    inset 0 0 60px #000000aa,
    0 10px 40px #000000cc;
  border-radius: 6px;
  padding: 0.6rem 1.2rem 1.2rem;
  position: relative;
}

.board-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  text-align: center;
  color: var(--gold);
  letter-spacing: 0.25em;
  font-size: 0.85rem;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 0.45rem;
  margin-bottom: 0.8rem;
}

.row-label {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0.35rem 0 0.25rem;
  font-family: "Cinzel", serif;
}

.card-row {
  display: flex;
  gap: 8px;
  min-height: calc(var(--card-h) / 2 + 14px);
  align-items: flex-start;
  flex-wrap: wrap;
}

.card-row.backs img {
  width: calc(var(--card-w) * 0.62);
  height: auto;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 5px #000);
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}

.back-wrap {
  position: relative;
  display: inline-block;
}

.back-wrap.spent img {
  filter: grayscale(0.9) brightness(0.45) drop-shadow(0 3px 5px #000);
}

.back-wrap.spent::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #c0392bdd;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 0 5px #000;
}

.unknown-card {
  font-family: "Cinzel Decorative", serif;
  font-size: 2.6rem;
  color: var(--gold-dim);
  text-shadow: 0 0 16px rgba(201, 161, 77, 0.35);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

.mode-switch {
  display: flex;
  gap: 4px;
  background: #00000055;
  border: 1px solid #3d2a14;
  border-radius: 4px;
  padding: 3px;
}

.mode-switch label {
  flex: 1;
  text-align: center;
  cursor: pointer;
}

.mode-switch input {
  display: none;
}

.mode-switch span {
  display: block;
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.2rem;
  border-radius: 3px;
  color: var(--ink-dim);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.mode-switch input:checked + span {
  background: linear-gradient(180deg, #8a6a2f, #5d4520);
  color: #f5e6bf;
  box-shadow: inset 0 1px 0 #ffffff22;
}

.mode-desc {
  font-size: 0.85rem;
  color: var(--ink-dim);
  margin: 0;
  font-style: italic;
}

.hidden-opt {
  display: none !important;
}

/* Untere Zone: Hand links, Zug-Urteil rechts */
.my-area {
  display: flex;
  gap: 1.2rem;
  align-items: stretch;
}

.my-hand {
  flex: 0 0 auto;
}

.verdict {
  flex: 0 0 auto;
  width: 220px;
  margin-top: 1.5rem;
  margin-left: auto;
  align-self: center;
  border-radius: 8px;
  border: 1px solid #3d2a14;
  background: radial-gradient(ellipse 100% 80% at 50% 0%, #1d130a, #0c0805);
  padding: 0.5rem 0.7rem 0.7rem;
  text-align: center;
  box-shadow:
    inset 0 0 22px #000000aa,
    0 4px 16px #000000aa;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.verdict-title {
  font-family: "Cinzel", serif;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 0.3rem;
  margin-bottom: 0.45rem;
}

.verdict-inner.pop {
  animation: verdictpop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes verdictpop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.v-icon {
  font-size: 1.9rem;
  line-height: 1.2;
}

.v-word {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  margin: 0.1rem 0 0.2rem;
}

.v-math {
  font-size: 0.82rem;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.v-tip {
  font-size: 0.78rem;
  font-style: italic;
  color: var(--ink-dim);
  margin-top: 0.25rem;
  line-height: 1.3;
}

.verdict.neutral .v-icon,
.verdict.neutral .v-word {
  color: var(--gold-dim);
}
.verdict.good {
  border-color: #3f6b3f;
  box-shadow:
    inset 0 0 22px #000000aa,
    0 0 18px #3f6b3f55;
}
.verdict.good .v-icon,
.verdict.good .v-word {
  color: var(--good);
  text-shadow: 0 0 14px #3f6b3f88;
}
.verdict.warn {
  border-color: #6b5a3f;
  box-shadow:
    inset 0 0 22px #000000aa,
    0 0 18px #6b5a3f55;
}
.verdict.warn .v-icon,
.verdict.warn .v-word {
  color: var(--warn);
  text-shadow: 0 0 14px #6b5a3f88;
}
.verdict.bad {
  border-color: #6b443f;
  box-shadow:
    inset 0 0 22px #000000aa,
    0 0 18px #6b443f66;
}
.verdict.bad .v-icon,
.verdict.bad .v-word {
  color: var(--bad);
  text-shadow: 0 0 14px #6b443f99;
}

@media (max-width: 720px) {
  .my-area {
    flex-direction: column;
  }
  .verdict {
    margin-top: 0.4rem;
  }
}

/* Hand des Spielers */
.hand .card {
  position: relative;
  width: var(--card-w);
  height: var(--card-h);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    filter 0.16s ease;
  border: 0;
  padding: 0;
  background: none;
}

.hand .card img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  filter: drop-shadow(0 4px 6px #000);
}

.hand .card:not(.played):not(.disabled):hover {
  transform: translateY(-10px) scale(1.05);
  filter: drop-shadow(0 0 12px rgba(240, 205, 122, 0.5));
  z-index: 4;
}

.hand .card.best-pre::after {
  content: "★";
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold-bright);
  text-shadow: 0 0 8px var(--gold);
  font-size: 1rem;
}

.hand .card.played {
  cursor: default;
  filter: grayscale(0.95) brightness(0.45);
  transform: rotate(-4deg) translateY(6px);
}

.hand .card.played::after {
  content: "✕";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #c0392bdd;
  font-size: 2.4rem;
  font-weight: 700;
  text-shadow: 0 0 6px #000;
}

.hand .card.disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

/* Tischmitte */
.table-center {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 0.6rem;
  margin: 1rem 0;
  padding: 0.8rem 0.6rem;
  background: linear-gradient(180deg, #000000aa, #00000055);
  border-top: 1px solid #00000099;
  border-bottom: 1px solid #3d2a1466;
  border-radius: 4px;
  min-height: calc(var(--card-h) + 3rem);
}

.played-slot {
  text-align: center;
}

.slot-label {
  font-family: "Cinzel", serif;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 0.4rem;
}

.slot-card {
  width: var(--card-w);
  height: var(--card-h);
  margin: 0 auto;
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  background: #00000066;
  box-shadow: inset 0 0 18px #000;
  display: grid;
  place-items: center;
}

.slot-card img {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.slot-card.flash {
  animation: slotflash 0.5s ease;
}

@keyframes slotflash {
  0% {
    box-shadow:
      inset 0 0 18px #000,
      0 0 0 rgba(240, 205, 122, 0);
  }
  40% {
    box-shadow:
      inset 0 0 18px #000,
      0 0 26px rgba(240, 205, 122, 0.55);
  }
  100% {
    box-shadow:
      inset 0 0 18px #000,
      0 0 0 rgba(240, 205, 122, 0);
  }
}

.round-result {
  text-align: center;
}

.result-symbol {
  font-size: 2.2rem;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(201, 161, 77, 0.6);
  min-height: 2.6rem;
}

.result-symbol.win {
  color: var(--good);
  text-shadow: 0 0 18px rgba(127, 201, 127, 0.6);
}
.result-symbol.lose {
  color: var(--bad);
  text-shadow: 0 0 18px rgba(224, 108, 90, 0.6);
}

.result-text {
  font-size: 0.95rem;
  color: var(--ink-dim);
  font-style: italic;
  min-height: 2.4em;
}

/* ---------- Punkte-Panel ---------- */
.score-panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-deep) 100%);
  border: 1px solid #3d2a14;
  border-radius: 6px;
  box-shadow:
    inset 0 0 30px #00000099,
    0 8px 30px #000000aa;
  padding: 1rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  align-items: center;
  text-align: center;
}

.score-block {
  width: 100%;
}

.score-name {
  font-family: "Cinzel", serif;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.score-value {
  font-family: "Cinzel", serif;
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--ink);
  text-shadow: 0 2px 0 #000;
}

.score-value.gold {
  color: var(--gold-bright);
}

.round-indicator {
  font-size: 0.85rem;
  color: var(--ink-dim);
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
  padding: 0.3rem 0;
  width: 100%;
}

.coins-block {
  margin-top: auto;
  width: 100%;
}

.coins-label {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.coins-value {
  font-family: "Cinzel", serif;
  font-size: 1.8rem;
  color: var(--gold-bright);
  text-shadow: 0 0 14px rgba(201, 161, 77, 0.5);
}

.btn-gold {
  font-family: "Cinzel", serif;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #8a6a2f, #5d4520);
  color: #f5e6bf;
  border: 1px solid #c9a14d88;
  border-radius: 4px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  text-shadow: 0 1px 0 #000;
  box-shadow:
    inset 0 1px 0 #ffffff22,
    0 3px 8px #000000aa;
  transition:
    filter 0.15s ease,
    transform 0.1s ease;
  width: 100%;
}

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

/* ---------- Orakel-Panel ---------- */
.oracle-panel {
  background: linear-gradient(180deg, var(--panel) 0%, var(--panel-deep) 100%);
  border: 1px solid #3d2a14;
  border-radius: 6px;
  box-shadow:
    inset 0 0 30px #00000099,
    0 8px 30px #000000aa;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.oracle-panel h2 {
  font-family: "Cinzel", serif;
  color: var(--gold);
  font-size: 1.05rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0;
  text-align: center;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 0.4rem;
}

.solver-status {
  font-size: 0.85rem;
  color: var(--ink-dim);
  font-style: italic;
  text-align: center;
}

.solver-status.ready {
  color: var(--good);
}

.dots::after {
  content: "";
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
}

.hint-banner {
  border-radius: 4px;
  padding: 0.6rem 0.8rem;
  font-size: 0.98rem;
  border: 1px solid transparent;
  min-height: 3.2em;
}

.hint-banner.neutral {
  background: #00000044;
  border-color: #3d2a14;
  color: var(--ink-dim);
}
.hint-banner.good {
  background: #1b2a1bcc;
  border-color: #3f6b3f;
  color: var(--good);
}
.hint-banner.warn {
  background: #2a221bcc;
  border-color: #6b5a3f;
  color: var(--warn);
}
.hint-banner.bad {
  background: #2a1b18cc;
  border-color: #6b443f;
  color: var(--bad);
}

details summary {
  cursor: pointer;
  font-family: "Cinzel", serif;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.ev-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 0.5rem;
}

.ev-row {
  display: grid;
  grid-template-columns: 2.2rem 1fr 3.6rem;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.ev-row .num {
  font-family: "Cinzel", serif;
  font-weight: 700;
  text-align: center;
  border-radius: 3px;
  padding: 1px 0;
  border: 1px solid #00000066;
}

.ev-row .num.black {
  background: #15100c;
  color: #cfc4ab;
}
.ev-row .num.white {
  background: #d8d2c2;
  color: #221c14;
}

.ev-row .bar {
  height: 10px;
  border-radius: 2px;
  background: #00000066;
  overflow: hidden;
}

.ev-row .bar > i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #7a6233, var(--gold-bright));
}

.ev-row.best .bar > i {
  background: linear-gradient(90deg, #3f6b3f, var(--good));
}
.ev-row .val {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink-dim);
}
.ev-row.best .val {
  color: var(--good);
}

.posterior {
  display: flex;
  gap: 6px;
  padding-top: 0.5rem;
  flex-wrap: wrap;
}

.post-chip {
  font-size: 0.85rem;
  border: 1px solid #3d2a14;
  border-radius: 3px;
  padding: 2px 7px;
  background: #00000044;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: var(--ink-dim);
}
.options input {
  accent-color: var(--gold);
}

.ev-lost {
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--ink-dim);
  border-top: 1px solid var(--gold-dim);
  padding-top: 0.5rem;
  text-align: center;
}

#ev-lost {
  color: var(--warn);
  font-variant-numeric: tabular-nums;
}

/* ---------- Log ---------- */
.log-section,
.knowledge {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
}

.log-section h2,
.knowledge h2 {
  font-family: "Cinzel", serif;
  color: var(--gold);
  font-size: 1.1rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--gold-dim);
  padding-bottom: 0.3rem;
}

.log {
  font-size: 0.92rem;
  color: var(--ink-dim);
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  max-height: 16em;
  overflow-y: auto;
}

.log .win {
  color: var(--good);
}
.log .lose {
  color: var(--bad);
}
.log .dev {
  color: var(--warn);
}

/* ---------- Wissen ---------- */
.knowledge article.wide {
  grid-column: 1 / -1;
}

.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.2rem;
}

.knowledge article {
  background: #150e0855;
  border: 1px solid #3d2a1466;
  border-radius: 6px;
  padding: 0.4rem 1rem 0.8rem;
}

.knowledge h3 {
  font-family: "Cinzel", serif;
  color: var(--gold-bright);
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.strat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.strat-table th,
.strat-table td {
  text-align: left;
  padding: 0.3rem 0.4rem;
  border-bottom: 1px solid #3d2a1466;
}

.strat-table th {
  font-family: "Cinzel", serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.strat-table tr.best td {
  color: var(--good);
  font-weight: 600;
}

.methodology a,
.knowledge a {
  color: var(--gold-bright);
  text-decoration-color: var(--gold-dim);
}

.methodology code {
  font-size: 0.82em;
  background: #00000055;
  padding: 0 0.3em;
  border-radius: 3px;
}

.methodology {
  font-size: 0.88rem;
  color: var(--ink-dim);
  border-left: 2px solid var(--gold-dim);
  padding-left: 0.9rem;
  margin-top: 1.4rem;
}

footer {
  text-align: center;
  color: #5d4f3a;
  font-size: 0.8rem;
  padding: 1.6rem 1rem 2.4rem;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: #000000bb;
  display: grid;
  place-items: center;
  z-index: 10;
}

.modal.hidden {
  display: none;
}

.modal-card {
  background: linear-gradient(180deg, #241608, #160d05);
  border: 2px solid var(--gold-dim);
  border-radius: 8px;
  box-shadow: 0 0 80px #000;
  max-width: 34rem;
  width: calc(100vw - 2rem);
  padding: 1.4rem 1.8rem;
  text-align: center;
}

.modal-card h2 {
  font-family: "Cinzel Decorative", serif;
  color: var(--gold-bright);
  margin-top: 0;
}

.modal-card .go-stats {
  font-size: 1.05rem;
  margin: 0.6rem 0;
}
.modal-card .go-deviations {
  text-align: left;
  font-size: 0.9rem;
  color: var(--ink-dim);
  max-height: 11em;
  overflow-y: auto;
  border-top: 1px solid var(--gold-dim);
  border-bottom: 1px solid var(--gold-dim);
  padding: 0.5rem 0;
  margin: 0.8rem 0;
}

.modal-card .rank {
  font-family: "Cinzel", serif;
  font-size: 1.3rem;
  color: var(--gold);
  margin: 0.5rem 0;
}
