/* CROWNSHIFT – Oberfläche. Materialien: Stein (Flächen), Eisen (Rahmen), Bronze (Bedienung), Gold (Belohnung), Pergament (Information). */

*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: var(--slate-950);
  color: var(--text);
  font-family: var(--font-body);
  font-size: calc(16px * var(--ui-scale));
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  font-variant-numeric: lining-nums;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body {
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
}
input,
select {
  user-select: text;
  -webkit-user-select: text;
}
:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.ic {
  display: inline-block;
  vertical-align: middle;
  flex: none;
}
[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ Grundgerüst */

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
}
#app {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
}
#screens {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: calc(var(--safe-top) + 14px) 14px calc(96px + var(--safe-bottom));
}
#match-host {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
#match-host > * {
  pointer-events: auto;
}
body.in-match #app {
  visibility: hidden;
}
.menu-screen {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: screen-in 0.55s var(--ease-out) both;
}
@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}
.screen-title {
  margin: 4px 0 0;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.45rem;
  letter-spacing: 0.14em;
  color: var(--parchment);
  text-shadow: 0 2px 0 #000, 0 0 18px rgba(255, 200, 120, 0.25);
}

/* ------------------------------------------------------------------ Navigation (Bronzeplatten auf Eiche) */

#tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + var(--safe-bottom));
  background: linear-gradient(180deg, rgba(20, 12, 7, 0.4), var(--oak-950) 30%), repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.015) 0 2px, transparent 2px 7px);
  border-top: 1px solid var(--bronze-700);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 210, 150, 0.12);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 2px 4px;
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
}
.tab-ic {
  color: var(--bronze-light);
  filter: drop-shadow(0 1px 0 #000);
  transition: transform 0.25s var(--ease-out), color 0.2s;
}
.tab.on {
  color: var(--gold-bright);
  background: radial-gradient(ellipse at 50% 0%, rgba(240, 200, 120, 0.16), transparent 70%);
}
.tab.on .tab-ic {
  color: var(--gold-bright);
  transform: translateY(-2px);
  filter: drop-shadow(0 0 8px rgba(255, 200, 100, 0.6));
}
.tab-label {
  white-space: nowrap;
}

/* ------------------------------------------------------------------ Materialien */

.stone-panel {
  position: relative;
  background: linear-gradient(170deg, rgba(58, 61, 68, 0.92), rgba(30, 32, 36, 0.94) 55%, rgba(19, 20, 23, 0.96));
  border: 1px solid #0b0b0d;
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px rgba(143, 95, 44, 0.35), inset 0 -14px 24px rgba(0, 0, 0, 0.35), var(--shadow-deep);
  padding: 16px 14px;
  backdrop-filter: blur(2px);
}
.parchment {
  background: radial-gradient(ellipse at 30% 20%, #f3e8cf, var(--parchment) 45%, var(--parchment-dark) 100%);
  color: var(--ink);
  border-radius: 6px;
  box-shadow: inset 0 0 22px rgba(110, 74, 34, 0.45), inset 0 0 2px rgba(80, 50, 20, 0.6), 0 8px 22px rgba(0, 0, 0, 0.55);
  padding: 14px 16px;
}
.parchment.small {
  font-size: 0.92rem;
}
.parchment p {
  margin: 0.3em 0;
}
.parch-title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  text-align: center;
}
.panel-title {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.16em;
  color: var(--gold);
  text-shadow: 0 1px 0 #000;
  justify-content: center;
}
.panel-title::before,
.panel-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--bronze-light), transparent);
  opacity: 0.7;
}
.panel-note {
  margin: -2px 0 10px;
  text-align: center;
  color: var(--candle);
  font-style: italic;
}
.label {
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.fine {
  font-size: 0.82rem;
  color: var(--text-soft);
  margin: 4px 0 8px;
}
.status-line {
  margin: 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-soft);
  font-style: italic;
}
.status-line.offline {
  color: #e7a46a;
}
.link {
  color: var(--brass);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ Schaltflächen */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 10px 16px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.86rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: transform 0.12s, filter 0.2s, box-shadow 0.2s;
}
.btn:active {
  transform: translateY(1px) scale(0.99);
}
.btn:disabled,
.btn[aria-disabled="true"] {
  filter: grayscale(0.9) brightness(0.7);
  cursor: default;
}
.btn-plate {
  color: var(--parchment);
  background: linear-gradient(180deg, #6a4521, var(--bronze-700) 45%, var(--bronze-900));
  border: 1px solid #1a1007;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.35), inset 0 -2px 6px rgba(0, 0, 0, 0.45), 0 3px 10px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 #000;
}
.btn-plate:hover,
.btn-plate:focus-visible {
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.35), inset 0 0 0 1px var(--gold), 0 3px 14px rgba(0, 0, 0, 0.5);
}
.btn-primary {
  color: #2a1a08;
  background: linear-gradient(180deg, #f6dc94, var(--gold) 40%, #a77d32 100%);
  border: 1px solid #5e4618;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 8px rgba(94, 70, 24, 0.55), 0 0 22px rgba(240, 190, 90, 0.25), 0 6px 16px rgba(0, 0, 0, 0.55);
  text-shadow: 0 1px 0 rgba(255, 240, 200, 0.6);
}
.btn-primary:hover {
  filter: brightness(1.06);
}
.btn-danger {
  color: #ffd9d4;
  background: linear-gradient(180deg, #7a2a22, #4b1611);
}
.btn-crest {
  width: 100%;
  min-height: 64px;
  font-size: 1rem;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 50% 100%, 0 72%);
  padding-bottom: 18px;
}
.btn-ic {
  display: inline-flex;
}
.btn-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  line-height: 1.15;
}
.btn-stack small {
  font-family: var(--font-body);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
  font-size: 0.78rem;
  opacity: 0.8;
}
.btn.glow {
  animation: glow 2.2s ease-in-out infinite;
}
@keyframes glow {
  50% {
    box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.35), 0 0 0 2px var(--gold), 0 0 22px rgba(240, 190, 90, 0.5);
  }
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--parchment);
  background: radial-gradient(circle at 35% 30%, #4a3018, var(--bronze-900));
  border: 1px solid #000;
  box-shadow: inset 0 1px 0 rgba(255, 220, 160, 0.3), 0 2px 8px rgba(0, 0, 0, 0.6);
  font-size: 1.1rem;
}
.icon-btn.small {
  width: 28px;
  height: 28px;
  margin-left: 6px;
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.chips.modes .chip {
  flex: 1 1 0;
  min-width: 90px;
}
.chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 10px;
  min-height: 42px;
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(60, 40, 22, 0.9), rgba(30, 20, 11, 0.95));
  border: 1px solid rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 210, 150, 0.15);
  color: var(--text-soft);
  transition: all 0.2s;
}
.chip-main {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
}
.chip-sub {
  font-size: 0.68rem;
  opacity: 0.75;
  text-align: center;
}
.chip.on {
  color: var(--gold-bright);
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold-dim), inset 0 0 18px rgba(240, 190, 90, 0.18), 0 0 14px rgba(240, 190, 90, 0.2);
}

.xpbar {
  display: inline-block;
  position: relative;
  height: 6px;
  min-width: 80px;
  flex: 1;
  border-radius: 3px;
  background: #0d0d10;
  box-shadow: inset 0 1px 2px #000, 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.xpbar i {
  position: absolute;
  inset: 0 auto 0 0;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold-bright));
  box-shadow: 0 0 8px rgba(255, 210, 120, 0.6);
}

.spinner {
  display: inline-block;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(240, 212, 140, 0.25);
  border-top-color: var(--gold-bright);
  animation: spin 1s linear infinite;
  vertical-align: middle;
}
.spinner.small {
  width: 14px;
  height: 14px;
  margin-right: 6px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ------------------------------------------------------------------ Halle / War Table */

.hall-head {
  text-align: center;
  padding-top: 6px;
}
.logo-wrap {
  display: flex;
  justify-content: center;
}
.claim {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-shadow: 0 1px 0 #000;
}
.house-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(20, 12, 7, 0.85), rgba(40, 26, 14, 0.75));
  border: 1px solid rgba(143, 95, 44, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 210, 150, 0.1), 0 6px 18px rgba(0, 0, 0, 0.5);
}
.house-card.loading {
  justify-content: center;
  min-height: 72px;
}
.hc-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.hc-house {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.hc-name {
  color: var(--text-soft);
  font-size: 0.9rem;
}
.hc-level {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-top: 3px;
}
.war-table .seek {
  margin-top: 14px;
}
.wt-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.wt-row .btn {
  justify-content: flex-start;
  padding: 10px 10px;
  font-size: 0.72rem;
}
.plaques {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.plaques .plaque:only-child {
  grid-column: span 2;
}
.plaque {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  color: var(--parchment);
  background: linear-gradient(180deg, rgba(58, 61, 68, 0.88), rgba(24, 26, 29, 0.92));
  border: 1px solid #0b0b0d;
  box-shadow: inset 0 0 0 1px rgba(143, 95, 44, 0.3), 0 4px 12px rgba(0, 0, 0, 0.5);
}
.plaque-ic {
  color: var(--bronze-light);
}
.plaque-text {
  display: flex;
  flex-direction: column;
}
.plaque-label {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
}
.plaque-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}
.plaque.locked {
  filter: grayscale(0.7) brightness(0.8);
}

/* Matchmaking */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, rgba(40, 26, 14, 0.75), rgba(8, 6, 4, 0.94));
  opacity: 0;
  transition: opacity 0.3s;
}
.overlay.in {
  opacity: 1;
}
.mm-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  font-size: 1.25rem;
  text-shadow: 0 2px 0 #000;
}
.mm-flavor {
  margin: 0;
  font-style: italic;
  color: var(--text-soft);
}
.mm-secs {
  font-family: var(--font-display);
  color: var(--text-dim);
}
.mm-banner {
  animation: mm-sway 4s ease-in-out infinite;
  transform-origin: 50% 0;
}
@keyframes mm-sway {
  50% {
    transform: rotate(1.5deg);
  }
}
.mm-offer {
  max-width: 320px;
}

/* Bots */
.bot-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  text-align: left;
  background: linear-gradient(90deg, rgba(40, 26, 14, 0.9), rgba(24, 26, 29, 0.9));
  border: 1px solid rgba(143, 95, 44, 0.45);
}
.bot-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.bot-text strong {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.bot-text small {
  color: var(--text-soft);
}
.bot-pips {
  display: flex;
  gap: 3px;
}
.bot-pips i {
  width: 6px;
  height: 14px;
  border-radius: 2px;
  background: #2a2d32;
}
.bot-pips i.on {
  background: linear-gradient(180deg, var(--gold-bright), var(--bronze));
}

/* ------------------------------------------------------------------ Courtyard */

.join-row {
  display: flex;
  gap: 8px;
}
.code-input,
.text-input {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--bronze-700);
  background: #0f0f12;
  color: var(--parchment);
  box-shadow: inset 0 2px 6px #000;
}
.code-input {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: 0.35em;
  text-align: center;
  text-transform: uppercase;
}
.text-input {
  width: 100%;
}
.room-box:empty {
  display: none;
}
.room {
  margin-top: 14px;
  text-align: center;
}
.room-code {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 0.3em;
  color: var(--ink);
  margin-right: -0.3em;
}
.room-qr {
  width: 168px;
  margin: 8px auto;
  padding: 6px;
  background: #f4ead2;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(80, 50, 20, 0.4);
}
.room-qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.room-qr path,
.room-qr rect[fill="black"] {
  fill: #2a1f16;
}
.room-wait {
  color: var(--ink-soft);
  font-style: italic;
}
.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.room-actions .btn {
  min-height: 40px;
  font-size: 0.72rem;
}

/* ------------------------------------------------------------------ Armory */

.ar-top {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ar-preview {
  flex: none;
  width: 132px;
}
.ar-id {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ar-house {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.08em;
  font-size: 1.15rem;
  color: var(--gold-bright);
}
.ar-motto em {
  display: block;
  color: var(--parchment);
}
.ar-motto small {
  color: var(--text-dim);
}
.ar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
  gap: 6px;
}
.ar-motto .ar-grid,
.ar-grid.ar-motto {
  grid-template-columns: 1fr 1fr;
}
.ar-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(10, 10, 12, 0.6);
  border: 1px solid rgba(143, 95, 44, 0.35);
}
.ar-opt.on {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), 0 0 14px rgba(240, 190, 90, 0.35);
}
.ar-opt.locked > :first-child {
  filter: grayscale(1) brightness(0.45);
}
.ar-lock {
  position: absolute;
  right: 3px;
  bottom: 2px;
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 0.66rem;
  color: var(--gold);
}
.ar-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--sw);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.45), inset 0 2px 3px rgba(255, 255, 255, 0.25), 0 0 0 2px var(--bronze-700);
}
.ar-swatch.metal {
  background: radial-gradient(circle at 35% 30%, #fff, var(--sw) 55%, #555 120%);
}
.ar-motto-opt {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 2px 6px;
}
.ar-motto-opt em {
  color: var(--parchment);
  font-size: 0.9rem;
}
.ar-motto-opt small {
  color: var(--text-dim);
  font-size: 0.72rem;
}
.ar-house-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  color: var(--gold);
}
.ar-select {
  flex: 1;
  min-height: 42px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--bronze-700);
  background: #121214;
  color: var(--parchment);
}
.ar-section + .ar-section {
  margin-top: 4px;
}
.panel .btn-crest {
  margin-top: 16px;
}

/* ------------------------------------------------------------------ Keep */

.kp-top {
  display: flex;
  gap: 14px;
  align-items: center;
}
.kp-banner {
  flex: none;
  width: 120px;
}
.kp-id {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}
.kp-house {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--gold-bright);
}
.kp-name {
  display: flex;
  align-items: center;
  color: var(--parchment);
}
.kp-motto {
  font-style: italic;
  color: var(--text-soft);
}
.kp-level {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-soft);
}
.kp-level small {
  width: 100%;
  color: var(--text-dim);
}
.kp-title-badge {
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  color: #2a1a08;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-dim));
}
.kp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.kp-stat {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(143, 95, 44, 0.25);
}
.kp-stat span {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.kp-stat strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--parchment);
}
.kp-stat small {
  font-size: 0.72rem;
  color: var(--gold);
}
.kp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.kp-actions .btn {
  flex: 1;
  font-size: 0.7rem;
}
.provider-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}
.kp-links,
.set-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 4px 0 10px;
}

/* ------------------------------------------------------------------ Chronicle */

.chronicle {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chronicle-entry {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "date date watch" "crests line watch" "crests meta watch";
  column-gap: 10px;
  align-items: center;
  text-align: left;
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--ink);
  background: radial-gradient(ellipse at 20% 10%, #f3e8cf, var(--parchment) 50%, var(--parchment-dark));
  box-shadow: inset 0 0 18px rgba(110, 74, 34, 0.4), 0 4px 12px rgba(0, 0, 0, 0.5);
  border-left: 4px solid var(--gold-dim);
}
.chronicle-entry.lost {
  border-left-color: #6b2a24;
}
.ce-date {
  grid-area: date;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
}
.ce-crests {
  grid-area: crests;
  display: flex;
}
.ce-crests > span + span {
  margin-left: -8px;
}
.ce-line {
  grid-area: line;
  font-weight: 700;
}
.ce-line small {
  font-weight: 400;
  color: var(--ink-soft);
}
.ce-meta {
  grid-area: meta;
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.ce-watch {
  grid-area: watch;
  color: var(--bronze);
}
.chronicle-empty {
  text-align: center;
}

/* Tournament */
.tn {
  text-align: center;
}
.tn-ic {
  color: var(--bronze);
}
.tn-ranks {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ Dialoge, Sheets, Hinweise */

.dialog-wrap,
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.25s;
}
.dialog-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dialog-wrap.in,
.sheet-wrap.in {
  opacity: 1;
}
.dialog-card {
  width: min(380px, 100%);
  transform: translateY(12px);
  transition: transform 0.3s var(--ease-out);
}
.dialog-wrap.in .dialog-card {
  transform: none;
}
.dialog-title {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-align: center;
}
.dialog-body {
  margin: 0 0 14px;
  text-align: center;
}
.dialog-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.dialog-actions .btn {
  flex: 1;
  min-width: 120px;
}
.dialog-card .text-input {
  margin-bottom: 14px;
}
.sheet-wrap {
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: min(560px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  border-radius: 14px 14px 0 0;
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.32s var(--ease-out);
}
.sheet-wrap.in .sheet {
  transform: none;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 6px;
}
.sheet-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.12em;
  font-size: 1rem;
  color: var(--gold-bright);
}
.sheet-body {
  overflow-y: auto;
  padding: 6px 16px calc(20px + var(--safe-bottom));
}
.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.prose h3 {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--gold);
  margin: 14px 0 4px;
}
.prose p {
  margin: 0;
  color: var(--text-soft);
  user-select: text;
}
.toasts {
  position: fixed;
  left: 50%;
  top: calc(var(--safe-top) + 12px);
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: min(420px, calc(100% - 24px));
  pointer-events: none;
}
.toast {
  padding: 10px 14px;
  border-radius: 8px;
  text-align: center;
  color: var(--ink);
  background: linear-gradient(180deg, #f3e8cf, var(--parchment-dark));
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s var(--ease-out);
}
.toast.in {
  opacity: 1;
  transform: none;
}
.toast-warn {
  background: linear-gradient(180deg, #f2d2b8, #c9946a);
}

/* Einstellungen */
.settings .label:first-child {
  margin-top: 0;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(143, 95, 44, 0.15);
}
.set-label {
  display: flex;
  flex-direction: column;
}
.set-label small {
  color: var(--text-dim);
  font-size: 0.76rem;
}
.set-row .ar-select {
  flex: none;
  width: 46%;
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  flex: none;
  width: 50px;
  height: 28px;
  border-radius: 14px;
  background: #0f0f12;
  border: 1px solid var(--bronze-700);
  box-shadow: inset 0 2px 5px #000;
  position: relative;
  transition: background 0.2s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d9b97a, var(--bronze));
  transition: transform 0.2s var(--ease-out);
}
.switch:checked {
  background: linear-gradient(180deg, #6b4a1c, #3b2612);
}
.switch:checked::after {
  transform: translateX(22px);
  background: radial-gradient(circle at 35% 30%, #fff3c8, var(--gold));
}
.slider {
  width: 46%;
  accent-color: var(--gold);
}

/* ------------------------------------------------------------------ Startbildschirm */

.splash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(ellipse at 50% 45%, #241810 0%, #0c0907 60%, #050404 100%);
  cursor: pointer;
  transition: opacity 0.8s ease, transform 0.9s var(--ease-heavy);
}
.splash.out {
  opacity: 0;
  transform: scale(1.06);
  pointer-events: none;
}
.splash-claim {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.splash-tap {
  position: absolute;
  bottom: calc(48px + var(--safe-bottom));
  margin: 0;
  font-style: italic;
  color: var(--text-dim);
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe {
  50% {
    opacity: 0.4;
  }
}

/* ------------------------------------------------------------------ Match */

.screen.match,
.overlay-screen {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-top) + 6px) 8px calc(var(--safe-bottom) + 6px);
  gap: 4px;
  overflow: hidden;
}
.overlay-screen {
  z-index: 20;
  background: radial-gradient(ellipse at 50% 30%, rgba(30, 20, 12, 0.3), rgba(6, 5, 4, 0.55));
}
.m-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.m-top .m-player {
  flex: 1;
}
.m-player {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(14, 10, 7, 0.82), rgba(14, 10, 7, 0.4));
  border: 1px solid rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.3s;
  min-height: 52px;
}
.m-player.seat-0 {
  --seat: var(--p0);
  --seat-bright: var(--p0-bright);
  --seat-glow: var(--p0-glow);
}
.m-player.seat-1 {
  --seat: var(--p1);
  --seat-bright: var(--p1-bright);
  --seat-glow: var(--p1-glow);
}
.m-player::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--seat-bright);
}
.m-player.active {
  box-shadow: 0 0 0 1px var(--seat-bright), 0 0 18px var(--seat-glow);
}
.m-pname {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.m-house {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--parchment);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.m-name {
  font-size: 0.78rem;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.tag-bot {
  padding: 0 5px;
  border-radius: 3px;
  font-family: var(--font-display);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--parchment-dark);
}
.m-ptiles {
  display: flex;
  align-items: center;
  gap: 2px;
  opacity: 0.85;
}
.m-ptimer {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 2px;
  height: 2px;
  border-radius: 1px;
  overflow: hidden;
}
.m-ptimer i {
  display: block;
  height: 100%;
  width: calc(var(--p, 0) * 100%);
  background: var(--seat-bright);
}

/* Battle Line */
.battleline {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(14, 10, 7, 0.85), rgba(28, 19, 11, 0.75));
  border: 1px solid rgba(143, 95, 44, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 210, 150, 0.1), 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.4s;
}
.battleline.seat-me-0 {
  --mine: var(--p0);
  --mine-b: var(--p0-bright);
  --theirs: var(--p1);
  --theirs-b: var(--p1-bright);
}
.battleline.seat-me-1 {
  --mine: var(--p1);
  --mine-b: var(--p1-bright);
  --theirs: var(--p0);
  --theirs-b: var(--p0-bright);
}
.bl-castle {
  position: relative;
  flex: none;
  width: 38px;
  height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.bl-castle-ic {
  color: #8c8f96;
  filter: drop-shadow(0 2px 0 #000);
}
.bl-castle-me .bl-castle-ic {
  color: color-mix(in srgb, var(--mine-b) 35%, #9a9ca2);
}
.bl-castle-them .bl-castle-ic {
  color: color-mix(in srgb, var(--theirs-b) 35%, #9a9ca2);
}
.bl-crest {
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
}
.bl-track {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  align-items: end;
  height: 40px;
  padding-bottom: 2px;
}
.bl-track::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1px;
  height: 2px;
  background: linear-gradient(90deg, var(--mine), var(--bronze), var(--theirs));
  opacity: 0.6;
}
.bl-banner {
  display: flex;
  justify-content: center;
  transform-origin: 50% 0;
}
.bl-banner svg {
  width: 15px;
  height: 26px;
  overflow: visible;
}
.bl-pole {
  fill: var(--bronze-light);
}
.bl-trim {
  fill: rgba(255, 215, 140, 0.55);
}
.bl-banner.mine .bl-cloth {
  fill: var(--mine-b);
}
.bl-banner.theirs .bl-cloth {
  fill: var(--theirs-b);
}
.bl-cloth {
  transition: fill 0.25s 0.25s;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5));
}
.bl-banner.flip {
  animation: bl-flip 0.62s var(--ease-heavy);
}
@keyframes bl-flip {
  0% {
    transform: none;
  }
  45% {
    transform: translateY(14px) scaleY(0.1);
  }
  55% {
    transform: translateY(14px) scaleY(0.1);
  }
  100% {
    transform: none;
  }
}
.bl-front {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold-bright);
  filter: drop-shadow(0 0 6px rgba(255, 200, 100, 0.8)) drop-shadow(0 1px 0 #000);
  transition: left 0.5s var(--ease-heavy);
  pointer-events: none;
}
.battleline.final-mine,
.battleline.final-theirs {
  box-shadow: 0 0 0 1px var(--gold), 0 0 22px rgba(255, 200, 100, 0.35);
}
.battleline.last-stand {
  animation: ls-glow 1.6s ease-in-out infinite;
}
@keyframes ls-glow {
  50% {
    box-shadow: 0 0 0 1px #ff8a4a, 0 0 28px rgba(255, 110, 60, 0.55);
  }
}

.m-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}
.m-clock-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-soft);
}
.m-clock {
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}

.m-board-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-board {
  display: block;
  touch-action: none;
}
.m-board-wrap.quake {
  animation: quake 0.42s ease-out;
}
@keyframes quake {
  20% {
    transform: scale(1.012) translate(1px, -1px);
  }
  45% {
    transform: scale(1.006) translate(-1px, 1px);
  }
}
.m-chain {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.chain-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--font-display);
  color: var(--gold-bright);
  text-shadow: 0 3px 0 #000, 0 0 24px rgba(255, 200, 100, 0.8);
  animation: chain-in 0.45s var(--ease-out) both;
}
.chain-label strong {
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 0.12em;
}
.chain-label span {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.4em;
  color: #ffd38a;
}
.chain-label.chain-4 strong,
.chain-label.chain-5 strong {
  font-size: 2.5rem;
}
.chain-label.chain-6 strong {
  font-size: 2.9rem;
  color: #fff3c4;
}
.chain-label.out {
  opacity: 0;
  transform: translateY(-14px) scale(1.04);
  transition: all 0.45s ease-in;
}
@keyframes chain-in {
  from {
    opacity: 0;
    transform: scale(1.6);
  }
}
.m-points {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  pointer-events: none;
  animation: points-up 1.2s var(--ease-out) forwards;
  text-shadow: 0 2px 0 #000;
}
.m-points.seat-0 {
  color: #ff8a98;
}
.m-points.seat-1 {
  color: #9fc0ff;
}
@keyframes points-up {
  to {
    transform: translate(-50%, -60px);
    opacity: 0;
  }
}
.m-special {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 14px;
  border-radius: 4px;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #2a1a08;
  background: linear-gradient(180deg, var(--gold-bright), var(--gold-dim));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
  animation: chain-in 0.35s var(--ease-out) both;
  pointer-events: none;
}
.m-notice {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--parchment);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

/* Ablage */
.m-tray {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.m-turnlabel {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-soft);
  min-height: 1.2em;
}
.match.my-turn .m-turnlabel {
  color: var(--gold-bright);
}
.m-tray-row {
  display: flex;
  align-items: flex-end;
  gap: 22px;
}
.m-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.m-slot-label {
  font-family: var(--font-display);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-dim);
}
.m-now-stage {
  position: relative;
  width: 86px;
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.m-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--gold) calc(var(--p, 0) * 360deg), rgba(0, 0, 0, 0.5) 0);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%);
  mask: radial-gradient(circle, transparent 58%, #000 60%);
  opacity: 0.85;
}
.match.hurry .m-ring {
  background: conic-gradient(#ff8a4a calc(var(--p, 0) * 360deg), rgba(0, 0, 0, 0.5) 0);
  filter: drop-shadow(0 0 8px rgba(255, 120, 60, 0.9));
}
.m-now-tile {
  position: relative;
  border-radius: 50%;
  touch-action: none;
  transition: transform 0.2s var(--ease-out), filter 0.2s;
}
.match:not(.my-turn) .m-now-tile {
  filter: grayscale(0.4) brightness(0.65);
}
.match.my-turn .m-now-tile {
  cursor: grab;
  animation: tile-breathe 2.4s ease-in-out infinite;
}
.match.hurry .m-now-tile {
  animation: tile-pulse 0.5s ease-in-out infinite;
}
.m-now-tile.lifted {
  opacity: 0.25;
  animation: none !important;
}
@keyframes tile-breathe {
  50% {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 10px rgba(255, 210, 120, 0.45));
  }
}
@keyframes tile-pulse {
  50% {
    transform: scale(1.07);
    filter: drop-shadow(0 0 14px rgba(255, 140, 70, 0.8));
  }
}
.m-next-tile {
  height: 44px;
  display: flex;
  align-items: center;
  opacity: 0.85;
}
.m-hint {
  min-height: 1.2em;
  font-size: 0.8rem;
  color: var(--text-soft);
  font-style: italic;
  text-align: center;
}
.m-confirm {
  min-height: 38px;
  padding: 6px 22px;
}
.drag-ghost {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  pointer-events: none;
  filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.75));
  will-change: transform;
}
.m-bottom {
  display: flex;
}
.m-bottom .m-player {
  flex: 1;
}
.m-emote-btn {
  width: 38px;
  height: 38px;
}
.m-bubble {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 52px;
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 700;
  background: var(--parchment);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6);
  z-index: 4;
}
.m-top .m-bubble {
  bottom: auto;
  top: calc(100% + 6px);
}
.m-bubble.pop {
  animation: chain-in 0.25s var(--ease-out);
}
.emote-palette {
  position: absolute;
  right: 6px;
  bottom: calc(100% + 8px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: 10px;
  background: var(--parchment);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
  z-index: 5;
}
.emote-btn {
  min-width: 56px;
  min-height: 42px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 700;
  background: rgba(110, 74, 34, 0.12);
}

.energy {
  position: fixed;
  z-index: 30;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  pointer-events: none;
}
.energy.seat-0 {
  background: radial-gradient(circle, #fff, var(--p0-bright) 55%, transparent 70%);
  box-shadow: 0 0 14px var(--p0-bright);
}
.energy.seat-1 {
  background: radial-gradient(circle, #fff, var(--p1-bright) 55%, transparent 70%);
  box-shadow: 0 0 14px var(--p1-bright);
}

/* Overlays im Match */
.m-overlay {
  position: fixed;
  inset: 0;
  z-index: 25;
  pointer-events: none;
}
.m-overlay > * {
  pointer-events: auto;
}
.m-intro,
.m-laststand,
.m-reconnect {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(ellipse at 50% 45%, rgba(20, 14, 8, 0.82), rgba(4, 3, 2, 0.94));
  transition: opacity 0.45s;
}
.m-intro.out,
.m-laststand.out {
  opacity: 0;
}
.m-intro-kicker {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.3em;
  font-size: 0.8rem;
  color: var(--text-soft);
}
.m-intro-banners {
  display: flex;
  align-items: center;
  gap: 18px;
}
.m-intro-vs {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  color: var(--gold-bright);
  text-shadow: 0 2px 0 #000;
}
.m-intro-houses {
  display: flex;
  gap: 40px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  color: var(--parchment);
}
.m-intro-title,
.m-laststand h2 {
  margin: 10px 0 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
  color: var(--gold-bright);
  text-shadow: 0 3px 0 #000, 0 0 30px rgba(255, 190, 90, 0.5);
  animation: chain-in 0.6s 0.5s var(--ease-out) both;
}
.m-laststand h2 {
  color: #ffb38a;
  font-size: 2rem;
}
.m-laststand {
  pointer-events: none;
}
.m-laststand p {
  margin: 0;
  font-style: italic;
  color: var(--parchment);
}
.m-reconnect {
  background: rgba(4, 3, 2, 0.75);
}

.m-result-wrap {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 16px) 16px calc(var(--safe-bottom) + 16px);
  background: radial-gradient(ellipse at 50% 35%, rgba(24, 16, 9, 0.9), rgba(4, 3, 2, 0.97));
  animation: fade-in 0.5s ease both;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.result {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: chain-in 0.6s var(--ease-out) both;
}
.res-kicker {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.24em;
  font-size: 0.78rem;
  color: var(--gold);
}
.res-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 2.3rem;
  letter-spacing: 0.12em;
  line-height: 1.05;
  text-shadow: 0 3px 0 #000, 0 0 30px rgba(255, 200, 100, 0.55);
  color: var(--gold-bright);
}
.result.defeat .res-title {
  font-size: 1.55rem;
  color: #c9c3b6;
  text-shadow: 0 3px 0 #000, 0 0 20px rgba(120, 140, 170, 0.4);
}
.res-sub {
  margin: 0;
  font-style: italic;
  color: var(--parchment);
}
.res-reason {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.res-stats {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 6px 0;
}
.res-stat {
  display: flex;
  flex-direction: column;
  padding: 8px 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(143, 95, 44, 0.35);
}
.res-stat span {
  font-family: var(--font-display);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.res-stat strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--parchment);
}
.res-xp {
  width: 100%;
}
.res-xp-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-soft);
}
.res-xp-row strong {
  color: var(--gold-bright);
}
.res-xp .xpbar {
  width: 100%;
  margin: 4px 0;
}
.res-level,
.res-unlocks,
.res-offline {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin: 0;
}
.res-levelup {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}
.res-actions {
  width: 100%;
  margin-top: 6px;
}
.res-actions .btn-crest {
  min-height: 60px;
}
.res-ask {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  color: var(--parchment);
}
.res-ask-btns {
  display: flex;
  gap: 8px;
}
.res-ask-btns .btn {
  flex: 1;
}
.res-wait {
  color: var(--text-soft);
  font-style: italic;
}
.res-hall {
  width: 100%;
}
.res-series {
  width: 100%;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}
.res-series-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--gold-bright);
}

/* ------------------------------------------------------------------ Tutorial */

.tut-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tut-who {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.tut-who strong {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}
.tut-chapter {
  font-size: 0.78rem;
  color: var(--text-dim);
}
.tut-progress {
  display: flex;
  gap: 4px;
  justify-content: center;
}
.tut-progress i {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: #2a2d32;
}
.tut-progress i.on {
  background: var(--gold);
}
.tut-speech {
  padding: 10px 14px;
}
.tut-line {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-align: center;
}
.tut-task {
  margin: 4px 0 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.tut-tray {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.tut-tray canvas {
  touch-action: none;
  cursor: grab;
}
.tut-tray canvas.lifted {
  transform: scale(1.12);
  filter: drop-shadow(0 0 14px rgba(255, 210, 120, 0.7));
}
.tut-traytext {
  font-size: 0.8rem;
  color: var(--text-soft);
  font-style: italic;
  max-width: 150px;
}
.tut-feedback {
  min-height: 1.4em;
  text-align: center;
}
.tut-ok {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}
.tut-fail {
  margin: 0;
  color: #f0a58a;
}
.tut-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.tut-final {
  margin: auto;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.tut-final-ic {
  color: var(--gold);
  filter: drop-shadow(0 0 20px rgba(255, 200, 100, 0.5));
}
.tut-final h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: 0.12em;
  color: var(--gold-bright);
}

/* Replay */
.rp-top {
  justify-content: space-between;
}
.rp-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.16em;
  font-size: 1rem;
  color: var(--gold-bright);
}
.rp-houses {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--parchment);
}
.rp-house {
  display: flex;
  align-items: center;
  gap: 6px;
}
.rp-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.rp-counter {
  font-family: var(--font-display);
  font-size: 0.8rem;
  color: var(--text-soft);
  min-width: 90px;
}
.rp-speeds {
  justify-content: center;
}
.rp-speeds .chip {
  min-height: 34px;
  padding: 4px 12px;
}

/* ------------------------------------------------------------------ Größere Bildschirme */

@media (min-width: 720px) {
  #screens {
    padding-top: calc(var(--safe-top) + 28px);
  }
  .screen.match,
  .overlay-screen {
    max-width: 560px;
    margin: 0 auto;
  }
}
@media (max-height: 700px) {
  .m-now-stage {
    width: 72px;
    height: 72px;
  }
  .m-player {
    min-height: 44px;
  }
  .m-info {
    display: none;
  }
}

.hall-head {
  position: relative;
}
.hall-head::before {
  content: "";
  position: absolute;
  inset: -10px -20px -6px;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 55%, rgba(8, 6, 4, 0.72), rgba(8, 6, 4, 0.35) 55%, transparent 75%);
  pointer-events: none;
}
.wt-row .btn-stack strong {
  font-size: 0.68rem;
  letter-spacing: 0.06em;
}
