:root {
    color-scheme: dark;

    --bg: #09090b;
    --surface: #111114;
    --surface-2: #17171b;
    --surface-3: #1d1d22;
    --line: rgba(255, 255, 255, 0.075);
    --line-strong: rgba(255, 255, 255, 0.14);

    --text: #ededf0;
    --muted: #9a9aa6;
    --faint: #63636e;

    --accent: #6f9bff;
    --accent-bright: #a9c4ff;
    --accent-deep: #3f6dff;
    --danger: #ff6b6b;

    --radius: 16px;
    --radius-sm: 10px;

    --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    padding: clamp(1rem, 3vw, 2rem);
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

::selection {
    background: var(--accent-deep);
    color: #fff;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Background (dot grid + cursor light) ---------- */
.bg-grid {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bg-grid::before,
.bg-grid::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 1px, transparent 1.5px);
    background-size: 24px 24px;
    background-position: center;
}

.bg-grid::before {
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 20% 0%, #000 10%, transparent 75%);
    mask-image: radial-gradient(ellipse 80% 70% at 20% 0%, #000 10%, transparent 75%);
}

.bg-grid::after {
    background-image: radial-gradient(circle at center, var(--accent) 1px, transparent 1.6px);
    opacity: 0;
    transition: opacity 0.4s ease;
    -webkit-mask-image: radial-gradient(180px circle at var(--px, 50%) var(--py, 50%), #000, transparent 100%);
    mask-image: radial-gradient(180px circle at var(--px, 50%) var(--py, 50%), #000, transparent 100%);
}

.bg-grid.is-lit::after {
    opacity: 0.5;
}

.bg-glow {
    position: fixed;
    z-index: -2;
    pointer-events: none;
    width: 60rem;
    height: 40rem;
    left: -20rem;
    top: -22rem;
    background: radial-gradient(closest-side, rgba(63, 109, 255, 0.16), transparent);
    filter: blur(10px);
}

/* ---------- Layout ---------- */
.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.5rem 0 clamp(1.25rem, 3vw, 2rem);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.header-icon {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    transition: transform 0.5s var(--ease-spring);
}

.header-icon svg {
    width: 22px;
    height: 22px;
}

.header-brand:hover .header-icon {
    transform: rotate(-8deg) scale(1.06);
}

.header h1 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1;
}

.header-by {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font: 400 0.8rem/1 var(--font-mono);
    color: var(--faint);
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid transparent;
    transition:
        color 0.3s ease,
        border-color 0.3s ease;
}

.header-by svg {
    width: 14px;
    height: 14px;
    transition: transform 0.45s var(--ease-spring);
}

.header-by:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.header-by:hover svg {
    transform: translate(2px, -2px);
    color: var(--accent);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    align-items: start;
    counter-reset: section;
}

/* ---------- Panels (with cursor-lit border) ---------- */
.form-section,
.games-section,
.game-card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    isolation: isolate;
}

.form-section,
.games-section {
    padding: clamp(1.1rem, 2.5vw, 1.75rem);
}

.form-section::before,
.games-section::before,
.game-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), var(--accent), transparent 70%);
    mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask:
        linear-gradient(#000 0 0) content-box,
        linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.form-section:hover::before,
.games-section:hover::before,
.game-card:hover::before {
    opacity: 1;
}

/* The panel border dims while hovering a game card inside it */
.games-section:has(.game-card:hover)::before {
    opacity: 0.25;
}

.games-section {
    position: sticky;
    top: clamp(1rem, 3vw, 2rem);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 8.5rem);
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    counter-increment: section;
}

.section-title::before {
    content: counter(section, decimal-leading-zero);
    font: 500 0.75rem/1 var(--font-mono);
    color: var(--accent);
}

/* ---------- Form ---------- */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group > label,
.batch-date-time label {
    display: block;
    margin-bottom: 0.5rem;
    font: 500 0.72rem/1 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.form-group input:not([type="radio"]):not([type="checkbox"]),
.form-group select,
.referee-group input,
.text-popup textarea {
    width: 100%;
    height: 2.75rem;
    padding: 0 0.9rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--text);
    font: 400 0.95rem/1 var(--font-sans);
    transition:
        border-color 0.25s ease,
        box-shadow 0.25s ease,
        background-color 0.25s ease;
}

.form-group input:not([type="radio"]):not([type="checkbox"])::placeholder,
.referee-group input::placeholder,
.text-popup textarea::placeholder {
    color: var(--faint);
}

.form-group input:not([type="radio"]):not([type="checkbox"]):hover:not(:disabled),
.referee-group input:hover:not(:disabled),
.text-popup textarea:hover {
    border-color: rgba(255, 255, 255, 0.22);
}

.form-group input:not([type="radio"]):not([type="checkbox"]):focus,
.form-group select:focus,
.referee-group input:focus,
.text-popup textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px rgba(111, 155, 255, 0.18);
}

.form-group input:not([type="radio"]):not([type="checkbox"]):disabled,
.referee-group input:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.55;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* "U" prefix next to the age group input */
.age-prefix {
    display: grid;
    place-items: center;
    flex: none;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-2);
    font: 500 0.95rem/1 var(--font-mono);
    color: var(--muted);
}

/* Radios & checkboxes */
.radio-group,
.checkbox-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.radio-item,
.checkbox-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0 1rem 0 0.8rem;
    height: 2.6rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--surface-2);
    cursor: pointer;
    transition:
        border-color 0.25s ease,
        background-color 0.25s ease;
}

.radio-item:hover,
.checkbox-item:hover {
    border-color: rgba(255, 255, 255, 0.24);
}

.radio-item:has(input:checked),
.checkbox-item:has(input:checked) {
    border-color: rgba(111, 155, 255, 0.55);
    background: rgba(63, 109, 255, 0.12);
}

.radio-item label,
.checkbox-item label,
.batch-checkbox label {
    margin: 0;
    cursor: pointer;
    font-size: 0.92rem;
    font-weight: 400;
    color: var(--text);
}

/* Make the whole pill clickable */
.radio-item label::after,
.checkbox-item label::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

input[type="radio"],
input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid rgba(255, 255, 255, 0.3);
    background: transparent center / 12px no-repeat;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.25s var(--ease-spring),
        transform 0.3s var(--ease-spring);
}

input[type="checkbox"] {
    border-radius: 5px;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked {
    background-color: var(--accent-deep);
    border-color: var(--accent-deep);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}

input[type="radio"]:checked {
    border-color: var(--accent);
    box-shadow:
        inset 0 0 0 4px var(--bg),
        inset 0 0 0 10px var(--accent);
}

input[type="radio"]:active,
input[type="checkbox"]:active {
    transform: scale(0.85);
}

/* Referees */
.referees-section,
.batch-edit-section {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 14px;
}

.referees-section {
    padding: 1.1rem;
    margin-bottom: 1.25rem;
}

.referees-title,
.batch-edit-subtitle {
    font: 500 0.72rem/1 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
}

.referee-group {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.referee-group:last-child {
    margin-bottom: 0;
}

.referee-label {
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 2.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(111, 155, 255, 0.3);
    background: rgba(63, 109, 255, 0.1);
    font: 500 0.8rem/1 var(--font-mono);
    color: var(--accent-bright);
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease;
}

.referee-group:focus-within .referee-label {
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    color: #fff;
}

.referee-group input {
    background: var(--surface-3);
}

/* ---------- Buttons ---------- */
.btn-primary,
.btn-secondary,
.btn-edit,
.btn-delete,
.btn-copy,
.btn-blue,
.btn-red,
.btn-gray,
.btn-cyan {
    --fill: var(--text);
    --on: var(--bg);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 2.75rem;
    padding: 0 1.15rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface-2);
    color: var(--text);
    /* line-height = height, so labels stay centered when the script sets display: inline-block */
    font: 500 0.9rem/calc(2.75rem - 2px) var(--font-sans);
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition:
        color 0.3s ease,
        border-color 0.3s ease,
        opacity 0.2s ease,
        transform 0.4s var(--ease-spring);
}

/* Fill that sweeps up from the bottom on hover */
.btn-primary::before,
.btn-secondary::before,
.btn-edit::before,
.btn-delete::before,
.btn-copy::before,
.btn-blue::before,
.btn-red::before,
.btn-gray::before,
.btn-cyan::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--fill);
    border-radius: inherit;
    transform: translateY(101%);
    transition: transform 0.45s var(--ease-out);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-edit:hover,
.btn-delete:hover,
.btn-copy:hover,
.btn-blue:hover,
.btn-red:hover,
.btn-gray:hover,
.btn-cyan:hover {
    color: var(--on);
    border-color: var(--fill);
}

.btn-primary:hover::before,
.btn-secondary:hover::before,
.btn-edit:hover::before,
.btn-delete:hover::before,
.btn-copy:hover::before,
.btn-blue:hover::before,
.btn-red:hover::before,
.btn-gray:hover::before,
.btn-cyan:hover::before {
    transform: translateY(0);
}

.btn-primary:active,
.btn-secondary:active,
.btn-edit:active,
.btn-delete:active,
.btn-copy:active,
.btn-blue:active,
.btn-red:active,
.btn-gray:active,
.btn-cyan:active {
    transform: scale(0.96);
}

/* Main actions: solid blue */
.btn-primary,
.btn-copy {
    --fill: #fff;
    --on: var(--bg);
    background: var(--accent-deep);
    border-color: var(--accent-deep);
    color: #fff;
}

/* Secondary blue actions */
.btn-blue {
    --fill: var(--accent);
    --on: var(--bg);
    border-color: rgba(111, 155, 255, 0.45);
    color: var(--accent-bright);
}

/* Destructive */
.btn-red,
.btn-delete {
    --fill: var(--danger);
    --on: #1a0606;
    border-color: rgba(255, 107, 107, 0.35);
    color: #ff9b9b;
}

.btn-secondary,
.btn-gray {
    background: transparent;
}

/* Compact buttons inside game cards and the selection popup */
.btn-edit,
.btn-delete,
.btn-cyan {
    height: 2.1rem;
    line-height: calc(2.1rem - 2px);
    padding: 0 0.9rem;
    font-size: 0.82rem !important;
}

.btn-edit,
.btn-cyan {
    background: transparent;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.form-actions .btn-primary[type="submit"] {
    flex: 1 1 10rem;
}

/* ---------- Games list ---------- */
.games-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin: 0 -0.5rem;
    padding: 2px 0.5rem;
}

.game-card {
    padding: 1.1rem 1.15rem;
    margin-bottom: 0.75rem;
    background: var(--surface-2);
    transition:
        transform 0.5s var(--ease-out),
        background-color 0.3s ease;
}

.game-card:hover {
    transform: translateY(-2px);
    background: var(--surface-3);
}

.game-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 0.9rem;
}

.game-number {
    font: 500 0.72rem/1 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    background: rgba(63, 109, 255, 0.12);
    border: 1px solid rgba(111, 155, 255, 0.25);
}

.game-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem 1rem;
    margin-bottom: 0.9rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.detail-label {
    font: 400 0.7rem/1.2 var(--font-mono);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--faint);
}

.detail-value {
    font-size: 0.95rem;
    color: var(--text);
}

.game-badges {
    display: flex;
    gap: 0.4rem;
    margin: 0 0 0.9rem;
}

.badge {
    font: 400 0.72rem/1 var(--font-mono);
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    color: var(--muted);
    border: 1px solid var(--line-strong);
}

.referees-display {
    padding: 0.85rem 0.95rem;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--line);
}

.referees-display h4 {
    margin-bottom: 0.6rem;
    font: 500 0.7rem/1 var(--font-mono);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--faint);
}

.referee-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.92rem;
    color: var(--text);
    margin-bottom: 0.35rem;
}

.referee-item:last-child {
    margin-bottom: 0;
}

.referee-badge {
    display: inline-grid;
    place-items: center;
    min-width: 2.4rem;
    padding: 0.25rem 0.4rem;
    border-radius: 5px;
    font: 500 0.7rem/1 var(--font-mono);
    color: var(--accent-bright);
    background: rgba(63, 109, 255, 0.12);
}

.game-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.empty-state {
    display: grid;
    place-items: center;
    min-height: 10rem;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--faint);
    border: 1px dashed var(--line-strong);
    border-radius: 14px;
}

/* ---------- Popups ---------- */
@keyframes popup-in {
    from {
        opacity: 0;
        transform: translate(-50%, -47%) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
}

.dimmer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    animation: fade-in 0.3s ease both;
    transition: background-color 0.3s ease;
}

.text-popup,
.batch-edit-popup,
.game-selection-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
    animation: popup-in 0.45s var(--ease-out) both;
}

.text-popup {
    z-index: 1001;
    width: min(92vw, 600px);
    padding: 1.5rem;
}

.text-popup-content {
    max-height: min(70vh, 520px);
    overflow-y: auto;
}

.text-popup h4,
.batch-edit-title,
.game-selection-title {
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--text);
    margin-bottom: 1rem;
}

.text-popup p {
    color: var(--muted) !important;
}

.text-popup pre {
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 1rem;
    border-radius: 12px;
    font: 400 0.82rem/1.65 var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
    color: var(--text);
}

.text-popup textarea {
    height: 200px;
    padding: 0.9rem;
    background: var(--bg);
    font: 400 0.85rem/1.6 var(--font-mono);
    resize: vertical;
}

.batch-edit-popup {
    z-index: 1001;
    width: min(92vw, 780px);
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.batch-edit-content {
    padding: 1.75rem;
    overflow-y: auto;
    flex: 1;
}

.batch-edit-section {
    margin-bottom: 1rem;
    padding: 1.15rem;
}

.batch-edit-section p {
    color: var(--faint) !important;
    line-height: 1.6;
}

.batch-date-time {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.batch-checkbox {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.batch-edit-section .form-group input:not([type="radio"]):not([type="checkbox"]),
.batch-edit-section .referee-group input {
    background: var(--surface-3);
}

.batch-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
}

.batch-actions-right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.game-selection-popup {
    z-index: 1002;
    width: min(92vw, 500px);
    max-height: 75vh;
    overflow-y: auto;
    padding: 1.5rem;
}

.game-selection-controls {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.9rem;
}

.game-selection-list {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.4rem;
    margin-bottom: 1.25rem;
    border-radius: 14px;
    background: var(--bg);
    border: 1px solid var(--line);
}

.game-selection-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    border: 1px solid transparent;
    transition:
        background-color 0.2s ease,
        border-color 0.2s ease;
}

.game-selection-item:hover {
    background: var(--surface-2);
}

.game-selection-item:has(input:checked) {
    background: rgba(63, 109, 255, 0.1);
    border-color: rgba(111, 155, 255, 0.25);
}

.game-selection-info {
    flex: 1;
    font-size: 0.9rem;
}

.game-selection-time {
    font-weight: 500;
    color: var(--text);
}

.game-selection-details {
    font: 400 0.76rem/1.4 var(--font-mono);
    color: var(--faint);
    margin-top: 2px;
}

/* ---------- Scrollbars ---------- */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ---------- Page-enter animation ---------- */
@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

.header {
    animation: rise 0.7s var(--ease-out) both;
}

.form-section {
    animation: rise 0.8s var(--ease-out) 0.08s both;
}

.games-section {
    animation: rise 0.8s var(--ease-out) 0.16s both;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .games-section {
        position: static;
        max-height: none;
    }

    .games-list {
        overflow-y: visible;
    }

    .batch-date-time {
        grid-template-columns: 1fr;
    }

    .batch-actions,
    .batch-actions-right {
        justify-content: stretch;
    }
}

@media (max-width: 480px) {
    .header-by span {
        display: none;
    }

    .game-details {
        grid-template-columns: 1fr;
    }

    .game-actions > * {
        flex: 1;
    }

    .batch-edit-content,
    .text-popup,
    .game-selection-popup {
        padding: 1.1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
