/* SAUMI Turnier – Admin-Oberfläche */

:root {
  --orange: #F08C00;
  --orange-bg: #FFF4E0;
  --green-bg: #E7F6EE;
  --blue-bg: #E3F4FA;
  --line: #E3E8ED;
  --field-h: 48px;
}

body.admin { min-height: 100vh; }
body.modal-open { overflow: hidden; }

.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* ---------- Kopfleiste */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 2px 14px rgba(6, 26, 46, .25);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 20px; min-height: 60px;
}
.brand { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sub {
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  text-transform: uppercase; letter-spacing: .12em; color: var(--blue-light);
  border-left: 1px solid rgba(255,255,255,.2); padding-left: 14px;
}
.topnav { display: flex; align-items: center; gap: 6px; }
.navlink {
  font-family: var(--font-heading); font-weight: 600; font-size: 15px;
  text-transform: uppercase; letter-spacing: .08em;
  color: rgba(255,255,255,.85); background: none; border: 0; cursor: pointer;
  text-decoration: none; padding: 10px 12px; border-radius: var(--radius-pill); min-height: 44px;
  display: inline-flex; align-items: center;
}
.navlink:hover { color: var(--white); background: rgba(255,255,255,.08); }
.conn {
  font-family: var(--font-heading); font-weight: 700; font-size: 13px; letter-spacing: .1em;
  text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; padding: 0 8px;
}
.conn::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.conn.on { color: #5BE09A; }
.conn.on::before { box-shadow: 0 0 0 3px rgba(91,224,154,.25); }
.conn.off { color: #FF8A8E; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }

/* ---------- Layout */
.wrap { max-width: 1200px; margin: 0 auto; padding: 24px 20px 96px; }
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 20px;
}
.card h2 { font-size: 24px; font-weight: 700; }
.h-sub { color: var(--blue); font-weight: 600; margin-left: .3em; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.grid2 > .card { margin-bottom: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.section-head h2 { margin: 0; }
.loading { padding: 60px 0; text-align: center; color: var(--text-muted); font-family: var(--font-heading); text-transform: uppercase; letter-spacing: .1em; font-size: 18px; }
.loading.small { padding: 16px 0; font-size: 15px; }
.empty { padding: 18px 4px; }

/* ---------- Formulare */
.lbl {
  display: block; font-family: var(--font-heading); font-weight: 600; font-size: 13px;
  text-transform: uppercase; letter-spacing: .08em; color: var(--grey-600); margin-bottom: 6px;
}
.field {
  width: 100%; height: var(--field-h);
  border: 2px solid var(--grey-200); border-radius: 10px;
  padding: 0 14px; background: var(--white); color: var(--text);
  font-size: 16px; /* verhindert iOS-Zoom */
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  -webkit-appearance: none; appearance: none;
}
select.field {
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--navy) 50%), linear-gradient(135deg, var(--navy) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 6px 6px; background-repeat: no-repeat;
}
textarea.field { height: auto; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.field:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,150,199,.18); }
.field:disabled { background: var(--grey-100); color: var(--grey-400); }
.field-lg { height: 56px; font-size: 18px; }
.field.invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(229,72,77,.15); }
.field.valid { border-color: var(--green); }

.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; min-height: var(--field-h); font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); }

.admin .btn { min-height: 44px; }
.admin .btn-sm { min-height: 38px; }
.btn-lg { font-size: 18px; min-height: 52px !important; }
.btn-block { width: 100%; }
.btn-ghost.danger-ghost { color: var(--red); }
.btn-ghost.danger-ghost:hover { background: rgba(229,72,77,.08); }
.btn:focus-visible, .linkbtn:focus-visible, .namebtn:focus-visible, .seg:focus-visible, .collapse-head:focus-visible {
  outline: 3px solid var(--blue-light); outline-offset: 2px;
}
.linkbtn {
  background: none; border: 0; padding: 8px 0; cursor: pointer; color: var(--blue);
  font-weight: 600; font-size: 14px; min-height: 40px;
}
.linkbtn:hover { text-decoration: underline; }

/* ---------- Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-heading); font-weight: 700; font-size: 14px; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 12px; border-radius: var(--radius-pill);
  background: var(--grey-200); color: var(--navy);
}
.badge-prelim { background: var(--blue-bg); color: #00739A; }
.badge-ko { background: var(--navy); color: var(--white); }
.badge-finished { background: var(--green); color: var(--white); }
.badge-round { background: var(--gold); color: var(--navy); }
.tag {
  display: inline-block; font-family: var(--font-heading); font-weight: 700; font-size: 12px; letter-spacing: .08em;
  text-transform: uppercase; padding: 1px 8px; border-radius: var(--radius-pill); vertical-align: middle;
}
.tag-ko { background: var(--navy); color: var(--white); margin-left: 8px; }
.tag-best { background: var(--gold); color: var(--navy); }

/* ---------- Login */
.login-wrap { display: flex; justify-content: center; padding-top: 8vh; }
.login-card { width: 100%; max-width: 400px; text-align: center; padding: 36px 32px; }
.login-card .lbl { text-align: left; margin-top: 18px; }
.login-card .btn { margin-top: 16px; }
.login-symbol { width: 64px; height: auto; margin-bottom: 12px; }
.login-card h1 { font-size: 34px; margin-bottom: 4px; }

/* ---------- Turnierliste */
.create-form { display: grid; grid-template-columns: minmax(0, 2fr) 120px 120px auto auto; gap: 14px; align-items: end; }
.tlist { list-style: none; margin: 0; padding: 0; }
.titem {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.titem:first-child { border-top: 0; }
.titem-main { flex: 1 1 260px; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.titem-name { font-family: var(--font-heading); font-weight: 700; font-size: 24px; text-transform: uppercase; line-height: 1.1; overflow-wrap: anywhere; }
.titem-main:hover .titem-name { color: var(--blue); }
.titem-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.titem-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Turnier-Kopf */
.thead-card { padding-bottom: 18px; }
.thead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.thead-title { min-width: 0; }
.thead-title h1 { font-size: 40px; font-weight: 700; margin: 4px 0 8px; overflow-wrap: anywhere; }
.backlink { font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.backlink:hover { text-decoration: underline; }
.thead-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.thead-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.thead-actions .btn-ghost { color: var(--navy); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--grey-100); border-radius: var(--radius); padding: 12px 16px; min-width: 0; }
.stat-label { font-family: var(--font-heading); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--grey-600); }
.stat-value { font-family: var(--font-heading); font-weight: 700; font-size: 32px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-record { background: linear-gradient(135deg, #FFF6DD, #FFEDB8); }
.stat-record .stat-label { color: #9A6A00; }

.settings { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; align-items: end; }
.settings-grid .f-wide { grid-column: span 2; }
.settings-actions { margin-top: 14px; }

/* ---------- Hinzufügen */
.add-form { display: flex; gap: 10px; }
.add-form .field { flex: 1; min-width: 0; }
.add-msg { min-height: 26px; padding-top: 6px; color: var(--green); font-weight: 600; }
.add-msg.pop { animation: pop .35s var(--ease); }
@keyframes pop { 0% { transform: translateY(4px); opacity: 0; } 100% { transform: none; opacity: 1; } }
.paste { margin-top: 6px; }
.paste-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; }

/* ---------- KO-Karte */
.ko-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.ko-num { font-family: var(--font-heading); font-weight: 800; font-size: 48px; line-height: 1; color: var(--green); }
.ko-of { font-family: var(--font-heading); font-weight: 700; font-size: 24px; color: var(--grey-600); }
.ko-lbl { font-family: var(--font-heading); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--grey-600); }
.ko-msg { font-size: 14px; margin: 6px 0 14px; padding: 10px 12px; border-radius: 10px; }
.ko-msg.ok { background: var(--green-bg); color: var(--green-dark); }
.ko-msg.bad { background: var(--orange-bg); color: #8A4B00; }

/* ---------- Matches */
.mgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 16px; align-items: start; }
.mcard {
  position: relative; border: 2px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; background: var(--white);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.mcard.is-current { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,150,199,.15), var(--shadow); padding-top: 34px; }
.mcard-now {
  position: absolute; top: 0; left: 0; right: 0;
  background: var(--blue); color: var(--white); border-radius: 9px 9px 0 0;
  font-family: var(--font-heading); font-weight: 700; font-size: 14px; letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 14px;
}
.mcard-now::before { content: '● '; animation: blink 1.2s steps(2) infinite; }
.mcard.st-tie { border-color: var(--orange); background: var(--orange-bg); }
.mcard.st-done { border-color: rgba(38,169,96,.45); }
.mcard.st-bye, .mcard.st-pending { background: var(--grey-100); }
.mcard.is-current.st-tie { border-color: var(--blue); }
.mcard-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.mcard-label { font-family: var(--font-heading); font-weight: 700; font-size: 16px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey-600); }
.mstatus {
  font-family: var(--font-heading); font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 10px; border-radius: var(--radius-pill); text-align: right;
}
.mstatus.st-pending { background: var(--grey-200); color: var(--grey-600); }
.mstatus.st-ready { background: var(--blue-bg); color: #00739A; }
.mstatus.st-done { background: var(--green); color: var(--white); }
.mstatus.st-tie { background: var(--orange); color: var(--white); }
.mstatus.st-bye { background: var(--grey-200); color: var(--navy); }

.mrow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.mrow.win { background: var(--green-bg); }
.mrow.win .pname { color: var(--green-dark); }
.mrow.lose .pname { opacity: .55; }
.mname { min-width: 0; overflow-wrap: anywhere; }
.mname .pname { font-weight: 700; font-size: 17px; }
.jo { color: var(--grey-400); font-size: 13px; font-weight: 600; }
.tbd { color: var(--grey-400); font-style: italic; }
.wintag {
  display: inline-block; font-family: var(--font-heading); font-weight: 700; font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  background: var(--green); color: var(--white); border-radius: var(--radius-pill); padding: 0 8px; vertical-align: middle;
}
.mvs { text-align: center; font-family: var(--font-heading); font-weight: 700; text-transform: uppercase; letter-spacing: .15em; font-size: 12px; color: var(--grey-400); margin: 2px 0; }
.mtime { font-size: 20px; }
.mcard-note { margin: 8px 0 0; }
.mcard-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.mcard-actions .btn-green { flex: 1 1 auto; }

.dq { position: relative; display: inline-flex; cursor: pointer; }
.dq input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dq span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 52px; height: 44px; padding: 0 10px;
  border: 2px solid var(--grey-200); border-radius: var(--radius-pill);
  font-family: var(--font-heading); font-weight: 700; letter-spacing: .08em; color: var(--grey-600); background: var(--white);
  user-select: none;
}
.dq input:checked + span { background: var(--red); border-color: var(--red); color: var(--white); }
.dq input:focus-visible + span { outline: 3px solid var(--blue-light); outline-offset: 2px; }
.mrow.is-dq .tfield { opacity: .45; text-decoration: line-through; }

.round-title { font-size: 20px; margin: 22px 0 10px; color: var(--navy); }
.round-title:first-of-type { margin-top: 16px; }
.collapse-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--navy); min-height: 44px; text-align: left;
}
.h2like { font-family: var(--font-heading); font-weight: 700; font-size: 24px; text-transform: uppercase; letter-spacing: .02em; }
.chev { font-size: 16px; color: var(--blue); }
.rounds-card { padding-top: 14px; padding-bottom: 14px; }

/* Podium */
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; align-items: end; max-width: 640px; margin: 10px auto 0; }
.pod { text-align: center; min-width: 0; }
.pod-name { font-family: var(--font-heading); font-weight: 700; font-size: 22px; text-transform: uppercase; margin-bottom: 8px; overflow-wrap: anywhere; }
.pod-block { border-radius: 12px 12px 0 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; }
.pod-place { font-family: var(--font-heading); font-weight: 800; font-size: 40px; color: var(--navy); }
.pod-1 .pod-block { height: 130px; background: linear-gradient(180deg, var(--gold), var(--gold-dark)); }
.pod-2 .pod-block { height: 95px; background: linear-gradient(180deg, #E4EAF0, var(--silver)); }
.pod-3 .pod-block { height: 70px; background: linear-gradient(180deg, #EBAA72, var(--bronze)); }
.pod-1 .pod-name { font-size: 28px; color: #9A6A00; }

/* ---------- Teilnehmerliste */
.sorter { display: inline-flex; background: var(--grey-100); border-radius: var(--radius-pill); padding: 3px; }
.seg {
  border: 0; background: none; cursor: pointer; border-radius: var(--radius-pill); padding: 0 16px; min-height: 38px;
  font-family: var(--font-heading); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--grey-600); font-size: 15px;
}
.seg.on { background: var(--navy); color: var(--white); }
.search-wrap { margin-bottom: 8px; }
.search { height: 52px; font-size: 17px; padding-left: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%239AA8B6' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='8.5' cy='8.5' r='6'/%3E%3Cpath d='M13 13l5 5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 14px 50%;
}
.table-wrap { margin: 0 -8px; }
.ptable { width: 100%; border-collapse: separate; border-spacing: 0; }
.ptable th {
  font-family: var(--font-heading); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--grey-600); text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--line);
  position: sticky; top: 60px; background: var(--white); z-index: 2;
}
.ptable td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.prow td:first-child { border-left: 4px solid transparent; }
.prow.is-q td:first-child { border-left-color: var(--green); }
.prow.is-q { background: linear-gradient(90deg, rgba(38,169,96,.06), transparent 60%); }
.prow.open td { border-bottom-color: transparent; background: var(--blue-bg); }
.prow.flash td { animation: rowflash 1.4s var(--ease); }
@keyframes rowflash { 0%, 30% { background: rgba(38,169,96,.28); } 100% { background: transparent; } }
.c-no { width: 48px; color: var(--grey-600); font-weight: 600; font-variant-numeric: tabular-nums; }
.c-rank { width: 64px; }
.c-best { width: 96px; }
.c-best .time { font-size: 22px; }
.c-att { width: 64px; text-align: center; font-weight: 600; }
th.c-att { text-align: center; }
.c-in { width: 250px; }
.rank {
  display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 30px; padding: 0 8px;
  border-radius: var(--radius-pill); background: var(--grey-100);
  font-family: var(--font-heading); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums;
}
.rank-q { background: var(--green); color: var(--white); }
.namebtn {
  background: none; border: 0; padding: 6px 0; cursor: pointer; text-align: left; color: inherit;
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; max-width: 100%;
}
.namebtn .pname { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.namebtn .chev { width: 14px; flex: none; font-size: 14px; }
.namebtn:hover .pname { color: var(--blue); }
.meta-narrow { display: none; font-size: 13px; color: var(--grey-600); padding-left: 20px; }
.meta-narrow .time { font-size: 15px; color: var(--navy); }

.tin { position: relative; display: flex; align-items: center; gap: 6px; }
.tfield {
  width: 108px; flex: none; text-align: center; padding: 0 8px;
  font-family: var(--font-heading); font-weight: 700; font-size: 22px; letter-spacing: .03em; font-variant-numeric: tabular-nums;
}
.tfield::placeholder { color: #C3CCD5; font-weight: 600; }
.tin-ok { width: 44px; padding: 0 !important; flex: none; font-size: 18px; }
.tprev { min-width: 62px; font-family: var(--font-heading); font-weight: 700; font-size: 16px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tprev.good { color: var(--green); }
.tprev.bad { color: var(--red); }
.tin-match .tprev {
  position: absolute; left: 0; right: 0; top: 100%; min-width: 0; text-align: center; font-size: 12px; line-height: 1.2; pointer-events: none;
}
.tin-match .tprev:empty { display: none; }

.cutline td { padding: 0; border: 0; }
.cutline span {
  display: flex; align-items: center; gap: 12px; margin: 6px 0; white-space: nowrap;
  font-family: var(--font-heading); font-weight: 700; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--green);
}
.cutline span::before, .cutline span::after { content: ''; flex: 1; border-top: 2px dashed var(--green); }

.pdetail td { background: var(--blue-bg); padding: 0 8px 16px; border-bottom: 1px solid var(--line); }
.detail { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr) auto; gap: 20px; align-items: start; padding: 12px 12px 0 24px; }
.inline-form { display: flex; gap: 8px; }
.inline-form .field { flex: 1; min-width: 0; }
.alist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.aitem { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aitem .tprev { min-width: 54px; font-size: 14px; }
.aitem .tfield { width: 96px; height: 42px; font-size: 19px; }
.aclock { width: 40px; font-variant-numeric: tabular-nums; }
.detail-danger { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; padding-top: 22px; max-width: 220px; }

/* ---------- Toasts */
.toasts {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; width: min(520px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  pointer-events: auto; cursor: pointer; width: 100%;
  background: var(--navy); color: var(--white); border-radius: 14px; box-shadow: var(--shadow-lg);
  padding: 12px 18px; font-weight: 600; text-align: center;
  opacity: 0; transform: translateY(12px); transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
.toast-ok { border-left: 6px solid var(--green); }
.toast-warn { background: var(--orange); }
.toast-error { background: var(--red); }
.toast-record {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark)); color: var(--navy);
  padding: 16px 20px; animation: recpulse 1s var(--ease) 2;
}
.toast-record-title { font-family: var(--font-heading); font-weight: 800; font-size: 26px; text-transform: uppercase; letter-spacing: .04em; }
.toast-record-body { font-size: 17px; }
.toast-record-body .time { font-size: 24px; margin-right: 6px; }
@keyframes recpulse { 50% { transform: scale(1.04); } }

/* ---------- Modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300; background: rgba(6, 26, 46, .62);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fadein .15s var(--ease);
}
.modal {
  background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 480px; padding: 26px 26px 22px;
  animation: pop .2s var(--ease);
}
.modal h2 { font-size: 28px; font-weight: 700; }
.modal-body p { margin: 0 0 10px; }
.modal .field { margin: 8px 0 4px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal-actions .btn-ghost { color: var(--navy); }
@keyframes fadein { from { opacity: 0; } }

/* ---------- Responsiv */
@media (max-width: 960px) {
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .create-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .create-form .f-name { grid-column: 1 / -1; }
  .settings-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .detail { grid-template-columns: minmax(0, 1fr); padding-left: 12px; }
  .detail-danger { padding-top: 0; max-width: none; }
  .c-rank { display: none; }
}

@media (max-width: 720px) {
  .wrap { padding: 14px 10px 96px; }
  .card { padding: 16px; border-radius: var(--radius); margin-bottom: 14px; }
  .grid2 { gap: 14px; margin-bottom: 14px; }
  .topbar-inner { padding: 8px 12px; min-height: 56px; }
  .brand-logo { height: 28px; }
  .brand-sub { display: none; }
  .navlink { padding: 8px; font-size: 14px; }
  .thead-title h1 { font-size: 30px; }
  .thead-actions { width: 100%; }
  .thead-actions .btn { flex: 1 1 auto; }
  .stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat-value { font-size: 26px; }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .settings-grid .f-wide { grid-column: auto; }
  .create-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .create-form .btn { grid-column: 1 / -1; }
  .add-form .btn { padding-left: 1em; padding-right: 1em; }
  .mgrid { grid-template-columns: minmax(0, 1fr); }
  .mrow { grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; padding: 6px 4px; }
  .tfield { width: 92px; font-size: 20px; }
  .ptable th { top: 56px; }
  .c-best, .c-att { display: none; }
  .meta-narrow { display: block; }
  .c-no { width: 34px; font-size: 13px; padding-left: 4px !important; }
  .ptable thead { display: none; }
  .c-in { width: 140px; }
  .c-in .tin { flex-wrap: nowrap; gap: 4px; }
  .c-in .tfield { width: 88px; }
  .c-in .tprev { position: absolute; top: 100%; left: 0; min-width: 0; font-size: 12px; line-height: 1.1; }
  .c-in .tprev:empty { display: none; }
  .ptable td { padding: 8px 4px; }
  .namebtn .pname { font-size: 15px; }
  .podium { gap: 6px; }
  .pod-name { font-size: 17px; }
  .pod-1 .pod-name { font-size: 20px; }
  .h2like, .card h2 { font-size: 21px; }
  .section-head h2 .h-sub { display: block; margin: 2px 0 0; font-size: 17px; }
}

@media (max-width: 380px) {
  .tfield, .c-in .tfield { width: 80px; }
  .c-in { width: 132px; }
  .dq span { min-width: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
