/* ReyaMon Showdown – Hauptrunde, Ergebnis-Formular (Spiele), Tabelle, Brackets, Turnier-Logo */

.table-scroll { overflow-x: auto; }
.nowrap { white-space: nowrap; }
.tbd { font-style: italic; }
.match.ghost .score { color: var(--accent); }
.round-title.stage-title { color: var(--ink); font-weight: 700; border-top: 1px solid var(--line); padding-top: 10px; }

/* Tabelle */
table.standings .pts { color: var(--muted); font-weight: 600; }
table.standings .seed-tag { display: inline-block; margin-left: 4px; font-size: .66rem; padding: 0 4px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); vertical-align: middle; }
.last { font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.last.w { color: var(--good); } .last.l { color: var(--accent); }

/* Segment-Auswahl mit Radios (Ergebnis-Modus, MVP-Reiter) */
.seg label { display: inline-flex; align-items: center; padding: 5px 12px; font-size: .85rem; cursor: pointer; color: var(--muted); background: var(--panel); border-right: 1px solid var(--line); user-select: none; }
.seg label:last-child { border-right: 0; }
.seg label.on { background: var(--accent); color: #fff; }
.seg label input { display: none; }

/* Ergebnis-Formular */
.modal-box:has(.report-modal), .modal-box:has(.games-modal) { max-width: 980px; }
.report-form fieldset.game { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 10px; margin: 0 0 10px; }
.report-form fieldset.game legend { font-weight: 700; font-size: .9rem; padding: 0 6px; }
.game-top { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.game-top label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); }
.game-top label.grow { flex: 1 1 200px; }
.game-top input[type="number"] { width: 70px; }
.game-mons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.mons-side { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mon-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 6px; align-items: center; }
.mon-row select, .mon-row input:not([type]) , .mon-row input[list] { min-width: 0; width: 100%; padding: 4px 6px; font-size: .85rem; }
.mini-check, .mini-num { display: inline-flex; align-items: center; gap: 3px; font-size: .75rem; color: var(--muted); white-space: nowrap; }
.mini-num input { width: 46px; padding: 3px 4px; font-size: .85rem; }
.report-form[data-mode="quick"] .detail-only { display: none; }
.report-form:not([data-mode="quick"]):not([data-mode="detailed"]) .games-block { display: none; }
.report-form:not([data-mode="forfeit"]):not([data-mode="resultonly"]) .winner-only { display: none; }
.report-form:not([data-mode="forfeit"]) .forfeit-only { display: none; }
.report-form:not([data-mode="resultonly"]) .resultonly-only { display: none; }
.report-form:not([data-mode="ghost"]) .ghost-only { display: none; }
@media (max-width: 760px) { .game-mons { grid-template-columns: 1fr; } }

/* Spiel-Details */
.g-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 10px; }
.g-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.g-mons tr.bench td { color: var(--muted); opacity: .75; }
.g-mons td.ic { width: 40px; }
@media (max-width: 760px) { .g-sides { grid-template-columns: 1fr; } }

/* MVP */
.mvp-table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.mvp-table th.sortable:hover, .mvp-table th.sorted { color: var(--ink); }

/* Spielplan-Editor */
.code-sample { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: .8rem; margin: 0; white-space: pre-wrap; }
.sched-edit textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; width: 100%; }
.sched-edit table input { width: 100%; padding: 4px 6px; font-size: .85rem; }
.err-list { margin: 0 0 6px; padding-left: 18px; font-size: .85rem; }

/* Champion (Overview) */
.champ-panel { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.champ { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 10px; flex: 1 1 260px; min-width: 0; }
.champ.gold { background: linear-gradient(135deg, #f7d35c33, #f7d35c0d); border: 1px solid #e0b53c66; }
.champ.bronze { background: linear-gradient(135deg, #cd7f3226, #cd7f320a); border: 1px solid #cd7f3255; }
.champ .avatar.lg { width: 56px; height: 56px; flex: none; }
.champ-icon { font-size: 1.8rem; }

/* Brackets */
.bracket-panel { overflow: hidden; }
.bracket { display: flex; gap: 26px; overflow-x: auto; padding: 4px 2px 10px; }
.b-col { display: flex; flex-direction: column; min-width: 210px; flex: 1 0 210px; }
.b-col-title { font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; margin-bottom: 8px; }
.b-cells { display: flex; flex-direction: column; justify-content: space-around; flex: 1; gap: 12px; }
.b-match { position: relative; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.b-match.empty { visibility: hidden; height: 60px; }
.b-match.bye { opacity: .6; border-style: dashed; }
.b-match.done { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.b-cells .b-match::after { content: ""; position: absolute; right: -27px; top: 50%; width: 26px; border-top: 2px solid var(--line); }
.b-champ-col .b-cells .b-match::after, .b-col:nth-last-child(2) .b-cells .b-match::after { width: 26px; }
.b-label { font-size: .7rem; text-transform: uppercase; color: var(--muted); padding: 4px 8px 0; font-weight: 700; }
.b-side { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; gap: 6px; align-items: center; padding: 5px 8px; font-size: .86rem; }
.b-side + .b-side { border-top: 1px solid var(--line); }
.b-side.won { font-weight: 700; }
.b-side.won .b-score { color: var(--good); }
.b-side.lost { color: var(--muted); }
.b-side.lost .b-name { text-decoration: line-through; text-decoration-color: #9993; }
.b-side.me { background: #d63c3c0d; }
.b-seed { font-size: .7rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-score { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 14px; text-align: right; }
.b-side .avatar.xs { width: 20px; height: 20px; }
.b-foot { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 3px 6px 5px; font-size: .72rem; border-top: 1px dashed var(--line); }
.b-foot > span:first-child { margin-right: auto; }
.b-third { margin-top: 18px; }
.b-third .b-match::after { display: none; }
.b-champ-col { min-width: 180px; flex: 0 0 180px; }
.b-champ-col .b-match::after { display: none; }
.b-champ { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px 10px; border-radius: 10px; border: 2px solid #e0b53c; background: linear-gradient(180deg, #f7d35c40, transparent); }
.b-champ.muted { border: 2px dashed var(--line); background: none; }
.consolation .b-champ { border-color: #cd7f32; background: linear-gradient(180deg, #cd7f3233, transparent); }
.b-champ .avatar.lg { width: 64px; height: 64px; }
.seed-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.seed-list li { display: flex; gap: 8px; align-items: center; }
.seed-list select { flex: 1; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.seed-list, .seed-list li { min-width: 0; }
form[data-form="t-seed"] .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 800px) { form[data-form="t-seed"] .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Turnier-Logo */
.t-head { display: flex; gap: 18px; align-items: center; }
.t-logo { object-fit: contain; border-radius: 12px; background: #fff; flex: none; }
.t-logo.big { width: 120px; height: 120px; box-shadow: var(--shadow); border: 1px solid var(--line); padding: 4px; }
.t-logo.small { width: 40px; height: 40px; border: 1px solid var(--line); padding: 2px; border-radius: 8px; }
.t-logo.mid { width: 72px; height: 72px; border: 1px solid var(--line); padding: 3px; }
.card .t-card-head { display: flex; gap: 10px; align-items: center; min-width: 0; }
.card .t-card-head h3 { margin: 0; }
@media (max-width: 640px) { .t-head { flex-direction: column; align-items: flex-start; } .t-logo.big { width: 88px; height: 88px; } }

/* Team-/Turnier-Logo vergrößert (js/tournaments.js LogoZoom) */
img.team-logo, img.t-logo { cursor: zoom-in; }
#logo-zoom { position: fixed; inset: 0; z-index: 200; background: rgba(10,12,18,.78); display: flex; align-items: center; justify-content: center; cursor: zoom-out; animation: lz-in .15s ease-out; }
#logo-zoom figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
#logo-zoom img { width: min(72vmin, 560px); height: min(72vmin, 560px); object-fit: contain; border-radius: 18px; background: var(--panel); padding: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
#logo-zoom img.pixel { image-rendering: pixelated; }
#logo-zoom figcaption { color: #fff; font-weight: 700; font-size: 1.15rem; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
#logo-zoom .logo-zoom-x { position: absolute; top: 16px; right: 20px; background: none; border: 0; color: #fff; font-size: 1.6rem; cursor: pointer; }
@keyframes lz-in { from { opacity: 0; } to { opacity: 1; } }
