
:root {
    color-scheme: dark;
    --gold: #f5ce78;
    --red: #c51d32;
    --green: #164c35;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, sans-serif;
    color: #fff;
    background:
        radial-gradient(ellipse at 50% 85%,
        #254237 0%, transparent 55%),
        linear-gradient(180deg, #07111f, #101e29);
}

#app {
    max-width: 1920px;
    margin: auto;
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

header {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
}

h1 {
    margin: 0;
    font-size: clamp(24px, 4vw, 64px);
    letter-spacing: 2px;
    color: var(--gold);
    text-shadow: 0 0 25px #c68c4055;
}

h2 {
    letter-spacing: 5px;
    font-size: clamp(14px, 2vw, 24px);
}

#dashboard {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.team-card {
    position: relative;
    text-align: center;
    padding: 12px;
    border-radius: 16px;
    border: 1px solid #cda45d66;
    background: linear-gradient(
        180deg, #10263855, #07140fee
    );
    box-shadow: 0 12px 30px #0006;
}

.team-card.leader {
    border-color: var(--gold);
    box-shadow: 0 0 30px #ffce6044;
}

.tree {
    width: 100%;
    aspect-ratio: 3 / 4;
    position: relative;
}

.tree svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.ornament {
    animation: appear 0.8s ease-out;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ornament-count {
    font-size: clamp(24px, 3vw, 48px);
    font-weight: bold;
    color: var(--gold);
}

#ranking, #timer, #workouts,
#team-panel, #admin-panel {
    border: 1px solid #b48b4c66;
    border-radius: 16px;
    padding: 20px;
    background: #09131ee8;
}

section:empty {
    display: none !important;
}

#timer {
    text-align: center;
}

.timer-value {
    font-size: clamp(48px, 7vw, 110px);
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--gold);
}

#team-panel, #admin-panel {
    grid-column: 1 / -1;
}

button, input, select {
    font: inherit;
    padding: 14px;
    border-radius: 8px;
    border: 1px solid #ffffff33;
}

button {
    background: var(--red);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

input, select {
    background: #142432;
    color: white;
    max-width: 100%;
}

@media (max-width: 900px) {
    #dashboard {
        grid-template-columns: repeat(3, 1fr);
    }
    #app {
        grid-template-columns: 1fr;
        padding: 12px;
    }
}

@media (max-width: 500px) {
    #dashboard {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

[hidden] {
    display: none !important;
}

.team-card h3 {
    overflow-wrap: anywhere;
    color: #f5ce78;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#team-panel {
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

#team-panel button {
    width: 100%;
    margin-top: 12px;
}

#admin-panel {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

#admin-panel button {
    min-height: 48px;
}

#admin-panel pre {
    overflow-wrap: anywhere;
}

input, select {
    min-height: 48px;
}

hr {
    border: 0;
    border-top: 1px solid #ffffff22;
    margin: 25px 0;
}
