/* ===== Archipel – Design ===== */
:root {
  --bg: #061423;
  --ink: #eaf6ff;
  --muted: #8db0c8;
  --line: rgba(255, 255, 255, .12);
  --card: rgba(12, 36, 62, .62);
  --card2: rgba(255, 255, 255, .055);
  --teal: #00e5c0;
  --cyan: #3ee0ff;
  --pink: #ff4d8d;
  --amber: #ffb703;
  --violet: #8b5cf6;
  --red: #ff5a5f;
  --green: #2ee59d;
  --armor: #5aa9ff;
  --wealth: #ffcf3f;
  --r: 22px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .65);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 600px at 8% -12%, rgba(0, 229, 192, .20), transparent 60%),
    radial-gradient(900px 520px at 108% 6%, rgba(139, 92, 246, .24), transparent 60%),
    radial-gradient(900px 600px at 50% 118%, rgba(255, 77, 141, .16), transparent 60%),
    linear-gradient(180deg, #061423, #08203a 55%, #061423);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::after {
  content: ""; position: fixed; inset: auto 0 0 0; height: 140px; pointer-events: none; z-index: -1; opacity: .5;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 140' preserveAspectRatio='none'%3E%3Cpath fill='%2300e5c0' fill-opacity='.08' d='M0 70c120-30 240-30 360 0s240 30 360 0 240-30 360 0 240 30 360 0v70H0z'/%3E%3Cpath fill='%233ee0ff' fill-opacity='.07' d='M0 100c120-25 240-25 360 0s240 25 360 0 240-25 360 0 240 25 360 0v40H0z'/%3E%3C/svg%3E") bottom/100% 100% no-repeat;
}
a { color: var(--teal); }
[hidden] { display: none !important; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 22px 16px 70px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mt { margin-top: 26px; }
.center { text-align: center; }
.pad-xl { padding: 60px 20px; }
.stack { display: grid; gap: 20px; align-content: start; }

h1, h2, h3, h4 { line-height: 1.12; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(30px, 5vw, 50px); font-weight: 900; }
h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 850; }
h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); font-weight: 800; }
h4 { font-size: 18px; font-weight: 800; }
.grad { background: linear-gradient(90deg, var(--teal), var(--cyan) 40%, var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 18px; color: #c9e2f2; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 10px 16px; background: rgba(6, 20, 35, .74); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.tb-mid, .tb-right { display: flex; align-items: center; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; letter-spacing: .2em; font-size: 15px; color: var(--ink); text-decoration: none; }
.brand .logo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px; font-size: 21px; letter-spacing: 0;
  background: linear-gradient(135deg, var(--teal), var(--violet)); box-shadow: 0 8px 24px -8px rgba(0, 229, 192, .8); }
.brand.big { font-size: 18px; margin-bottom: 26px; }
.brand.big .logo { width: 48px; height: 48px; font-size: 26px; border-radius: 16px; }
.me-chip { display: flex; align-items: center; gap: 8px; font-size: 14px; }

/* Cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head h3 { margin: 0; }

/* Buttons */
.btn { appearance: none; border: 0; border-radius: 999px; padding: 12px 22px; font: inherit; font-weight: 800; cursor: pointer; color: #04111f;
  background: var(--ink); transition: transform .12s, box-shadow .2s, opacity .2s, background .2s; display: inline-flex; align-items: center;
  gap: 8px; justify-content: center; text-decoration: none; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.btn.primary { background: linear-gradient(135deg, var(--teal), var(--cyan)); box-shadow: 0 12px 30px -12px rgba(0, 229, 192, .8); }
.btn.pink { background: linear-gradient(135deg, var(--pink), #ff8a5b); color: #fff; box-shadow: 0 12px 30px -12px rgba(255, 77, 141, .8); }
.btn.ghost { background: var(--card2); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, .1); }
.btn.danger { background: rgba(255, 90, 95, .14); color: #ffb3b5; border: 1px solid rgba(255, 90, 95, .4); }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn.big { padding: 16px 28px; font-size: 18px; width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card2);
  border: 1px solid var(--line); font-weight: 800; font-size: 13px; white-space: nowrap; }
.chip.armor { color: #bcdcff; border-color: rgba(90, 169, 255, .4); }
.chip.wealth { color: #ffe9a6; border-color: rgba(255, 207, 63, .4); }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 13px; background: var(--card2); }
.st-lobby { background: rgba(139, 92, 246, .25); color: #d9ccff; }
.st-running { background: rgba(0, 229, 192, .2); color: #8ff5e2; }
.st-results, .st-resolving { background: rgba(255, 183, 3, .2); color: #ffe199; }
.st-finished { background: rgba(255, 77, 141, .2); color: #ffb6cf; }

/* Island badge */
.isl { --c: #00e5c0; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 18px; flex: none; line-height: 1;
  background: radial-gradient(circle at 30% 28%, color-mix(in srgb, var(--c) 70%, white), var(--c) 70%);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 28%, transparent), 0 8px 22px -8px var(--c); }
.isl.sm { width: 26px; height: 26px; font-size: 14px; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 28%, transparent); }
.isl.lg { width: 60px; height: 60px; font-size: 32px; }
.isl.xl { width: 110px; height: 110px; font-size: 58px; margin-bottom: 18px; animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-3deg); } }

/* Forms */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 700; }
.field input, .field select, .namef input, .tname, .chat-form input {
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; width: 100%; min-width: 0; }
.field select option { background: #0b2236; }
.field input:focus, .field select:focus, .namef input:focus, .tname:focus, .chat-form input:focus, .code-input:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(0, 229, 192, .18); }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.names { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.namef { display: flex; align-items: center; gap: 10px; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; cursor: pointer; user-select: none; }
.switch input { width: 18px; height: 18px; accent-color: var(--pink); }
.alert { background: rgba(255, 90, 95, .14); border: 1px solid rgba(255, 90, 95, .4); color: #ffc9ca; padding: 12px 16px; border-radius: 14px; margin: 12px 0; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 4px; font-weight: 700; }
.checklist .ok { color: var(--green); } .checklist .no { color: var(--red); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; position: relative; overflow: hidden; }
.login-card { width: min(520px, 100%); padding: 34px; position: relative; z-index: 2; }
.code-input { width: 100%; text-align: center; font-family: var(--mono); font-size: clamp(28px, 8vw, 40px); font-weight: 800; letter-spacing: .25em;
  text-transform: uppercase; padding: 16px 10px; border-radius: 18px; background: rgba(0, 0, 0, .25); border: 2px solid var(--line); color: var(--ink); }
.code-input::placeholder { color: rgba(255, 255, 255, .2); }
.foot-link { position: relative; z-index: 2; margin-top: 18px; color: var(--muted); font-weight: 700; text-decoration: none; font-size: 14px; }
.floaters span { position: absolute; font-size: 54px; opacity: .55; filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .4)); animation: bob 6s ease-in-out infinite; z-index: 1; }
.floaters span:nth-child(1) { top: 10%; left: 8%; }
.floaters span:nth-child(2) { top: 18%; right: 10%; animation-delay: -1.5s; }
.floaters span:nth-child(3) { bottom: 16%; left: 12%; animation-delay: -3s; }
.floaters span:nth-child(4) { bottom: 10%; right: 14%; animation-delay: -2s; }
.floaters span:nth-child(5) { top: 48%; left: 3%; animation-delay: -4s; font-size: 40px; }
.rules-details { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.rules-details summary { cursor: pointer; font-weight: 800; }
.rules ol { padding-left: 22px; display: grid; gap: 6px; }
.rules-intro { color: #c9e2f2; }
.rules-note { font-size: 14px; color: var(--muted); background: var(--card2); border-radius: 14px; padding: 10px 14px; }

/* Dialog */
.dlg { border: 1px solid var(--line); border-radius: 24px; padding: 0; background: #0b2236; color: var(--ink); max-width: min(640px, calc(100% - 32px)); box-shadow: var(--shadow); }
.dlg::backdrop { background: rgba(3, 10, 20, .7); backdrop-filter: blur(4px); }
.dlg-body { padding: 26px; }

/* Timer */
.timer { position: relative; width: 48px; height: 48px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 4; }
.timer .trk { stroke: rgba(255, 255, 255, .12); }
.timer .prog { stroke: var(--teal); stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.warn .prog { stroke: var(--amber); }
.timer.crit .prog { stroke: var(--red); }
.timer.crit { animation: pulse 1s ease-in-out infinite; }
.timer-txt { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 900; font-size: 13px; font-variant-numeric: tabular-nums; }
.timer.lg { width: 150px; height: 150px; }
.timer.lg circle { stroke-width: 3; }
.timer.lg .timer-txt { font-size: 38px; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* Spiel-Layout */
.grid-play { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 920px) { .grid-play { grid-template-columns: minmax(0, 1fr); } }

.hero-card { text-align: center; padding: 40px 24px; }
.statrow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 24px 0; }
.stat { background: var(--card2); border: 1px solid var(--line); border-radius: 18px; padding: 16px; text-align: left; }
.stat .lbl { font-size: 13px; color: var(--muted); font-weight: 800; }
.stat b { display: block; font-size: 38px; font-weight: 900; line-height: 1.1; }
.stat.armor b { color: var(--armor); } .stat.wealth b { color: var(--wealth); }
.waiting { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: #c9e2f2; background: var(--card2); padding: 10px 18px; border-radius: 999px; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(0, 229, 192, .6); animation: ping 1.6s infinite; flex: none; }
@keyframes ping { 70% { box-shadow: 0 0 0 12px rgba(0, 229, 192, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 229, 192, 0); } }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--teal); animation: spin 1s linear infinite; margin: 0 auto 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Entscheidung */
.decide-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.decide-head h3 { margin-bottom: 4px; }
.mini-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.step { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.step-n { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; background: var(--card2); border: 1px solid var(--line); }
.alloc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.abox { border-radius: 18px; padding: 14px 16px; border: 1px solid var(--line); }
.abox span { font-size: 13px; font-weight: 800; color: var(--muted); display: block; }
.abox b { font-size: 46px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.abox.armor { background: linear-gradient(135deg, rgba(90, 169, 255, .22), rgba(90, 169, 255, .06)); }
.abox.armor b { color: var(--armor); }
.abox.wealth { background: linear-gradient(135deg, rgba(255, 207, 63, .2), rgba(255, 207, 63, .05)); text-align: right; }
.abox.wealth b { color: var(--wealth); }
.alloc-range { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; border-radius: 99px; outline: none; margin: 6px 0;
  background: linear-gradient(90deg, var(--armor) 0 var(--p, 50%), var(--wealth) var(--p, 50%) 100%); cursor: pointer; }
.alloc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 5px solid #0b2236; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.alloc-range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 5px solid #0b2236; box-shadow: 0 4px 16px rgba(0, 0, 0, .5); }
.alloc-range:disabled { opacity: .5; cursor: not-allowed; }
.pips { display: grid; grid-template-columns: repeat(10, 1fr); gap: 5px; margin: 10px 0; }
.pip { height: 10px; border-radius: 4px; background: var(--wealth); transition: background .2s; }
.pip.a { background: var(--armor); }
.preview { font-size: 14px; color: #c9e2f2; margin: 8px 0 0; }
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px; }
.tgt { appearance: none; text-align: left; font: inherit; color: var(--ink); cursor: pointer; display: grid; gap: 4px; justify-items: start;
  padding: 14px; border-radius: 18px; background: var(--card2); border: 2px solid var(--line); transition: border-color .15s, transform .12s, background .15s; }
.tgt:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(255, 255, 255, .3); }
.tgt.sel { border-color: var(--pink); background: rgba(255, 77, 141, .12); box-shadow: 0 10px 30px -14px var(--pink); }
.tgt.peace.sel { border-color: var(--teal); background: rgba(0, 229, 192, .1); box-shadow: 0 10px 30px -14px var(--teal); }
.tgt:disabled { cursor: not-allowed; opacity: .6; }
.tgt .tn { font-weight: 850; font-size: 16px; }
.feas { font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.feas.ok { color: var(--green); background: rgba(46, 229, 157, .12); }
.feas.no { color: #ff9a9d; background: rgba(255, 90, 95, .12); }
.hint { font-size: 14px; color: var(--muted); margin: 12px 0 0; }
.confirm-bar { border-top: 1px solid var(--line); padding-top: 18px; }
.save-state { text-align: center; font-size: 13px; color: var(--muted); margin-top: 10px; min-height: 20px; }
.decide.is-locked .step { opacity: .75; }

/* Tafel */
.board { display: grid; gap: 8px; }
.brow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 16px; background: var(--card2); }
.brow.me { outline: 2px solid rgba(0, 229, 192, .5); }
.brow .bname { font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; }
.brow .bname span.nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bbar { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .08); margin-top: 6px; overflow: hidden; }
.bbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--armor), var(--cyan)); border-radius: 4px; transition: width .4s; }
.barmor { font-size: 24px; font-weight: 900; color: var(--armor); font-variant-numeric: tabular-nums; text-align: right; }
.bstat { font-size: 12px; font-weight: 700; color: var(--muted); }
.bstat.ok { color: var(--green); }
.tag { font-size: 10px; font-weight: 900; letter-spacing: .1em; padding: 2px 7px; border-radius: 99px; background: var(--teal); color: #04111f; }
.odot { width: 8px; height: 8px; border-radius: 50%; background: #50667a; flex: none; }
.odot.on { background: var(--green); box-shadow: 0 0 8px var(--green); }

/* Ergebnisse */
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0 6px; }
.sum-box { border-radius: 20px; padding: 18px; border: 1px solid var(--line); }
.sum-box.wealth { background: linear-gradient(135deg, rgba(255, 207, 63, .18), rgba(255, 207, 63, .04)); }
.sum-box.armor { background: linear-gradient(135deg, rgba(90, 169, 255, .2), rgba(90, 169, 255, .04)); }
.sum-box .lbl { font-size: 13px; font-weight: 800; color: var(--muted); }
.flow { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 10px; font-variant-numeric: tabular-nums; }
.flow span { font-size: 22px; color: var(--muted); font-weight: 800; }
.flow .arr { font-size: 20px; }
.flow b { font-size: 44px; font-weight: 900; line-height: 1; }
.sum-box.wealth .flow b { color: var(--wealth); } .sum-box.armor .flow b { color: var(--armor); }
.parts { display: flex; flex-wrap: wrap; gap: 6px; }
.pt { font-size: 12.5px; font-weight: 800; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, .08); }
.pt.pos { color: var(--green); } .pt.neg { color: #ff9a9d; }
.atk-list { display: grid; gap: 10px; }
.atk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 14px 16px; border-radius: 16px; background: var(--card2); border-left: 5px solid var(--red); }
.atk.ok { border-left-color: var(--green); }
.atk-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.atk-res { font-weight: 900; text-align: right; }
.atk.ok .atk-res { color: var(--green); } .atk.fail .atk-res { color: #ff9a9d; }
.atk-math { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.atk-cost { text-align: right; font-size: 12.5px; color: var(--muted); }
.atk.me { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15); }
.peace-box { padding: 18px; border-radius: 16px; background: rgba(0, 229, 192, .08); border: 1px dashed rgba(0, 229, 192, .35); font-weight: 800; }

/* Tabellen */
.tbl-wrap { overflow-x: auto; margin: 0 -6px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px 6px; font-weight: 800; white-space: nowrap; }
.tbl td { padding: 10px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.tbl tr.me td { background: rgba(0, 229, 192, .07); }
.tcell { display: flex; align-items: center; gap: 8px; font-weight: 800; }
.code { font-family: var(--mono); font-weight: 800; font-size: 17px; letter-spacing: .08em; background: rgba(0, 0, 0, .25); padding: 4px 10px; border-radius: 10px; white-space: nowrap; }
.d-pos { color: var(--green); } .d-neg { color: #ff9a9d; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Final */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 26px 0; }
.pod { width: min(180px, 30%); text-align: center; }
.pod .blk { border-radius: 18px 18px 6px 6px; padding: 14px 8px; font-weight: 900; font-size: 30px; color: #04111f; }
.pod.p1 .blk { height: 150px; background: linear-gradient(180deg, #ffe066, #ffb703); }
.pod.p2 .blk { height: 110px; background: linear-gradient(180deg, #eef2f7, #a7b4c2); }
.pod.p3 .blk { height: 80px; background: linear-gradient(180deg, #ffc29a, #d9814a); }
.pod .pn { font-weight: 850; margin: 8px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .pw { font-size: 13px; color: var(--wealth); font-weight: 800; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .grid { stroke: rgba(255, 255, 255, .08); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; font-weight: 700; margin-top: 6px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
.reflect { margin-top: 26px; padding: 18px 20px; border-radius: 18px; background: rgba(139, 92, 246, .12); border: 1px solid rgba(139, 92, 246, .35); }
.reflect ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* Diplomatie */
.dip .locked { padding: 16px; border-radius: 16px; background: var(--card2); color: var(--muted); font-weight: 700; text-align: center; }
.dip-info { font-size: 13.5px; color: #c9e2f2; margin-bottom: 12px; }
.dip-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dtab { appearance: none; font: inherit; font-size: 13px; font-weight: 800; color: var(--ink); background: var(--card2); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 12px 4px 4px; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; position: relative; }
.dtab.active { background: rgba(0, 229, 192, .15); border-color: var(--teal); }
.dtab .dot { position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 8px var(--pink); }
.chat { height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 12px; background: rgba(0, 0, 0, .22); border-radius: 16px; }
.chat .empty { margin: auto; color: var(--muted); font-size: 13px; text-align: center; }
.msg { max-width: 82%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: rgba(255, 255, 255, .08); font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: linear-gradient(135deg, rgba(0, 229, 192, .28), rgba(62, 224, 255, .18)); }
.msg .meta { display: block; font-size: 10.5px; color: var(--muted); font-weight: 700; margin-top: 2px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form input { border-radius: 999px; padding: 10px 16px; }
.mlog { display: grid; gap: 6px; max-height: 420px; overflow-y: auto; }
.mlog .ml { font-size: 13.5px; padding: 8px 12px; border-radius: 12px; background: var(--card2); overflow-wrap: anywhere; }
.mlog .ml b { font-weight: 800; }

/* Admin */
.ctrl-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.ctrl-title h2 { margin: 6px 0 8px; }
.ctrl-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ctrl-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.grid-admin { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.grid-admin-list { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 980px) { .grid-admin, .grid-admin-list { grid-template-columns: minmax(0, 1fr); } }
.glist-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.glist-row:first-child { border-top: 0; }
.tname { padding: 6px 10px; font-weight: 800; max-width: 180px; }
.secret { filter: blur(7px); user-select: none; transition: filter .2s; }
body.reveal .secret { filter: none; user-select: auto; }
.draft { font-size: 12px; color: var(--muted); font-weight: 700; display: block; }

/* Beamer */
body.board-mode .wrap { max-width: none; padding: 2.4vw 3vw; }
.b-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; }
.b-head .brand { margin: 0; font-size: 1.6vw; }
.b-round { font-size: clamp(30px, 4.4vw, 80px); font-weight: 900; text-align: center; letter-spacing: -.03em; line-height: 1; }
.b-round small { display: block; font-size: .32em; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: 8px; }
.b-timer { justify-self: end; }
.timer.xl { width: clamp(110px, 11vw, 200px); height: clamp(110px, 11vw, 200px); }
.timer.xl circle { stroke-width: 3; }
.timer.xl .timer-txt { font-size: clamp(28px, 3vw, 56px); }
.b-join { text-align: center; margin: 18px auto 24px; font-size: clamp(16px, 1.5vw, 26px); color: #c9e2f2; }
.b-join b { color: var(--teal); font-family: var(--mono); }
.b-islands { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.6vw; }
.b-isl { text-align: center; padding: 2vw 1vw; }
.b-isl .isl { width: clamp(60px, 6vw, 110px); height: clamp(60px, 6vw, 110px); font-size: clamp(32px, 3.2vw, 60px); margin-bottom: 12px; }
.b-isl .nm { font-size: clamp(20px, 2vw, 36px); font-weight: 900; }
.b-isl .ar { font-size: clamp(50px, 6vw, 120px); font-weight: 900; color: var(--armor); line-height: 1; font-variant-numeric: tabular-nums; }
.b-isl .ar small { font-size: .3em; color: var(--muted); display: block; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px; }
.b-isl .st { margin-top: 12px; font-size: clamp(14px, 1.2vw, 20px); font-weight: 800; color: var(--muted); }
.b-isl .st.ok { color: var(--green); }
.b-isl .delta { font-size: clamp(16px, 1.6vw, 28px); font-weight: 900; }
.b-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2vw; margin-top: 2vw; }
body.board-mode .atk-who { font-size: clamp(16px, 1.5vw, 26px); }
body.board-mode .atk-res { font-size: clamp(16px, 1.5vw, 26px); }
body.board-mode .atk-math { font-size: clamp(13px, 1vw, 18px); }
@media (max-width: 900px) { .b-cols { grid-template-columns: minmax(0, 1fr); } .b-head { grid-template-columns: 1fr; text-align: center; } .b-timer, .b-head .brand { justify-self: center; } }

/* Toast / Netz */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: #2a0f1a; border: 1px solid rgba(255, 90, 95, .5); color: #ffd0d1;
  padding: 12px 20px; border-radius: 16px; font-weight: 700; z-index: 100; transition: transform .3s; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
.toast.ok { background: #0b2a24; border-color: rgba(46, 229, 157, .5); color: #c8ffe9; }
.toast.show { transform: translate(-50%, 0); }
.netbar { position: fixed; top: 0; left: 0; right: 0; z-index: 200; background: var(--amber); color: #2a1a00; text-align: center; font-weight: 800; padding: 6px 12px; font-size: 13px; }

/* Responsiv */
@media (max-width: 640px) {
  .hide-sm { display: none; }
  .topbar { padding: 8px 10px; gap: 6px; }
  .brand .logo { width: 32px; height: 32px; font-size: 18px; }
  .me-chip b { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .card { padding: 18px; border-radius: 18px; }
  .login-card { padding: 24px; }
  .row3, .names { grid-template-columns: minmax(0, 1fr); }
  .summary, .statrow { grid-template-columns: minmax(0, 1fr); }
  .abox b { font-size: 38px; }
  .step { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .step-n { width: 30px; height: 30px; border-radius: 10px; font-size: 14px; }
  .atk { grid-template-columns: minmax(0, 1fr); }
  .atk-res, .atk-cost { text-align: left; }
  .ctrl-head { flex-direction: column-reverse; align-items: flex-start; }
  .floaters span { font-size: 34px; }
}

/* Druck: Zugangskarten */
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000; }
  body::after { display: none; }
  body > *:not(#printCards) { display: none !important; }
  #printCards { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8mm; }
  .pcard { border: 2px dashed #333; border-radius: 6mm; padding: 8mm; break-inside: avoid; color: #000; text-align: center; }
  .pcard .pe { font-size: 34pt; }
  .pcard .pnm { font-size: 20pt; font-weight: 900; margin: 2mm 0; }
  .pcard .pc { font-family: var(--mono); font-size: 30pt; font-weight: 900; letter-spacing: .12em; margin: 3mm 0; }
  .pcard .pu { font-size: 10pt; color: #333; word-break: break-all; }
}

/* Namens-Auslosung */
.reveal-banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 20px; border-radius: var(--r);
  background: linear-gradient(135deg, rgba(0, 229, 192, .18), rgba(139, 92, 246, .22)); border: 1px solid rgba(255, 255, 255, .18);
  animation: pop .6s cubic-bezier(.2, 1.4, .4, 1); }
.reveal-banner b { display: block; font-size: clamp(26px, 5vw, 38px); font-weight: 900; letter-spacing: -.02em; line-height: 1.1; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

/* Wappen (images/<Name>.jpeg, Querformat mit weißem Hintergrund) */
.isl.crest { background: #fff; overflow: hidden; padding: 0; }
.isl.crest img { width: 100%; height: 100%; object-fit: cover; object-position: center; transform: scale(1.06); display: block; }
.isl.crest img[src^="images/web/"] { transform: none; } /* schon rund zugeschnitten */
.isl.crest.sm { box-shadow: 0 0 0 2px var(--c); }
.isl.crest.lg { width: 76px; height: 76px; }
.isl.xl, .isl.crest.xl { width: 170px; height: 170px; font-size: 86px; }
.isl.crest.xl { box-shadow: 0 0 0 5px var(--c), 0 18px 50px -12px var(--c); }
.reveal-banner .isl.crest.lg { width: 96px; height: 96px; box-shadow: 0 0 0 4px var(--c), 0 12px 30px -10px var(--c); }
.b-isl .isl, .b-isl .isl.crest { width: clamp(90px, 10vw, 180px); height: clamp(90px, 10vw, 180px); font-size: clamp(46px, 5vw, 90px); box-shadow: 0 0 0 4px var(--c), 0 14px 40px -12px var(--c); }
.pod .isl.lg { width: 92px; height: 92px; font-size: 46px; }
.pcard .pimg { width: 45mm; height: 45mm; object-fit: cover; border-radius: 50%; }

/* Inselvölker: (i)-Knopf und Beschreibung */
.ibtn { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 6px; border-radius: 50%; flex: none; vertical-align: middle;
  font: italic 800 12px/1 Georgia, "Times New Roman", serif; color: var(--ink); background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28);
  cursor: pointer; user-select: none; transition: background .15s, transform .12s; letter-spacing: 0; text-transform: none; }
.ibtn:hover, .ibtn:focus-visible { background: var(--teal); color: #04111f; outline: none; transform: scale(1.1); }
.ibtn::before { content: ""; position: absolute; inset: -10px; } /* größere Tippfläche */
.ibtn { position: relative; }
.reveal-banner b .ibtn, .b-isl .nm .ibtn { width: 28px; height: 28px; font-size: 17px; }
.isl-dlg { max-width: min(560px, calc(100% - 32px)); }
.isl-dlg .isl.xl { animation: none; margin: 0 auto 16px; }
.isl-dlg h2 { font-size: clamp(28px, 6vw, 40px); }
.isl-desc { font-size: 17px; line-height: 1.6; color: #d6ebf8; text-align: left; background: var(--card2); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 14px 0 18px; }
.isl-dlg { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow-y: auto; margin: auto; }
@media (max-width: 640px) {
  .isl-dlg .dlg-body { padding: 18px 16px; }
  .isl-dlg .isl.xl { width: 112px; height: 112px; font-size: 56px; margin-bottom: 10px; }
  .isl-dlg h2 { font-size: 28px; margin-bottom: 4px; }
  .isl-desc { font-size: 15.5px; line-height: 1.55; padding: 12px 14px; margin: 10px 0 14px; }
}

/* Kopfzeile auf schmalen Handys kompakt halten */
.tb-mid, .tb-right { min-width: 0; }
.me-chip { min-width: 0; }
@media (max-width: 640px) {
  .page-play .topbar .brand { display: none; }
  .topbar .chip { padding: 5px 10px; font-size: 12px; }
  .topbar .btn.sm { padding: 6px 10px; }
  .tb-right { gap: 6px; }
  .me-chip { gap: 5px; font-size: 13px; }
  .me-chip b { max-width: 84px; }
  .me-chip .ibtn { margin-left: 0; }
}
@media (max-width: 360px) { .me-chip b { display: none; } }
