:root {
    --ink: #12261e;
    --ink-soft: #3a4f45;
    --muted: #5f7368;
    --line: #cfdad3;
    --line-soft: #e2ebe5;
    --paper: #f4f7f4;
    --paper-2: #e8efe9;
    --surface: rgba(255, 255, 255, 0.78);
    --surface-solid: #ffffff;
    --teal: #1a6b5c;
    --teal-deep: #0f4a40;
    --teal-soft: #d7efe8;
    --accent: #d4e85c;
    --accent-ink: #243018;
    --danger: #b42318;
    --danger-soft: #fde8e6;
    --ok: #1f7a45;
    --ok-soft: #e3f6ea;
    --warn: #9a6700;
    --warn-soft: #fff4d6;
    --shadow: 0 12px 40px rgba(18, 38, 30, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --font-display: "Syne", sans-serif;
    --font-body: "Figtree", sans-serif;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--ink);
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(26, 107, 92, 0.16), transparent 55%),
        radial-gradient(900px 500px at 100% 0%, rgba(212, 232, 92, 0.22), transparent 50%),
        linear-gradient(180deg, #eef4ef 0%, var(--paper) 40%, #e7eee8 100%);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.35;
    background-image:
        linear-gradient(rgba(18, 38, 30, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 38, 30, 0.03) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 90%);
    z-index: 0;
}

.site-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.site-shell-screen,
body.screen-page .site-shell {
    min-height: 100vh;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 24px 22px 48px;
}

body.screen-page {
    background: linear-gradient(145deg, #0d2a24 0%, #124339 45%, #1a5a4c 100%);
}

.container.container-screen {
    max-width: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 18px 22px 0;
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--ink);
}

.site-brand-mark {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--teal);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 18px;
}

.site-brand-name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
}

.site-header-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.site-header-nav a {
    color: var(--ink-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.site-header-nav a:hover {
    color: var(--teal-deep);
}

.inline-form {
    display: inline;
    margin: 0;
}

/* Typography helpers */
h1, h2, h3 {
    font-family: var(--font-display);
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ink);
}

h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); margin: 0 0 0.4em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); margin: 0 0 0.35em; }
h3 { font-size: 1.15rem; margin: 0 0 0.35em; }

a { color: var(--teal-deep); }
a:hover { color: var(--teal); }

label {
    display: grid;
    gap: 6px;
    font-weight: 600;
    color: var(--ink-soft);
    font-size: 0.92rem;
}

/* Surfaces */
.card {
    background: var(--surface-solid);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.admin-inner-card {
    padding: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: #f8fbf9;
}

/* Buttons */
.btn,
button,
.landing-admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--teal);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s var(--ease), background 0.2s ease, box-shadow 0.2s ease;
}

.btn:hover,
button:hover {
    background: var(--teal-deep);
    transform: translateY(-1px);
}

.btn-sm {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.85rem;
}

.btn-accent {
    background: var(--accent);
    color: var(--accent-ink);
}

.btn-accent:hover {
    background: #c6db4a;
    color: var(--accent-ink);
}

.btn-outline-light {
    background: transparent;
    color: #f4faf7;
    border: 1.5px solid rgba(244, 250, 247, 0.45);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-ghost,
.button-secondary {
    background: transparent;
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

.btn-ghost:hover,
.button-secondary:hover {
    background: var(--paper-2);
    color: var(--ink);
}

.admin-hero .button-secondary {
    color: #f4faf7;
    border-color: rgba(244, 250, 247, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

.admin-hero .button-secondary:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
}

.button-danger {
    background: var(--danger);
}

.button-danger:hover {
    background: #912018;
}

/* Forms */
.form-grid {
    display: grid;
    gap: 12px;
}

.form-inline {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.card .form-inline {
    margin-bottom: 10px;
}

.card .form-inline:last-child {
    margin-bottom: 0;
}

input, select, textarea, button {
    font-size: 14px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input,
select,
textarea {
    width: 100%;
    background: #fbfdfb;
    color: var(--ink);
    font-family: var(--font-body);
}

.form-inline input,
.form-inline select {
    width: auto;
    min-width: 160px;
}

textarea {
    min-height: 96px;
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(26, 107, 92, 0.16);
}

/* Auth pages */
.page-auth .container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-panel {
    width: min(100%, 440px);
    margin: 28px auto 40px;
    animation: rise-in 0.55s var(--ease) both;
}

.auth-panel h1 {
    margin-bottom: 6px;
}

.auth-panel .hint {
    margin-top: 0;
}

.auth-wide {
    width: min(100%, 720px);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Landing */
body.page-landing {
    background: #0f2f29;
}

body.page-landing::before {
    display: none;
}

body.page-landing .container {
    max-width: none;
    padding: 0;
}

.landing-hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: grid;
    align-items: end;
    overflow: hidden;
    color: #f4faf7;
}

.landing-hero-bg {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, rgba(10, 36, 31, 0.55) 0%, rgba(15, 47, 41, 0.2) 45%, rgba(15, 47, 41, 0.72) 100%),
        radial-gradient(ellipse 80% 60% at 70% 30%, rgba(212, 232, 92, 0.28), transparent 55%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(26, 107, 92, 0.55), transparent 60%),
        linear-gradient(160deg, #0b2420 0%, #165347 48%, #0f332c 100%);
    animation: hero-shift 14s ease-in-out infinite alternate;
}

.landing-hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(244, 250, 247, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(244, 250, 247, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 75%);
}

@keyframes hero-shift {
    from { filter: hue-rotate(0deg) saturate(1); transform: scale(1); }
    to { filter: hue-rotate(8deg) saturate(1.08); transform: scale(1.03); }
}

.landing-hero-inner {
    position: relative;
    z-index: 1;
    max-width: 900px;
    padding: clamp(48px, 10vh, 96px) clamp(22px, 5vw, 64px) clamp(40px, 8vh, 72px);
    animation: rise-in 0.7s var(--ease) both;
}

.landing-brand {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 0.95;
    color: var(--accent);
    animation: brand-in 0.9s var(--ease) both;
}

@keyframes brand-in {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to { opacity: 1; transform: none; }
}

.landing-title {
    margin: 0 0 14px;
    max-width: 16ch;
    font-size: clamp(1.55rem, 3.4vw, 2.35rem);
    font-weight: 700;
    color: #f4faf7;
    letter-spacing: -0.03em;
}

.landing-lede {
    margin: 0 0 28px;
    max-width: 38ch;
    font-size: clamp(1.05rem, 2vw, 1.25rem);
    line-height: 1.5;
    color: rgba(244, 250, 247, 0.82);
}

.landing-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    animation: rise-in 0.8s var(--ease) 0.15s both;
}

.landing-section {
    background: var(--paper);
    color: var(--ink);
    padding: clamp(48px, 8vw, 88px) 0;
}

.landing-section-alt {
    background: #e7efe9;
}

.landing-section-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 clamp(22px, 4vw, 40px);
}

.landing-section-title {
    margin-bottom: 28px;
    max-width: 18ch;
}

.landing-copy {
    color: var(--ink-soft);
    font-size: 1.08rem;
    line-height: 1.55;
    max-width: 42ch;
}

.landing-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 18px;
}

.landing-steps li {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 18px;
    align-items: start;
    padding: 18px 0;
    border-top: 1px solid var(--line);
}

.landing-steps li:last-child {
    border-bottom: 1px solid var(--line);
}

.landing-step-num {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    color: var(--teal);
    letter-spacing: -0.04em;
}

.landing-steps h3 {
    margin-bottom: 6px;
}

.landing-steps p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.landing-split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 40px;
    align-items: center;
}

.landing-roles {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.landing-roles li {
    padding: 14px 16px;
    border-left: 3px solid var(--teal);
    background: rgba(255, 255, 255, 0.55);
    color: var(--ink-soft);
    line-height: 1.4;
}

.landing-roles strong {
    color: var(--ink);
    display: block;
    margin-bottom: 2px;
    font-family: var(--font-display);
}

.landing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 28px clamp(22px, 4vw, 40px);
    background: #0f2f29;
    color: #f4faf7;
}

.landing-footer .site-brand {
    color: #f4faf7;
}

.landing-footer .site-brand-mark {
    background: var(--accent);
    color: var(--accent-ink);
}

.landing-footer-links {
    display: flex;
    gap: 18px;
}

.landing-footer-links a {
    color: rgba(244, 250, 247, 0.8);
    text-decoration: none;
    font-weight: 600;
}

.landing-footer-links a:hover {
    color: var(--accent);
}

/* Admin nav */
.admin-top-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px;
    margin-bottom: 18px;
    background: var(--surface-solid);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-top-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.admin-top-link:hover {
    background: var(--paper-2);
    color: var(--teal-deep);
}

.admin-top-link.active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.row-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.tabs .tab-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.tabs .tab-buttons button {
    background: var(--paper-2);
    color: var(--ink-soft);
    border: 1px solid var(--line);
    box-shadow: none;
}

.tabs .tab-buttons button:hover {
    background: var(--teal-soft);
    filter: none;
    transform: none;
}

.tabs .tab-buttons button.active {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.table-wrap { overflow: auto; }

.score-table {
    border-collapse: collapse;
    background: #fff;
    width: max-content;
    max-width: 100%;
}

.score-table th,
.score-table td {
    border: 1px solid var(--line-soft);
    min-width: 36px;
    width: 36px;
    height: 40px;
    padding: 2px;
    text-align: center;
    box-sizing: border-box;
}

.score-table thead th {
    background: #f3f8f5;
    color: var(--muted);
    font-weight: 700;
}

.score-table thead th:first-child,
.score-table tbody th {
    min-width: 140px;
    width: auto;
    text-align: left;
    padding: 0 8px;
}

.score-table tbody tr:nth-child(even) th,
.score-table tbody tr:nth-child(even) td {
    background: #eef5f1;
}

.score-table tbody tr:nth-child(odd) th,
.score-table tbody tr:nth-child(odd) td {
    background: #fff;
}

.score-cell.active {
    outline: 3px solid var(--teal);
    outline-offset: -3px;
}

.score-table tbody tr td.score-cell.ok { background: var(--ok-soft); }
.score-table tbody tr td.score-cell.fail { background: var(--danger-soft); }

.score-table tr.active-row th { background: var(--teal-soft); }

.score-table tr.round-confirmed-row:nth-child(odd) th,
.score-table tr.round-confirmed-row:nth-child(odd) td {
    background: #eaf8ef;
}

.score-table tr.round-confirmed-row:nth-child(even) th,
.score-table tr.round-confirmed-row:nth-child(even) td {
    background: #d8f0e0;
}

.score-table select[data-score-select] {
    width: 100%;
    max-width: 52px;
    padding: 2px 0;
    font-size: 12px;
}

.confirm-btn {
    width: 42px;
    height: 42px;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--muted);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    padding: 0;
}

.confirm-btn.confirmed {
    border-color: var(--ok);
    background: var(--ok-soft);
    color: var(--ok);
}

.error { color: var(--danger); font-weight: 600; }
.hint { color: var(--muted); margin-top: 0; line-height: 1.45; }
.hint a { font-weight: 700; }

.team-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.team-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-sm);
    background: #fff;
}

.team-delete-form { margin-left: auto; }

.team-number {
    min-width: 28px;
    font-weight: 700;
    color: var(--teal-deep);
    text-align: right;
}

.team-item.dragging { opacity: 0.6; }
.drag-handle { color: var(--muted); cursor: grab; user-select: none; }

.scoreboard {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.scoreboard th,
.scoreboard td {
    border: 1px solid var(--line);
    padding: 10px;
}

/* Ranking screen */
.screen-board {
    background: transparent;
    border-radius: 0;
    padding: clamp(16px, 3vw, 28px);
    color: #f4faf7;
    min-height: 100vh;
    box-sizing: border-box;
}

.screen-board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.screen-board-head h1 {
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    color: #f4faf7;
}

.screen-board-meta {
    color: rgba(244, 250, 247, 0.7);
    font-size: 14px;
}

.screen-ranking-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.screen-ranking-grid.two-columns {
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--screen-rows, 10), minmax(0, auto));
    grid-template-columns: 1fr 1fr;
}

.screen-team-card {
    display: grid;
    grid-template-columns: 70px 1fr 110px;
    align-items: center;
    gap: 14px;
    min-height: 62px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(4px);
}

.screen-ranking-grid.compact .screen-team-card {
    min-height: 45px;
    padding: 7px 10px;
    border-radius: 9px;
}

.screen-ranking-grid.compact .screen-team-place { font-size: 22px; }
.screen-ranking-grid.compact .screen-team-name { font-size: 18px; }
.screen-ranking-grid.compact .screen-team-points { font-size: 23px; }

.screen-team-place {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    color: var(--accent);
}

.screen-team-name {
    font-size: 23px;
    font-weight: 700;
    line-height: 1.1;
}

.screen-team-points {
    font-family: var(--font-display);
    font-size: 30px;
    font-weight: 800;
    text-align: right;
}

/* Admin hero & sections */
.admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    background:
        radial-gradient(600px 240px at 90% 0%, rgba(212, 232, 92, 0.22), transparent 55%),
        linear-gradient(135deg, #0f3a33 0%, #1a6b5c 100%);
    color: #f4faf7;
    padding: 28px;
    border: 0;
    animation: rise-in 0.5s var(--ease) both;
}

.admin-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 3vw, 2.4rem);
    color: #f4faf7;
}

.admin-eyebrow,
.section-kicker {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 700;
}

.admin-eyebrow { color: rgba(212, 232, 92, 0.9); }
.section-kicker { color: var(--teal); }

.admin-subtitle {
    margin: 0;
    max-width: 640px;
    color: rgba(244, 250, 247, 0.82);
    font-size: 1.05rem;
    line-height: 1.5;
}

.admin-logout-form { flex-shrink: 0; }

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    min-width: 280px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    font-weight: 700;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-error {
    background: var(--danger-soft);
    border: 1px solid #f0b4ae;
    color: var(--danger);
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.stat-card {
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    right: -20px;
    bottom: -24px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--teal-soft);
    opacity: 0.7;
}

.stat-card-label {
    display: block;
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 10px;
    font-weight: 600;
}

.stat-card-value {
    position: relative;
    z-index: 1;
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 1;
    color: var(--teal-deep);
}

.admin-section { margin-bottom: 32px; }

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 12px;
    margin-bottom: 14px;
}

.section-head h2 { margin: 0; }

.admin-actions-grid,
.admin-library-grid,
.admin-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.admin-action-card,
.admin-list-card { margin-bottom: 0; }

.admin-action-head,
.admin-list-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.admin-action-head h3,
.admin-list-head h3 { margin: 0; }

.admin-badge,
.admin-list-count,
.role-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.admin-badge {
    background: var(--teal-soft);
    color: var(--teal-deep);
}

.admin-list-count {
    min-width: 28px;
    background: var(--paper-2);
    color: var(--muted);
}

.entity-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.entity-list-item {
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #f8fbf9;
}

.entity-list-item a {
    color: var(--teal-deep);
    text-decoration: none;
    font-weight: 700;
}

.entity-list-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.entity-list-row-top { margin-bottom: 10px; }
.entity-list-meta { display: grid; gap: 4px; }
.user-inline-form { margin: 0; }

.admin-nav-card {
    display: block;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0;
    transition: transform 0.2s var(--ease), border-color 0.2s ease;
}

.admin-nav-card:hover {
    transform: translateY(-3px);
    border-color: var(--teal);
}

.admin-nav-card h3 {
    margin: 14px 0 8px;
}

.admin-nav-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.5;
}

.admin-page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.admin-page-head h1 { margin: 0 0 8px; }
.admin-subtitle-dark { color: var(--muted); }

.admin-text-link {
    color: var(--teal-deep);
    font-weight: 700;
    text-decoration: none;
}

.admin-tournament-settings { display: grid; gap: 14px; }

.admin-tournament-card {
    margin-bottom: 0;
    overflow: hidden;
}

.admin-tournament-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    cursor: pointer;
    list-style: none;
}

.admin-tournament-summary::-webkit-details-marker { display: none; }

.admin-tournament-summary strong {
    display: block;
    font-size: 18px;
    font-family: var(--font-display);
    color: var(--ink);
    margin-bottom: 6px;
}

.admin-members-table { margin-top: 16px; }
.admin-danger-row { margin-top: 14px; }

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink-soft);
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    padding: 0;
    margin: 0;
}

.role-chip-owner { background: var(--warn-soft); color: var(--warn); }
.role-chip-admin { background: var(--teal-soft); color: var(--teal-deep); }
.role-chip-editor { background: var(--paper-2); color: var(--muted); }

@media (max-width: 860px) {
    .landing-split {
        grid-template-columns: 1fr;
        gap: 28px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 18px 14px 32px;
    }

    .site-header {
        padding: 14px 14px 0;
    }

    .admin-hero {
        flex-direction: column;
        padding: 22px;
    }

    .toast {
        left: 14px;
        right: 14px;
        top: 14px;
        min-width: 0;
        max-width: none;
    }

    .section-head { align-items: flex-start; }
    .admin-tournament-summary { flex-direction: column; }

    .admin-top-nav {
        padding: 8px;
        gap: 6px;
    }

    .admin-top-link {
        flex: 1 1 calc(50% - 6px);
        font-size: 0.88rem;
    }

    .landing-hero-inner {
        align-self: end;
    }
}

/* Вопросы раунда — аккордеон */
.questions-accordion {
    display: grid;
    gap: 8px;
}

.question-accordion-item {
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: #f8fbf9;
    overflow: hidden;
}

.question-accordion-item[open] {
    background: #fff;
    border-color: var(--teal);
}

.question-accordion-item.dragging {
    opacity: 0.55;
}

.question-accordion-summary {
    display: grid;
    grid-template-columns: auto auto auto 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.question-accordion-summary::-webkit-details-marker {
    display: none;
}

.question-accordion-summary .drag-handle {
    cursor: grab;
    color: var(--muted);
    padding: 2px 4px;
}

.question-accordion-num {
    min-width: 1.5rem;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--teal-deep);
}

.question-accordion-thumb {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--paper-2);
    border: 1px solid var(--line-soft);
}

.question-accordion-thumb.is-empty {
    display: inline-block;
    background:
        linear-gradient(135deg, var(--paper-2), #fff);
}

.question-accordion-title {
    font-size: 0.95rem;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.question-accordion-time {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--muted);
    background: var(--paper-2);
    border-radius: 8px;
    padding: 4px 8px;
}

.question-accordion-body {
    padding: 0 12px 14px;
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line-soft);
    padding-top: 12px;
}

.question-accordion-body textarea {
    width: 100%;
    min-height: 72px;
    resize: vertical;
}

.question-media-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.question-media-row input[type="text"][data-question-image-url],
.question-media-row input[type="url"] {
    flex: 1 1 220px;
    min-width: 180px;
}

.question-image-preview-wrap img {
    max-height: 100px;
    border-radius: 8px;
}

.questions-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-top: 14px;
}

.question-item-actions {
    display: flex;
    justify-content: flex-end;
    padding-top: 4px;
}

.question-media-row [data-question-image-clear] {
    white-space: nowrap;
}

.question-time-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.question-time-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.time-preset-btn {
    min-height: 34px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--paper-2);
    color: var(--ink-soft);
    font-weight: 700;
    cursor: pointer;
}

.time-preset-btn:hover {
    background: var(--teal-soft);
    transform: none;
}

.time-preset-btn.selected {
    background: var(--teal);
    color: #fff;
    border-color: var(--teal);
}

.question-time-custom {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--muted);
}

.question-time-custom input {
    width: 72px;
}

@media (max-width: 640px) {
    .question-accordion-summary {
        grid-template-columns: auto auto 1fr auto;
    }
    .question-accordion-thumb {
        display: none;
    }
}
