
@import url('https://fonts.googleapis.com/css2?family=VT323&family=Share+Tech+Mono&display=swap');

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

::-webkit-scrollbar {
    display: none;
}

html, body {
    padding: 0;
    margin: 0;
    height: 100%;
    overflow: hidden;
}

html {
    font-size: clamp(16px, 1.1vw, 32px);
}

body {
    background-color: #111811;
    font-family: 'VT323', 'Courier New', monospace;
    color: #44ff44;
    position: relative;
}

/* Scanlines — subtle, projector-friendly */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(51, 255, 51, 0.008) 0px,
        rgba(51, 255, 51, 0.008) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100;
}

.logo {
    display: block;
    margin: 0.2vh auto 0.2vh auto;
    height: clamp(100px, 15vh, 210px);
    width: auto;
    position: relative;
    z-index: 1;
    filter: brightness(1.2) saturate(0) sepia(1) hue-rotate(70deg) saturate(3);
}

.container {
    display: flex;
    justify-content: space-evenly;
    margin-top: 0.2vh;
    height: calc(97vh - clamp(100px, 15vh, 210px));
    position: relative;
    z-index: 1;
}

.column {
    width: 46vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 0 1vw;
    justify-content: flex-start;
}

.column-header {
    color: #44ff44;
    font-family: 'VT323', monospace;
    font-weight: 400;
    letter-spacing: 0.2em;
    font-size: clamp(0.8em, 1.1vw, 1.3em);
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 0.4em;
    text-shadow: 0 0 6px #44ff44, 0 0 12px rgba(68, 255, 68, 0.4);
    position: relative;
}

.column-header::after {
    content: '════════════════════════════════';
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    margin: 0.2em auto 0;
    color: #33bb33;
    font-size: 0.7em;
    text-shadow: none;
}

/* Loading */
#loading {
    width: clamp(80px, 10vw, 160px);
    position: relative;
    top: 10em;
    opacity: 0.7;
    filter: hue-rotate(70deg) saturate(3);
}

/* Scoreboard */
#scoreboard {
    width: 100%;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
}

/* Team rows */
.team {
    color: #44ff44;
    margin-bottom: clamp(0.2em, 0.4vw, 0.5em);
    padding: 0.3em 0.8em;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: none;
    border-bottom: 1px solid #33bb33;
    background: transparent;
    transition: background 0.1s;
}

.team:hover {
    background: rgba(68, 255, 68, 0.07);
}

/* Podium — subtle brightness differences (monochrome) */
.team:nth-child(1) {
    background: rgba(68, 255, 68, 0.08);
}

.team:nth-child(1) .team-position {
    color: #66ff66;
    text-shadow: 0 0 12px #44ff44;
}

.team:nth-child(2) .team-position {
    color: #44ff44;
    text-shadow: 0 0 8px #44ff44;
}

.team:nth-child(3) .team-position {
    color: #44ff44;
    text-shadow: 0 0 6px #44ff44;
}

.team-position {
    color: #44ff44;
    font-family: 'VT323', monospace;
    font-weight: 400;
    font-size: 1.3em;
    min-width: 2em;
    text-align: right;
    margin-right: 0.8em;
    padding-right: 0.8em;
    border-right: 1px solid #33bb33;
}

.team-contents {
    display: flex;
    align-items: center;
    flex: 1;
}

.team-name {
    font-size: clamp(1em, 1.4vw, 1.6em);
    letter-spacing: 1px;
    color: #44ff44;
    font-family: 'VT323', monospace;
    font-weight: 400;
    text-transform: uppercase;
}

.team-solved {
    color: #33bb33;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: clamp(0.55em, 0.7vw, 0.7em);
    font-family: 'VT323', monospace;
}

.team-score {
    font-family: 'VT323', monospace;
    font-weight: 400;
    font-size: clamp(1.4em, 2.2vw, 2.5em);
    color: #44ff44;
    text-shadow: 0 0 8px rgba(68, 255, 68, 0.6);
    white-space: nowrap;
}

/* Right column */
.column-2 {
    display: flex;
    flex-direction: column;
    gap: 0.5vh;
    justify-content: stretch;
}

/* Clock */
#clockdiv {
    color: #44ff44;
    display: flex;
    justify-content: center;
    gap: clamp(3px, 0.3vw, 8px);
    font-size: clamp(1.2em, 1.8vw, 2.2em);
}

#clockdiv > div {
    padding: clamp(4px, 0.4vw, 8px);
    border: 1px solid #33bb33;
    background: #0d120d;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 3em;
}

#clockdiv div > span {
    font-family: 'VT323', monospace;
    font-weight: 400;
    padding: 0.1em 0.3em;
    display: inline-block;
    color: #44ff44;
    text-shadow: 0 0 8px #44ff44;
    font-size: 1.3em;
}

.smalltext {
    padding-top: 0.3em;
    font-size: clamp(8px, 0.6vw, 14px);
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #33bb33;
    font-family: 'VT323', monospace;
}

/* Trend Graph */
#trendgraph {
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid #33bb33;
    background: #0d120d;
    padding: 0.5em;
}

#trendgraph .column-header {
    margin-bottom: 0.3em;
    font-size: clamp(0.7em, 0.9vw, 1.1em);
}

#trendCanvas {
    flex: 1;
    min-height: 0;
    width: 100% !important;
}

/* Latest Submissions */
#latest {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    width: 100%;
    border: 1px solid #33bb33;
    background: #0d120d;
    padding: 0.5em;
}

#latest .column-header {
    font-size: clamp(0.7em, 0.9vw, 1.1em);
    margin-bottom: 0.4em;
}

#latest table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.9em, 1.1vw, 1.3em);
}

#latest td {
    padding: 0.2em 0.5em;
    border: none;
    border-bottom: 1px solid #1a6e1a;
    color: #44ff44;
}

#latest tr:hover {
    background: rgba(68, 255, 68, 0.06);
}

#latest td:first-child {
    color: #44ff44;
    font-family: 'VT323', monospace;
    font-size: 1.1em;
}

#latest td:nth-child(2) {
    color: #44ff44;
}

#latest td:last-child {
    color: #33bb33;
    font-size: 0.85em;
}

/* Notifications */
#notifications-box {
    width: 100%;
    flex: 1;
    min-height: 0;
    border: 1px solid #33bb33;
    background: #0d120d;
    padding: 0.4em 0.8em;
    display: flex;
    flex-direction: column;
}

#notifications-box .column-header {
    font-size: clamp(0.7em, 0.9vw, 1.1em);
    margin-bottom: 0.3em;
    letter-spacing: 0.15em;
}

#notifications-box .column-header::after {
    display: none;
}

#notifications-content {
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

.notif-item {
    padding: 0.3em 0;
    border-bottom: 1px solid #1a6e1a;
    font-size: clamp(1em, 1.3vw, 1.5em);
    color: #44ff44;
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-title {
    color: #44ff44;
    font-family: 'VT323', monospace;
    font-weight: 400;
    font-size: 1em;
    margin-right: 0.5em;
    text-transform: uppercase;
}

.notif-title::before {
    content: '> ';
}

.notif-text {
    color: #33dd33;
}

.notif-empty {
    color: #33bb33;
    font-style: normal;
}

/* Timer page */
.timer-middle {
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

/* Footer */
footer {
    color: #33bb33;
    font-family: 'VT323', monospace;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: clamp(10px, 0.8vw, 16px);
    position: fixed;
    bottom: 0.5vh;
    right: 1vw;
    z-index: 10;
}

/* Animations */
@keyframes fade-in-up {
    from { opacity: 0; }
    to { opacity: 1; }
}

.team {
    animation: fade-in-up 0.2s ease forwards;
}



/* 4K specific adjustments */
@media (min-width: 2560px) {
    html {
        font-size: clamp(20px, 1vw, 40px);
    }

    .team {
        padding: 0.4em 1.2em;
        margin-bottom: 0.5em;
    }

    #clockdiv > div {
        min-width: 3.5em;
    }

    .logo {
        height: clamp(120px, 15vh, 240px);
    }
}

@media (min-width: 3840px) {
    html {
        font-size: clamp(26px, 0.9vw, 48px);
    }

    .team {
        padding: 0.5em 1.5em;
    }
}
