/* Siedler von Lynx – Holz, Pergament, Meer. */

:root {
  --wood-1: #7a4e27;
  --wood-2: #5a3a1c;
  --wood-3: #3e2712;
  --wood-hi: #a77446;
  --parch: #f5e9cc;
  --parch-2: #ead9b0;
  --parch-edge: #c9ad76;
  --ink: #3a2a18;
  --ink-soft: #6e5a40;
  --accent: #c9302c;
  --accent-dark: #8e1d1a;
  --gold: #e3b341;
  --sea: #1f6a99;
  --ok: #3f8a3a;
  --radius: 12px;
  --font-title: 'Cinzel', Georgia, serif;
  --font: 'Alegreya Sans', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  font-size: 16px;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 220, 160, .12), transparent 60%),
    repeating-linear-gradient(90deg, rgba(0,0,0,.06) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(90deg, #3b2614 0, #46301a 60px, #3b2614 120px);
  background-color: #3b2614;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-title); margin: 0 0 .6em; letter-spacing: .02em; }
h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); color: var(--parch); text-shadow: 0 2px 0 rgba(0,0,0,.5); }
h2 { font-size: 1.3rem; color: var(--parch); margin-top: 1.6em; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.parchment h1, .parchment h2, .parchment h3, .parchment h4, .modal h2 { color: var(--ink); text-shadow: none; }
small { font-size: .82em; }
code { background: rgba(0,0,0,.08); padding: .1em .35em; border-radius: 4px; }
.hint { color: var(--ink-soft); font-size: .92rem; }
.muted { color: var(--ink-soft); }
.loading { color: var(--parch); padding: 3rem; text-align: center; font-family: var(--font-title); }

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

.wood {
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), rgba(0,0,0,.18)),
    repeating-linear-gradient(92deg, rgba(0,0,0,.08) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(88deg, rgba(255,230,190,.06) 0 3px, transparent 3px 23px),
    linear-gradient(90deg, var(--wood-1), var(--wood-2) 40%, var(--wood-1) 70%, var(--wood-2));
  color: var(--parch);
  border: 1px solid var(--wood-3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), inset 0 -2px 0 rgba(0,0,0,.25), 0 3px 10px rgba(0,0,0,.4);
}
.parchment {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255,255,255,.5), transparent 50%),
    radial-gradient(ellipse at 90% 100%, rgba(160,110,40,.18), transparent 60%),
    linear-gradient(180deg, var(--parch), var(--parch-2));
  border: 1px solid var(--parch-edge);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(0,0,0,.35), inset 0 0 30px rgba(160,110,40,.15);
  color: var(--ink);
}
.panel { padding: 1.1rem 1.2rem; border-radius: var(--radius); }

/* ---------------------------------------------------------------- Knöpfe & Formulare */

.btn {
  font-family: var(--font);
  font-weight: 700;
  font-size: .98rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .55em 1.05em;
  border-radius: 10px;
  border: 1px solid #6b4a24;
  color: var(--ink);
  background: linear-gradient(180deg, #fbf1d8, #e3cc98);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 0 #8a6534, 0 3px 6px rgba(0,0,0,.25);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, filter .15s, box-shadow .08s;
  user-select: none;
}
.btn:hover:not(:disabled) { filter: brightness(1.05); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 0 0 #8a6534, 0 1px 3px rgba(0,0,0,.25); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.btn.primary { color: #fff; background: linear-gradient(180deg, #e0463f, var(--accent)); border-color: var(--accent-dark); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 0 var(--accent-dark), 0 3px 6px rgba(0,0,0,.3); text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn.danger { color: #fff; background: linear-gradient(180deg, #8f3b2e, #6e2418); border-color: #4a160e; box-shadow: 0 2px 0 #4a160e; }
.btn.ghost { background: rgba(255,248,230,.35); box-shadow: none; border-color: rgba(107,74,36,.5); }
.wood .btn.ghost { color: var(--parch); background: rgba(0,0,0,.15); border-color: rgba(255,230,190,.3); }
.btn.small { padding: .32em .7em; font-size: .88rem; border-radius: 8px; }
.btn.tiny { padding: .18em .5em; font-size: .78rem; border-radius: 6px; box-shadow: 0 1px 0 #8a6534; }
.btn.big { padding: .7em 1.4em; font-size: 1.08rem; }
.btn.huge { padding: .75em 2em; font-size: 1.3rem; border-radius: 14px; }

input, select {
  font: inherit;
  padding: .5em .65em;
  border-radius: 8px;
  border: 1px solid var(--parch-edge);
  background: #fffaf0;
  color: var(--ink);
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
input:disabled, select:disabled { background: rgba(255,255,255,.4); color: var(--ink-soft); }
label { display: block; font-weight: 700; font-size: .9rem; color: var(--ink-soft); margin-bottom: .8rem; }
label > input, label > select, label > .row { margin-top: .25rem; }
label.check { display: flex; gap: .55em; align-items: center; font-weight: 500; color: var(--ink); }
label.check input { width: auto; accent-color: var(--accent); transform: scale(1.15); }
.row { display: flex; gap: .5rem; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: .08em .5em; border-radius: 99px; background: rgba(58,42,24,.12); color: var(--ink-soft); vertical-align: middle; letter-spacing: .02em; }
.tag.warn { background: #f3d0b4; color: #8a3a12; }
.wood .tag { background: rgba(255,240,210,.18); color: var(--parch); }

/* ---------------------------------------------------------------- Navigation & Seiten */

.topnav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .55rem clamp(1rem, 3vw, 2rem); position: sticky; top: 0; z-index: 20; border-width: 0 0 1px; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-title); font-weight: 800; font-size: 1.3rem; color: var(--parch); text-shadow: 0 2px 0 rgba(0,0,0,.45); }
.logo small { font-size: .62em; opacity: .8; font-weight: 600; }
.logo-hex { width: 30px; height: 34px; background: linear-gradient(160deg, #f0cf60, #c99a24); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); position: relative; filter: drop-shadow(0 2px 0 rgba(0,0,0,.4)); }
.logo-hex::after { content: ''; position: absolute; inset: 9px 8px 7px; background: var(--accent); clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); }
.logo-hex.big { width: 64px; height: 72px; }
.logo-hex.big::after { inset: 20px 17px 15px; }
.nav-links { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { text-decoration: none; padding: .4em .8em; border-radius: 8px; font-weight: 700; color: var(--parch); opacity: .85; }
.nav-links a:hover { background: rgba(0,0,0,.15); opacity: 1; }
.nav-links a.on { background: rgba(0,0,0,.25); opacity: 1; box-shadow: inset 0 2px 4px rgba(0,0,0,.3); }
.page { max-width: 1100px; margin: 0 auto; padding: 1.5rem 16px 4rem; }
.games-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.games-head h1 { margin: 0; }
.games-head select { width: auto; }

/* Anmeldung */
.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(ellipse at center, #3f9bc9 0%, #1a5f8f 60%, #0f3f60 100%); }
.login-card { width: min(420px, 100%); padding: 1.8rem; }
.login-logo { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-bottom: 1rem; }
.login-logo h1 { color: var(--ink); text-shadow: none; margin: 0; }
.login-card form .btn { width: 100%; margin-top: .4rem; }
form.mode-login .reg-only { display: none; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1rem; border-bottom: 2px solid var(--parch-edge); }
.tabs button { flex: 1; font: inherit; font-weight: 800; padding: .5em; border: 0; background: none; color: var(--ink-soft); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }

/* Spieleliste */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.game-card { display: flex; flex-direction: column; gap: .6rem; padding: 1rem 1.1rem; text-decoration: none; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--parch), var(--parch-2)); border: 1px solid var(--parch-edge); box-shadow: 0 4px 12px rgba(0,0,0,.35); transition: transform .12s; }
.game-card:hover { transform: translateY(-3px); }
.game-card.running { border-left: 6px solid var(--ok); }
.game-card.lobby { border-left: 6px solid var(--gold); }
.gc-title { font-family: var(--font-title); font-weight: 800; font-size: 1.1rem; }
.gc-seats { display: flex; flex-wrap: wrap; gap: .3rem; }
.mini-seat { font-size: .82rem; font-weight: 700; padding: .12em .55em .12em .45em; border-radius: 99px; background: #fff8e6; border: 1px solid var(--parch-edge); border-left: 6px solid var(--pc); }
.mini-seat.free { color: var(--ink-soft); border-left-color: transparent; border-style: dashed; }
.gc-meta { font-size: .88rem; color: var(--ink-soft); }
.game-card .btn { align-self: flex-start; }
.empty { padding: 2rem; text-align: center; }
.recent-list { padding: .3rem 0; }
.recent-row { display: grid; grid-template-columns: 1.2fr 2fr auto; gap: 1rem; padding: .55rem 1.1rem; text-decoration: none; border-bottom: 1px solid rgba(160,120,60,.25); }
.recent-row:last-child { border-bottom: 0; }
.recent-row:hover { background: rgba(255,255,255,.35); }

/* Rangliste */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 170px)); justify-content: center; align-items: end; gap: .6rem; margin: 1rem 0 1.4rem; }
.podium-step { text-align: center; color: var(--parch); }
.podium-name a { font-family: var(--font-title); font-weight: 800; text-decoration: none; text-shadow: 0 2px 0 rgba(0,0,0,.5); font-size: 1.05rem; }
.podium-rating { font-size: .9rem; opacity: .85; margin-bottom: .3rem; }
.podium-block { font-family: var(--font-title); font-size: 2rem; font-weight: 800; border-radius: 10px 10px 0 0; color: #3a2a18;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 4px 10px rgba(0,0,0,.4); display: grid; place-items: center; }
.p1 .podium-block { height: 110px; background: linear-gradient(180deg, #ffe08a, #d9a520); }
.p2 .podium-block { height: 80px; background: linear-gradient(180deg, #f1f1f1, #b5b8bd); }
.p3 .podium-block { height: 60px; background: linear-gradient(180deg, #f2b98a, #b46f3b); }
.rank-table { width: 100%; border-collapse: collapse; }
.rank-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); padding: .4rem .5rem; border-bottom: 2px solid var(--parch-edge); }
.rank-table td { padding: .5rem; border-bottom: 1px solid rgba(160,120,60,.22); }
.rank-table tr.me td { background: rgba(227,179,65,.22); }
.rank-table a { font-weight: 700; text-decoration: none; }
.voided { opacity: .5; }
.match-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; padding: .5rem 0; border-bottom: 1px solid rgba(160,120,60,.22); }
.match-row:last-child { border-bottom: 0; }
.match-row.voided { text-decoration: line-through; }
.mres { margin-right: .9rem; white-space: nowrap; }
.delta { font-weight: 800; font-size: .85rem; margin-left: .2em; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--accent); }
.profile-grid, .admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1rem; align-items: start; }
.admin-grid .wide { grid-column: 1 / -1; }
.adjust-form { display: grid; grid-template-columns: 1fr 1fr auto 1fr; gap: .4rem; align-items: center; }
.adjust-form input[name=reason] { grid-column: 1 / 4; }
.adj-list { padding-left: 1.1rem; font-size: .92rem; }
.adj-list li { margin: .3rem 0; }
.admin-match { display: flex; align-items: center; gap: .5rem; }
.admin-match .match-row { flex: 1; }
.pw-show { font-size: 1.4rem; text-align: center; }

/* ---------------------------------------------------------------- Lobby eines Spiels */

.lobby-room { max-width: 1200px; margin: 0 auto; padding: 1rem 16px 3rem; }
.lobby-head { display: flex; align-items: center; gap: 1rem; padding: .8rem 1.2rem; margin-bottom: 1rem; flex-wrap: wrap; }
.lobby-head h1, .title-input { flex: 1; margin: 0; font-family: var(--font-title); font-size: 1.5rem; font-weight: 800; color: var(--ink); text-shadow: none; min-width: 180px; }
.title-input { background: transparent; border-color: transparent; }
.title-input:hover, .title-input:focus { background: #fffaf0; border-color: var(--parch-edge); }
.back { text-decoration: none; font-weight: 800; color: var(--ink-soft); }
.lobby-buttons { display: flex; gap: .5rem; flex-wrap: wrap; }
.lobby-grid { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; grid-template-rows: auto 1fr; gap: 1rem; }
.seats { border-radius: var(--radius); display: flex; flex-direction: column; gap: .6rem; }
.seat { display: flex; align-items: center; gap: .7rem; padding: .65rem .8rem; border-radius: 10px; background: linear-gradient(180deg, var(--parch), var(--parch-2)); color: var(--ink);
  border-left: 8px solid var(--pc); box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.seat.empty { border: 2px dashed rgba(255,230,190,.35); background: rgba(0,0,0,.18); color: var(--parch); flex-wrap: wrap; box-shadow: none; }
.seat-name { flex: 1; font-weight: 800; font-size: 1.05rem; }
.seat-name small { display: block; font-weight: 500; color: var(--ink-soft); }
.seat.empty .seat-name { opacity: .7; }
.seats .hint { color: rgba(255,240,210,.75); margin: .3rem 0 0; }
.settings { grid-row: span 2; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 .8rem; }
.map-preview { margin-top: 1rem; }
.map-preview-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.map-preview-head h3 { margin: 0; }
.map-preview .board-svg { width: 100%; max-height: 420px; border-radius: 10px; margin: .5rem 0 .2rem; display: block; }
.map-surprise { margin-top: .6rem; padding: 2rem 1rem; text-align: center; border-radius: 10px; color: #e8f4fb; background: radial-gradient(ellipse, #3f9bc9, #1a5f8f); font-weight: 700; }
.lobby-chat { display: flex; flex-direction: column; min-height: 220px; }
.chat-list { flex: 1; overflow-y: auto; max-height: 260px; font-size: .95rem; }
.chat-line { padding: .15rem 0; }
.chat-line.system { color: var(--ink-soft); font-style: italic; }
.chat-form { display: flex; gap: .4rem; margin-top: .5rem; }

/* ---------------------------------------------------------------- Spiel */

body.in-game { overflow: hidden; }
.game {
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas: "top top" "board side" "dock side";
}
.game-top { grid-area: top; display: flex; align-items: center; gap: .8rem; padding: .45rem .8rem; border-width: 0 0 1px; z-index: 3; }
.game-top .back { color: var(--parch); font-size: 1.4rem; padding: 0 .3rem; }
.banner { flex: 1; display: flex; align-items: center; justify-content: center; gap: .8rem; font-family: var(--font-title); font-weight: 800; font-size: clamp(.95rem, 2vw, 1.2rem); text-shadow: 0 2px 0 rgba(0,0,0,.45); text-align: center; min-height: 2.2em; }
.banner .pname { text-shadow: none; }
.banner.urgent > span:first-child { background: linear-gradient(180deg, #f8e2a6, var(--gold)); color: var(--ink); text-shadow: none; padding: .25em 1em; border-radius: 99px; box-shadow: 0 0 0 3px rgba(255,220,120,.35), 0 0 18px rgba(255,210,100,.6); animation: pulse 1.6s infinite; }
.banner .btn { font-family: var(--font); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,220,120,.15), 0 0 26px rgba(255,210,100,.8); } }
.clock { font-family: var(--font); font-size: .95rem; }
.clock.low { color: #ffb4a8; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .4; } }

.board-wrap { grid-area: board; position: relative; overflow: hidden; background: radial-gradient(ellipse at center, #3f9bc9 0%, #1a5f8f 70%, #134a70 100%); }
.board-svg { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.board-svg .waves { animation: drift 30s linear infinite; }
@keyframes drift { to { transform: translateX(80px); } }
.token-num { font-family: var(--font-title); font-weight: 800; font-size: 17px; text-anchor: middle; fill: #2a2018; }
.token-num.red { fill: #b3261e; }
.token.dim { opacity: .45; }
.port-ratio { font-family: var(--font); font-weight: 800; font-size: 10px; text-anchor: middle; fill: #3a2a18; }
.port-ratio.big { font-size: 13px; }
.tile.produce use { animation: produce 1.8s ease-out; }
@keyframes produce { 0%, 100% { filter: none; } 20%, 60% { filter: brightness(1.35) drop-shadow(0 0 8px #fff3b0); } }
@keyframes arrive { 0% { opacity: 0; } 40% { opacity: 1; filter: drop-shadow(0 0 10px #fff); } 100% { filter: none; } }
.building.recent, .road.recent { filter: drop-shadow(0 0 4px rgba(255,255,255,.85)); }
.robber { filter: drop-shadow(0 3px 3px rgba(0,0,0,.5)); }

/* Neu gebaute Figuren fallen aufs Brett, Straßen wachsen, der Räuber springt. */
.drop { animation: drop .75s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes drop {
  0% { transform: translateY(-70px) scale(1.5); opacity: 0; }
  55% { transform: translateY(0) scale(.92, 1.08); opacity: 1; }
  75% { transform: translateY(-6px) scale(1.04, .96); }
  100% { transform: none; }
}
.ring { fill: none; stroke: #fff6c8; stroke-width: 3; animation: ring 1.1s ease-out .35s both; }
@keyframes ring { from { r: 8px; opacity: 1; stroke-width: 5; } to { r: 38px; opacity: 0; stroke-width: 1; } }
.grow { animation: grow .55s cubic-bezier(.3,1.4,.5,1) both; }
@keyframes grow { 0% { transform: scaleX(0) translateY(-20px); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
.robber .hop { animation: hop .9s cubic-bezier(.45,0,.3,1) both; }
@keyframes hop {
  0% { transform: translate(var(--dx), var(--dy)); }
  50% { transform: translate(calc(var(--dx) * .5), calc(var(--dy) * .5 - 60px)) scale(1.15); }
  85% { transform: translate(0, 0) scale(1.05, .9); }
  100% { transform: none; }
}

/* Effekt-Ebene über allem */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.dice-stage { position: fixed; display: flex; gap: 14px; transform: translate(-50%, -50%); }
.bigdie { width: 78px; height: 78px; margin: 0 -24px; filter: drop-shadow(0 8px 6px rgba(0,0,0,.45)); }
.bigdie .die { width: 100%; height: 100%; }
.dice-stage-sum { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 6px); font-family: var(--font-title); font-weight: 800; font-size: 2.6rem; color: #fff; text-shadow: 0 3px 6px rgba(0,0,0,.7); animation: popin .35s cubic-bezier(.3,1.6,.5,1); }
.dice-stage-sum.seven { color: #ffb4a8; }
.dice-stage.landed .bigdie .die rect { stroke: var(--gold); stroke-width: 3; }
@keyframes popin { from { transform: translate(-50%, 6px) scale(.2); opacity: 0; } }
.fly-card { position: fixed; width: 34px; height: 46px; border-radius: 5px; display: grid; place-items: center;
  background: linear-gradient(180deg, #fffaf0, var(--rb, #eee)); border: 2px solid var(--rc, #8a6a3a); box-shadow: 0 6px 12px rgba(0,0,0,.45); will-change: transform; }
.fly-card.back.res { background: repeating-linear-gradient(45deg, #b5874a 0 5px, #a3763c 5px 10px); border-color: #5a3a1c; }
.fly-card.back.dev { background: linear-gradient(135deg, #6a4aa8, #3b2a6e); border-color: #22183f; }
.announcer { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: .3rem; pointer-events: none; width: max-content; max-width: 92%; }
.announce { background: rgba(250,240,215,.96); color: var(--ink); padding: .35rem .9rem .35rem .7rem; border-radius: 99px; border-left: 7px solid var(--pc); box-shadow: 0 4px 12px rgba(0,0,0,.4); font-size: .95rem; animation: slideup .3s cubic-bezier(.3,1.4,.5,1); transition: opacity .4s, transform .4s; display: flex; align-items: center; gap: .3em; }
.announce.out { opacity: 0; transform: translateY(8px); }
@keyframes slideup { from { opacity: 0; transform: translateY(14px) scale(.9); } }
.dev-reveal { position: fixed; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: .5rem; }
.dev-reveal-card { width: 170px; padding: 1rem .8rem; border-radius: 14px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: .3rem;
  background: linear-gradient(180deg, #f3ecff, #c8b6ec); border: 3px solid #3b2a6e; color: #2a1f4a; box-shadow: 0 0 0 4px rgba(255,220,120,.6), 0 16px 40px rgba(0,0,0,.55); }
.dev-reveal-card b { font-family: var(--font-title); font-size: 1.25rem; }
.dev-reveal-card small { font-size: .82rem; line-height: 1.25; }
.dev-reveal-who { background: rgba(250,240,215,.96); padding: .25rem .8rem; border-radius: 99px; font-weight: 800; box-shadow: 0 3px 8px rgba(0,0,0,.4); }
@media (prefers-reduced-motion: reduce) {
  .drop, .grow, .ring, .robber .hop, .tile.produce use, .waves { animation: none !important; }
}

.spot-v { cursor: pointer; }
.spot-v .hit { fill: transparent; }
.spot-v .dot { fill: rgba(255,255,255,.85); stroke: #2a2018; stroke-width: 2; animation: spot 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.spot-v:hover .dot { fill: var(--gold); }
@keyframes spot { 50% { transform: scale(1.35); } }
.spot-edge { stroke: rgba(255,255,255,.75); stroke-width: 9; stroke-linecap: round; cursor: pointer; stroke-dasharray: 4 5; animation: dash 1s linear infinite; }
.spot-edge:hover { stroke: var(--gold); stroke-dasharray: none; stroke-width: 11; }
@keyframes dash { to { stroke-dashoffset: -18; } }
.spot-hex { fill: rgba(255,255,255,.08); stroke: #fff3b0; stroke-width: 3; stroke-dasharray: 8 6; cursor: pointer; animation: dash 1.4s linear infinite; }
.spot-hex:hover { fill: rgba(255,60,40,.25); stroke: #ff8a70; }

.dice-tray { position: absolute; left: 14px; top: 14px; display: flex; align-items: center; gap: .5rem; pointer-events: none; }
.dice { display: flex; gap: 6px; }
.die { width: 46px; height: 46px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.45)); }
.dice-sum { font-family: var(--font-title); font-weight: 800; font-size: 1.8rem; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.6); }
.dice-sum.seven { color: #ffb4a8; }
.bubbles { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; pointer-events: none; }
.bubble { background: var(--parch); padding: .4rem .8rem; border-radius: 12px 12px 2px 12px; box-shadow: 0 3px 8px rgba(0,0,0,.35); max-width: 260px; animation: fadein .3s; font-size: .92rem; }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } }

.side { grid-area: side; display: flex; flex-direction: column; gap: .6rem; padding: .6rem; overflow-y: auto; background: rgba(0,0,0,.25); border-left: 1px solid var(--wood-3); }
.players { display: flex; flex-direction: column; gap: .45rem; }
.pcard { position: relative; padding: .5rem .65rem; border-radius: 10px; background: linear-gradient(180deg, var(--parch), var(--parch-2)); border-left: 7px solid var(--pc); box-shadow: 0 2px 6px rgba(0,0,0,.35); transition: transform .2s, box-shadow .2s; }
.pcard.active { transform: translateX(-4px); box-shadow: 0 0 0 3px var(--gold), 0 4px 14px rgba(0,0,0,.45); }
.pcard.me .pcard-name::after { content: ' (du)'; font-weight: 500; color: var(--ink-soft); font-size: .85em; }
.pcard-head { display: flex; align-items: center; gap: .4rem; }
.pcard-name { font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp { font-family: var(--font-title); font-weight: 800; font-size: 1.45rem; line-height: 1; color: var(--ink); }
.vp small { font-size: .55em; color: var(--ink-soft); }
.pcard-stats { display: flex; flex-wrap: wrap; gap: .25rem .7rem; font-size: .88rem; margin-top: .25rem; align-items: center; color: var(--ink-soft); font-weight: 700; }
.pcard-stats .warn { color: var(--accent); }
.award { background: linear-gradient(180deg, #ffe7a0, var(--gold)); color: #4a3510; font-size: .72rem; font-weight: 800; padding: .08em .5em; border-radius: 99px; box-shadow: 0 1px 2px rgba(0,0,0,.25); }
.pcard .btn.tiny { margin-top: .35rem; }
.mini-card { display: inline-block; width: 12px; height: 16px; border-radius: 2px; margin-right: 3px; vertical-align: -2px; border: 1px solid rgba(0,0,0,.4); }
.mini-card.res { background: linear-gradient(135deg, #cfe3b8, #f1c8a8 50%, #f8e7a8); }
.mini-card.dev { background: linear-gradient(135deg, #6a4aa8, #3b2a6e); }
.mini-card.dev.big { width: 20px; height: 26px; border-radius: 3px; }
.pname { font-weight: 800; color: var(--ink); border-bottom: 3px solid var(--pc); }
.wood .pname, .banner .pname { color: inherit; }

.trade-panel { padding: .7rem .8rem; }
.trade-panel h4 { margin: 0 0 .4rem; font-size: .98rem; }
.trade-panel.incoming { box-shadow: 0 0 0 3px var(--gold), 0 4px 14px rgba(0,0,0,.45); animation: fadein .3s; }
.trade-panel.muted { opacity: .85; }
.trade-line { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; }
.trade-line > span:first-child { width: 80px; font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
.trade-resp { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .25rem 0; }
.trade-resp .no { color: var(--accent); font-size: .88rem; }
.trade-resp .dots { color: var(--ink-soft); font-size: .88rem; font-style: italic; }
.trade-panel .row { margin-top: .4rem; }
.cardchip { display: inline-flex; align-items: center; gap: 1px; vertical-align: middle; }
.cardchip b { font-size: .85em; }
.ico { display: inline-block; vertical-align: middle; flex-shrink: 0; }

.feed { flex: 1; display: flex; flex-direction: column; min-height: 220px; padding: .5rem .7rem; }
.feed .tabs { margin-bottom: .3rem; }
.feed-list { flex: 1; overflow-y: auto; font-size: .9rem; min-height: 120px; }
.log { padding: .14rem 0; line-height: 1.35; }
.log.turn { margin-top: .4rem; padding-top: .3rem; border-top: 1px dashed var(--parch-edge); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); font-weight: 800; }
.log.sys, .log.muted { color: var(--ink-soft); font-style: italic; }
.log.award { color: #7a5410; font-weight: 700; }
.log.win { font-weight: 800; font-size: 1.05rem; }
.log b.seven { color: var(--accent); }

.dock { grid-area: dock; display: flex; align-items: center; gap: 1rem; padding: .55rem .8rem; border-width: 1px 0 0; flex-wrap: wrap; justify-content: space-between; }
.hand { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; }
.rcards, .dcards { display: flex; gap: .35rem; }
.rcard {
  position: relative; width: 62px; height: 84px; border-radius: 8px;
  background: linear-gradient(180deg, #fffaf0 0%, var(--rb) 100%);
  border: 2px solid var(--rc);
  box-shadow: 0 3px 0 rgba(0,0,0,.25), 0 4px 8px rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--ink); font: inherit; padding: 0;
}
.rcard.none { opacity: .35; filter: grayscale(.6); }
.rcard .rname { font-size: .7rem; font-weight: 800; }
.rcard .count { position: absolute; top: -8px; right: -8px; min-width: 24px; height: 24px; border-radius: 12px; background: var(--rc); color: #fff; font-weight: 800; font-size: .9rem; display: grid; place-items: center; border: 2px solid #fffaf0; box-shadow: 0 1px 3px rgba(0,0,0,.4); }
.rcard.pick { cursor: pointer; }
.rcard.pick.sel { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--gold), 0 6px 12px rgba(0,0,0,.4); }
.dcard { position: relative; width: 70px; height: 84px; border-radius: 8px; border: 2px solid #3b2a6e; padding: 4px 2px; font: inherit; font-size: .68rem; font-weight: 800;
  background: linear-gradient(180deg, #efe6ff, #c8b6ec); color: #2a1f4a; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  box-shadow: 0 3px 0 rgba(0,0,0,.25), 0 4px 8px rgba(0,0,0,.35); cursor: default; }
.dcard.playable { cursor: pointer; box-shadow: 0 0 0 3px var(--gold), 0 4px 10px rgba(0,0,0,.4); }
.dcard.playable:hover { transform: translateY(-4px); }
.dcard:disabled { opacity: .8; }
.dcard .count { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; border-radius: 11px; background: #3b2a6e; color: #fff; display: grid; place-items: center; font-size: .8rem; border: 2px solid #fff; }
.spectator { font-weight: 700; opacity: .85; }
.actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
.build-row, .turn-row { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; }
.btn.build { flex-direction: row; padding: .35em .7em; text-align: left; }
.btn.build span { display: flex; flex-direction: column; line-height: 1.1; }
.btn.build small { font-weight: 500; font-size: .72rem; color: var(--ink-soft); }
.btn.build.on { background: linear-gradient(180deg, #ffe7a0, var(--gold)); box-shadow: 0 0 0 3px rgba(255,220,120,.6), 0 2px 0 #8a6534; }
.btn.roll { animation: pulse 1.6s infinite; }
.wait { font-weight: 700; opacity: .8; font-style: italic; }
body.offline .game-top::after { content: 'Verbindung verloren – verbinde neu…'; position: fixed; left: 50%; top: 60px; transform: translateX(-50%); background: var(--accent); color: #fff; padding: .4rem 1rem; border-radius: 99px; font-weight: 800; z-index: 50; }

/* ---------------------------------------------------------------- Dialoge */

.modal-wrap { position: fixed; inset: 0; background: rgba(20,12,4,.55); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fadein .15s; backdrop-filter: blur(2px); }
.modal { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 1.3rem 1.4rem; }
.modal.trade { width: min(640px, 100%); }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.res-pick { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin: .8rem 0; }
.steppers { display: flex; flex-direction: column; gap: .35rem; }
.stepper { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem; border-radius: 8px; background: linear-gradient(90deg, var(--rb), transparent); border-left: 4px solid var(--rc); }
.stepper small { color: var(--ink-soft); font-size: .78rem; }
.stepper small.port { color: var(--ok); font-weight: 800; }
.stepper-ctl { display: flex; align-items: center; gap: .3rem; }
.stepper-ctl button { width: 30px; height: 30px; border-radius: 50%; border: 1px solid #6b4a24; background: #fff8e6; font-size: 1.1rem; font-weight: 800; cursor: pointer; color: var(--ink); }
.stepper-ctl b { min-width: 22px; text-align: center; font-size: 1.1rem; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.targets-row { margin-top: .8rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-weight: 700; color: var(--ink-soft); }
.targets { display: flex; gap: .8rem; flex-wrap: wrap; }
.targets label { margin: 0; }
.trade-buttons { display: flex; gap: .5rem; justify-content: flex-end; margin-top: .9rem; flex-wrap: wrap; }
.cost-row { display: flex; align-items: center; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid rgba(160,120,60,.25); }
.cost-row > span:nth-child(2) { flex: 1; font-weight: 700; }
.gameover { text-align: center; }
.trophy { font-size: 4rem; animation: arrive 1s; }
.standings { margin: .6rem auto; border-collapse: collapse; }
.standings td { padding: .4rem .7rem; text-align: left; }
.standings tr.win td { background: rgba(227,179,65,.3); font-weight: 800; }

#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: .4rem; z-index: 200; align-items: center; pointer-events: none; }
.toast { background: var(--wood-2); color: var(--parch); padding: .55rem 1.1rem; border-radius: 99px; font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.4); transition: opacity .4s, transform .4s; animation: fadein .2s; }
.toast.error { background: var(--accent-dark); }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ---------------------------------------------------------------- Handy & Tablet */

@media (max-width: 900px) {
  .lobby-grid { grid-template-columns: 1fr; }
  .settings { grid-row: auto; }
  body.in-game { overflow: auto; }
  .game { height: auto; min-height: 100dvh; display: flex; flex-direction: column; }
  .side { display: contents; }
  .game-top { order: 1; position: sticky; top: 0; }
  .board-wrap { order: 2; height: min(78vw, 58dvh); flex: none; }
  #tradebox { order: 3; padding: 0 8px; }
  #tradebox:empty { display: none; }
  .dock { order: 4; position: sticky; bottom: 0; z-index: 4; padding: .45rem .5rem calc(.45rem + env(safe-area-inset-bottom)); gap: .5rem; }
  .players { order: 5; flex-direction: row; overflow-x: auto; padding: 8px; gap: .5rem; }
  .pcard { min-width: 200px; }
  .pcard.active { transform: translateY(-2px); }
  .feed { order: 6; margin: 0 8px 8px; min-height: 260px; max-height: 50dvh; }
  .hand { width: 100%; justify-content: center; gap: .4rem; }
  .rcard { width: 52px; height: 70px; }
  .rcard .ico { width: 32px; height: 32px; }
  .rcard .rname { font-size: .62rem; }
  .dcard { width: 58px; height: 70px; }
  .actions { width: 100%; align-items: stretch; }
  .build-row, .turn-row { justify-content: center; }
  .btn.build small { display: none; }
  .btn.huge { width: 100%; }
  .die { width: 38px; height: 38px; }
  .trade-cols { grid-template-columns: 1fr; }
  .adjust-form { grid-template-columns: 1fr 1fr; }
  .adjust-form input[name=reason] { grid-column: 1 / -1; }
  .recent-row { grid-template-columns: 1fr; gap: .1rem; }
}
@media (max-width: 480px) {
  .topnav { flex-direction: column; align-items: stretch; gap: .3rem; }
  .nav-links { justify-content: center; }
  .rcard { width: 48px; height: 64px; }
  .banner { font-size: .9rem; }
}
