:root {
    color-scheme: dark;
    --bg: #05090d;
    --panel: rgba(13, 18, 25, 0.92);
    --panel-2: #111923;
    --line: #263646;
    --text: #f4fbff;
    --muted: #9fb0bf;
    --cyan: #39d9ff;
    --blue: #1168ff;
    --yellow: #9d62ff;
    --green: #9dff57;
    --danger: #ff5068;
}

.member-permission-card {
    display: grid;
    gap: 14px;
    margin-top: 12px;
    padding: 16px;
    border: 1px solid rgba(90, 220, 255, .18);
    border-radius: 14px;
    background: rgba(255, 255, 255, .025);
}

.member-permission-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.member-permission-head strong,
.member-permission-head span { display: block; }

.member-permission-form {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.member-permission-form label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0;
}

.member-permission-form input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #49ddff;
}

.member-password-reset-form {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.member-password-reset-form label { margin: 0; }

@media (max-width: 700px) {
    .member-permission-head,
    .member-password-reset-form {
        align-items: stretch;
        grid-template-columns: 1fr;
        flex-direction: column;
    }
}

.button.danger {
    border-color: rgba(255, 91, 126, .45);
    background: rgba(255, 91, 126, .12);
    color: #ffb4c4;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(3, 8, 12, 0.34), rgba(5, 9, 13, 0.86) 620px),
        radial-gradient(circle at 18% 12%, rgba(28, 210, 255, .13), transparent 34%),
        radial-gradient(circle at 82% 2%, rgba(157, 98, 255, .16), transparent 36%),
        #050810;
    color: var(--text);
    font-family: "Sora", "Segoe UI", Arial, sans-serif;
}

.page {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.hero {
    min-height: 430px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-bottom: 1px solid rgba(57, 217, 255, 0.3);
}

.hero.compact {
    min-height: 300px;
}

.nav,
.section-head,
.actions,
.card-actions,
.stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.nav {
    position: relative;
    min-height: 78px;
}

.brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 800;
    letter-spacing: 0;
}

.nav > .brand {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.brand img {
    width: 86px;
    height: 86px;
    object-fit: contain;
    border-radius: 18px;
    filter: drop-shadow(0 0 18px rgba(57, 217, 255, 0.48));
}

.hero-copy h1,
h1,
h2,
h3 {
    font-family: "Chakra Petch", "Segoe UI", sans-serif;
    letter-spacing: -.025em;
}

.site-footer::before {
    content: "No Mercy Tournaments \00b7 Matchpoint Center";
    color: var(--muted);
    margin-right: auto;
}

.hero-copy {
    max-width: 860px;
    padding: 50px 0 46px;
}

.eyebrow {
    display: block;
    margin-bottom: 10px;
    color: var(--yellow);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(44px, 8vw, 92px);
    line-height: 0.95;
}

.compact h1 {
    font-size: clamp(38px, 6vw, 68px);
}

h2 {
    margin-bottom: 0;
    font-size: 26px;
}

h3 {
    margin-bottom: 0;
    font-size: 22px;
}

p,
.muted,
.hint,
small {
    color: var(--muted);
}

.panel {
    margin-top: 22px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    backdrop-filter: blur(10px);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--yellow);
    color: #05090d;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
}

.button.ghost {
    border-color: var(--line);
    background: rgba(17, 25, 35, 0.86);
    color: var(--text);
}

.button.danger {
    border-color: rgba(255, 80, 104, 0.7);
    background: rgba(255, 80, 104, 0.16);
    color: #ffd7dd;
}

.button.danger:hover {
    background: rgba(255, 80, 104, 0.28);
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border: 1px solid rgba(57, 217, 255, 0.32);
    border-radius: 999px;
    background: rgba(7, 16, 24, 0.82);
    color: var(--yellow);
    font-size: 24px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 0 18px rgba(57, 217, 255, 0.16);
}

.icon-button:hover {
    border-color: var(--yellow);
    background: rgba(255, 229, 0, 0.12);
}

.nav-admin {
    margin-left: auto;
}

.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 22px;
}

.tournament-card,
.empty-state {
    min-height: 210px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(57, 217, 255, 0.08), rgba(17, 25, 35, 0.94));
}

.admin-tournament-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.admin-tournament-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(7, 16, 24, 0.72);
}

.admin-tournament-row h3 {
    margin-bottom: 8px;
}

.stats {
    justify-content: flex-start;
    color: var(--muted);
}

.form-grid,
.report-form,
.placement-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(140px, 1fr));
    gap: 14px;
}

.placement-grid {
    margin-top: 16px;
}

label span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 13px;
}

input,
textarea,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #071018;
    color: var(--text);
    padding: 10px;
    font: inherit;
}

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

.wide {
    display: block;
    margin-top: 16px;
}

.hint {
    margin-top: 10px;
}

.link-box,
.team-link-list {
    display: flex;
    align-items: center;
    gap: 12px;
}

.link-box input {
    flex: 1;
}

.team-link-list {
    align-items: stretch;
    flex-direction: column;
    margin-top: 16px;
}

.team-link-list label {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.team-link-list label span {
    margin-bottom: 0;
}

.created-panel {
    border-color: rgba(157, 255, 87, 0.5);
    background: linear-gradient(135deg, rgba(157, 255, 87, 0.08), rgba(13, 18, 25, 0.95));
}

.danger-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border-color: rgba(255, 80, 104, 0.45);
    background: linear-gradient(135deg, rgba(255, 80, 104, 0.08), rgba(13, 18, 25, 0.95));
}

.notice {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 8px;
    background: var(--panel-2);
    border: 1px solid var(--line);
}

.notice.success {
    border-color: rgba(157, 255, 87, 0.45);
}

.notice.error {
    border-color: rgba(255, 80, 104, 0.6);
    color: #ffd7dd;
}

.notice.warning {
    border-color: rgba(255, 229, 0, 0.65);
    color: #fff7a8;
}

.dashboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 12px;
    border-bottom: 1px solid rgba(38, 54, 70, 0.75);
    text-align: left;
}

th {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
}

td:nth-child(n+3),
th:nth-child(n+3) {
    text-align: right;
}

td small {
    display: block;
    margin-top: 4px;
}

.matchpoint-row {
    background: rgba(57, 217, 255, 0.08);
}

.winner-row {
    background: rgba(255, 229, 0, 0.13);
}

.admin-edited-row {
    background: rgba(157, 255, 87, 0.12);
}

.admin-edited-row td {
    border-bottom-color: rgba(157, 255, 87, 0.35);
}

.confirmed-row {
    background: rgba(157, 255, 87, 0.08);
}

.fragger-list {
    display: grid;
    gap: 8px;
    margin-top: 18px;
}

.fragger {
    display: grid;
    grid-template-columns: 46px 1fr 58px;
    gap: 8px;
    align-items: center;
    padding: 12px;
    border: 1px solid rgba(38, 54, 70, 0.72);
    border-radius: 8px;
    background: rgba(7, 16, 24, 0.7);
}

.fragger small {
    grid-column: 2;
}

.fragger b {
    grid-row: 1 / span 2;
    grid-column: 3;
    color: var(--yellow);
    text-align: right;
}

.report-panel {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
}

.team-switch {
    grid-column: 1;
}

.report-form {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.wide-input {
    grid-column: span 2;
}

.team-timer {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(360px, 1.4fr);
    gap: 18px;
    align-items: center;
}

.report-panel + .team-timer {
    display: none;
}

.timer-display {
    min-width: 180px;
    padding: 16px 18px;
    border: 1px solid rgba(57, 217, 255, 0.38);
    border-radius: 8px;
    background: rgba(7, 16, 24, 0.78);
    color: var(--yellow);
    font-size: 34px;
    font-weight: 900;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.timer-running .timer-display {
    color: var(--green);
}

.timer-done .timer-display {
    color: var(--danger);
}

.timer-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(90px, 1fr)) repeat(2, auto);
    gap: 12px;
    align-items: end;
}

.timer-controls input {
    min-width: 90px;
}

.admin-login-panel {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.admin-login-form {
    display: grid;
    gap: 14px;
}

.member-auth-panel { max-width: 620px; margin: 28px auto; }
.member-invite-note { margin-top: 18px; text-align: center; }
.member-management-panel { display: grid; gap: 18px; }
.member-invite-form { display: grid; grid-template-columns: minmax(240px,1fr) auto; gap: 12px; align-items: end; }
.member-invite-form label { display: grid; gap: 8px; }
.invite-result { display: grid; grid-template-columns: auto minmax(240px,1fr) auto; align-items: center; gap: 12px; }
.invite-result input,.invite-inline-link { min-height: 44px; min-width: 260px; }
.member-invite-list,.member-list { display: grid; gap: 10px; }
.member-list h3 { margin: 12px 0 2px; }
.member-row { display: flex; justify-content: space-between; gap: 16px; align-items: center; padding: 14px 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.035); }
.member-row > div { display: flex; gap: 10px; align-items: baseline; }
@media (max-width: 760px) {
  .member-invite-form,.invite-result { grid-template-columns: 1fr; }
  .invite-inline-link { min-width: 0; width: 100%; }
  .member-row { align-items: flex-start; flex-direction: column; }
}

.text-link {
    color: var(--cyan);
    font-weight: 800;
    text-decoration: none;
}

.lightbox-open {
    overflow: hidden;
}

.image-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 58px 20px 20px;
    background: rgba(0, 0, 0, 0.86);
}

.image-lightbox[hidden] {
    display: none;
}

.image-lightbox img {
    max-width: min(1200px, 96vw);
    max-height: 86vh;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #05090d;
    object-fit: contain;
}

.lightbox-close {
    position: fixed;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--yellow);
    color: #05090d;
    font-size: 20px;
    font-weight: 900;
    cursor: pointer;
}

.report-admin-table input,
.report-admin-table select {
    min-width: 84px;
}

.inline-kill-field {
    display: block;
    min-width: 110px;
}

.inline-kill-field span {
    margin-bottom: 5px;
    color: var(--green);
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
}

.report-admin-table .button {
    min-height: 36px;
    padding: 0 12px;
}

.empty-state {
    grid-column: 1 / -1;
    align-items: flex-start;
}

code {
    color: var(--cyan);
}

.site-footer {
    width: min(1500px, calc(100% - 32px));
    margin: 0 auto;
    padding: 0 0 34px;
    text-align: center;
}

.site-footer a {
    color: var(--muted);
    font-size: 13px;
    text-decoration: none;
}

.site-footer a:hover {
    color: var(--cyan);
}

.impressum-page {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.impressum-page h2 {
    margin-top: 24px;
    margin-bottom: 10px;
    color: var(--text);
}

.impressum-page h2:first-child {
    margin-top: 0;
}

.impressum-page p {
    max-width: 980px;
    margin-bottom: 12px;
}

@media (max-width: 1000px) {
    .dashboard,
    .report-panel,
    .team-timer,
    .report-form,
    .form-grid,
    .placement-grid,
    .team-link-list label {
        grid-template-columns: 1fr;
    }

    .report-form,
    .team-switch,
    .wide-input {
        grid-column: auto;
        grid-row: auto;
    }

    .timer-controls {
        grid-template-columns: repeat(2, minmax(90px, 1fr));
    }
}

@media (max-width: 700px) {
    .page {
        width: min(100% - 20px, 1500px);
    }

    .nav,
    .section-head,
    .card-actions,
    .link-box {
        align-items: stretch;
        flex-direction: column;
    }

    .nav {
        align-items: flex-end;
        min-height: 72px;
    }

    .nav > .brand {
        top: 0;
        transform: translateX(-50%);
    }

    .brand img {
        width: 72px;
        height: 72px;
    }

    .hero,
    .hero.compact {
        min-height: 0;
    }

    .hero-copy {
        padding: 44px 0 30px;
    }

    .panel {
        padding: 16px;
    }

    .timer-display {
        min-width: 0;
        font-size: 28px;
    }
}
