:root {
    --ink: #17213b;
    --muted: #667085;
    --line: #e6e8f0;
    --paper: #ffffff;
    --soft: #f7f9fc;
    --brand: #1b3f8f;
    --brand-dark: #102b66;
    --mytorci-green: #07823b;
    --mytorci-green-dark: #056a31;
    --accent: #e74032;
    --accent-dark: #c92f24;
    --gold: #f6b338;
    --success: #0f8b5f;
    --error: #bd2a2a;
    --shadow: 0 18px 50px rgba(23, 33, 59, 0.16);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    background: var(--mytorci-green);
}

a {
    color: inherit;
}

.page {
    width: min(100%, 1120px);
    margin: 0 auto;
    padding: 28px 18px 46px;
}

.registration-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
}

.shell {
    width: min(100%, 470px);
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(27, 63, 143, 0.12);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 28px;
}

.logo {
    display: block;
    width: min(250px, 80%);
    height: auto;
    margin: 0 auto 18px;
}

h1,
h2,
h3 {
    margin: 0;
    line-height: 1.15;
}

.title {
    color: var(--mytorci-green);
    font-size: 38px;
    text-align: center;
}

.subtitle {
    color: var(--muted);
    text-align: center;
    margin: 10px 0 24px;
    line-height: 1.5;
}

.form-grid {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 7px;
    color: #27344f;
    font-weight: 700;
}

.label-text {
    display: inline-flex;
    align-items: baseline;
    gap: 3px;
}

input,
textarea {
    width: 100%;
    min-height: 48px;
    border: 1px solid #cfd6e6;
    border-radius: 7px;
    padding: 12px 13px;
    color: var(--ink);
    font: inherit;
    background: #fff;
}

textarea {
    resize: vertical;
    line-height: 1.4;
}

input:focus,
textarea:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(27, 63, 143, 0.18);
}

input[readonly] {
    color: var(--brand-dark);
    background: #f1f5ff;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.required {
    color: var(--accent);
}

.hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 400;
}

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

.form-grid > .actions {
    width: 100%;
}

.form-grid > .actions .btn-accent {
    width: 100%;
}

.btn,
button {
    border: 0;
    border-radius: 7px;
    min-height: 46px;
    padding: 12px 18px;
    color: #fff;
    background: var(--brand);
    font: 800 15px/1 Arial, Helvetica, sans-serif;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover,
button:hover {
    background: var(--brand-dark);
}

.btn-accent {
    background: var(--mytorci-green);
}

.btn-accent:hover {
    background: var(--mytorci-green-dark);
}

.btn-light {
    color: var(--brand-dark);
    background: #edf2ff;
}

.btn-light:hover {
    background: #dfe8ff;
}

.alert {
    border-radius: 7px;
    padding: 13px 14px;
    margin: 0 0 18px;
    font-weight: 700;
}

.alert-error {
    color: #7a1d1d;
    background: #ffe8e6;
    border: 1px solid #ffc4be;
}

.alert-success {
    color: #075f3d;
    background: #e7f8f0;
    border: 1px solid #bdebd5;
}

.error-dialog {
    border: 1px solid #ffc4be;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 34px rgba(189, 42, 42, 0.14);
    margin-bottom: 18px;
    overflow: hidden;
}

.error-dialog-title {
    color: #fff;
    background: var(--accent);
    font-weight: 900;
    padding: 12px 14px;
}

.error-dialog-body {
    color: #7a1d1d;
    background: #fff4f2;
    padding: 14px;
    font-weight: 700;
}

.success-mark {
    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    border-radius: 50%;
    color: #fff;
    background: var(--success);
    font-size: 34px;
    font-weight: 900;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
}

.topbar .logo {
    width: 190px;
    margin: 0;
}

.panel {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(27, 63, 143, 0.12);
    border-radius: 8px;
    box-shadow: 0 14px 36px rgba(23, 33, 59, 0.1);
    padding: 20px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.section-heading .title,
.section-heading .subtitle {
    text-align: left;
}

.section-heading .subtitle {
    margin-bottom: 0;
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.stat {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--paper);
}

.stat strong {
    display: block;
    color: var(--brand-dark);
    font-size: 28px;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--brand-dark);
    background: #f1f5ff;
    font-size: 13px;
    text-transform: uppercase;
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    border-radius: 999px;
    padding: 5px 10px;
    color: #075f3d;
    background: #e7f8f0;
    font-size: 12px;
    font-weight: 800;
}

.pill-off {
    color: #7a1d1d;
    background: #ffe8e6;
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.winner-stage {
    display: grid;
    gap: 18px;
    place-items: center;
    min-height: 300px;
    border: 2px solid rgba(246, 179, 56, 0.5);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(27, 63, 143, 0.1), rgba(231, 64, 50, 0.1)),
        #fff;
    padding: 28px;
    text-align: center;
}

.rolling-name {
    min-height: 92px;
    color: var(--brand-dark);
    font-size: 68px;
    font-weight: 900;
    line-height: 1;
    word-break: break-word;
}

.winner-meta {
    color: var(--muted);
    font-weight: 700;
}

.day-group {
    margin-top: 24px;
}

.day-title {
    color: var(--brand-dark);
    margin-bottom: 10px;
}

@media (max-width: 720px) {
    .shell,
    .panel {
        padding: 20px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .section-heading {
        flex-direction: column;
    }

    .actions,
    .btn,
    button {
        width: 100%;
    }

    .title {
        font-size: 30px;
    }

    .rolling-name {
        font-size: 38px;
    }
}
