:root {
    --bg: #10141b;
    --panel: #202734;
    --panel-dark: #111720;
    --line: #9aa5b2;
    --text: #f3f4f6;
    --muted: #b9c0ca;
    --accent: #f6df1c;
    --red: #ff1e24;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Georgia, "Times New Roman", serif;
}

body {
    overflow-x: hidden;
}

.stage {
    min-height: 100vh;
    padding: clamp(8px, .8vw, 14px) clamp(18px, 3.2vw, 70px) 0;
    background:
        linear-gradient(180deg, rgba(255,255,255,.06), transparent 10%),
        radial-gradient(circle at 50% 7%, rgba(255,255,255,.24), transparent 18%),
        linear-gradient(145deg, #252b35 0%, #111720 35%, #1d232d 100%);
}

.event-head {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 1.6vw, 26px);
}

.brand-plate {
    display: grid;
    place-items: center;
    min-width: min(39vw, 620px);
    padding: 6px 28px 5px;
    border: 3px solid #050505;
    background: var(--accent);
    box-shadow: 0 14px 38px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,255,255,.35);
    color: #141820;
    transform: skew(-1deg);
}

.mark {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(30px, 3.7vw, 58px);
    font-weight: 900;
    font-style: italic;
    line-height: .9;
}

.submark {
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(11px, 1.2vw, 20px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 10px;
}

.crest {
    width: clamp(40px, 4.8vw, 74px);
    height: clamp(40px, 4.8vw, 74px);
    border: 8px double rgba(210,220,230,.75);
    border-left-color: transparent;
    border-right-color: transparent;
    border-radius: 50%;
    opacity: .75;
}

.title-row {
    text-align: center;
    margin: clamp(10px, 1.2vw, 20px) 0 0;
}

.title-row h1 {
    margin: 0;
    font-size: clamp(36px, 4.2vw, 66px);
    line-height: .95;
    text-shadow: 0 4px 0 rgba(0,0,0,.55), 0 0 18px rgba(255,255,255,.22);
}

.clock {
    position: absolute;
    right: 0;
    bottom: calc(100% + 5px);
    display: inline-block;
    margin-top: 0;
    padding: 0 12px 3px;
    background: rgba(0,0,0,.72);
    font-size: clamp(18px, 1.65vw, 28px);
    font-weight: 700;
    text-shadow: 0 2px 0 #000;
}

.live-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(360px, .95fr);
    gap: clamp(22px, 3.2vw, 54px);
    align-items: stretch;
    margin-top: 40px;
}

.stream-area {
    position: relative;
    display: flex;
    padding-top: 0;
}

.live-badge {
    position: absolute;
    bottom: calc(100% + 5px);
    left: 18px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 5px 11px;
    border: 3px solid rgba(220,228,235,.72);
    background: linear-gradient(180deg, #8a252b, #441319);
    color: white;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
    animation: livePulse 1.1s ease-in-out infinite;
}

.live-badge span {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--red);
    box-shadow: 0 0 15px var(--red);
    animation: liveDot 1.1s ease-in-out infinite;
}

.metal-frame {
    width: 100%;
    padding: clamp(9px, 1.1vw, 17px);
    border-radius: 22px;
    background: linear-gradient(135deg, #d9e0e7, #59616c 35%, #303641 65%, #b9c2cd);
    box-shadow: 0 12px 24px rgba(0,0,0,.58), inset 0 0 0 2px rgba(255,255,255,.25);
}

.video-window {
    position: relative;
    height: 100%;
    min-height: min(31vw, 500px);
    overflow: hidden;
    border: 3px solid rgba(0,0,0,.8);
    border-radius: 15px;
    background:
        linear-gradient(rgba(0,0,0,.12), rgba(0,0,0,.28)),
        url("https://images.unsplash.com/photo-1542362567-b07e54358753?auto=format&fit=crop&w=1500&q=80") center / cover;
    box-shadow: inset 0 0 36px rgba(0,0,0,.75);
}

.video-window iframe,
.video-window video {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 10px;
    text-align: center;
    background: rgba(0,0,0,.28);
    font-family: Arial, Helvetica, sans-serif;
}

.placeholder strong {
    font-size: clamp(28px, 4vw, 56px);
    text-transform: uppercase;
}

.placeholder span {
    font-size: clamp(16px, 1.5vw, 24px);
}

.timing-panel {
    min-height: min(31vw, 500px);
    height: 100%;
    margin-top: 0;
    padding: clamp(20px, 2.2vw, 38px);
    border: 4px double rgba(180,194,210,.6);
    border-radius: 8px;
    background:
        radial-gradient(circle at 50% 100%, rgba(255,255,255,.16), transparent 22%),
        repeating-linear-gradient(45deg, rgba(255,255,255,.035) 0 2px, transparent 2px 6px),
        linear-gradient(180deg, #343c49, #111720);
    box-shadow: 0 0 24px rgba(175,220,255,.28), inset 0 0 40px rgba(0,0,0,.7);
}

.timing-panel h2 {
    margin: 0;
    text-align: center;
    font-size: clamp(31px, 3vw, 50px);
    text-shadow: 0 4px 0 rgba(0,0,0,.55);
}

.rule {
    height: 1px;
    margin: 24px 0 26px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}

.ranking {
    margin: 0;
    padding-left: 44px;
    font-size: clamp(23px, 2.35vw, 40px);
    font-weight: 700;
    line-height: 1.85;
    text-shadow: 0 3px 0 rgba(0,0,0,.55);
}

.ticker-wrap {
    margin-top: clamp(16px, 2vw, 30px);
}

.ticker {
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 8px;
    background: rgba(7,10,16,.72);
    box-shadow: inset 0 0 24px rgba(0,0,0,.65);
}

.ticker-track {
    display: flex;
    width: max-content;
    animation: ticker 32s linear infinite;
}

.ticker-track span {
    flex: 0 0 auto;
    padding: 13px 42px;
    font-size: clamp(17px, 1.35vw, 25px);
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 3px 0 rgba(0,0,0,.7);
}

.partners {
    min-height: 145px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: clamp(18px, 3vw, 46px);
    padding: clamp(18px, 2.3vw, 34px) 0;
    border-top: 1px solid rgba(255,255,255,.08);
    border-bottom: 1px solid rgba(255,255,255,.35);
}

.partners img {
    max-width: min(190px, 18vw);
    max-height: 82px;
    object-fit: contain;
    filter: drop-shadow(0 10px 14px rgba(0,0,0,.55));
}

.partner-placeholder {
    display: grid;
    place-items: center;
    min-width: 150px;
    height: 72px;
    padding: 0 16px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 6px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.86);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
}

.footer {
    padding: 14px 0 18px;
    color: rgba(255,255,255,.55);
    text-align: center;
    font-family: Arial, Helvetica, sans-serif;
    font-size: clamp(14px, 1.05vw, 20px);
}

.ticker-admin {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 20;
    width: min(420px, calc(100vw - 36px));
    padding: 18px;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 8px;
    background: #f4f6f8;
    color: #111720;
    font-family: Arial, Helvetica, sans-serif;
    box-shadow: 0 18px 50px rgba(0,0,0,.45);
}

.ticker-admin h2 {
    margin: 0 0 14px;
    font-size: 23px;
}

.ticker-admin label {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
    font-weight: 700;
}

.ticker-admin input,
.ticker-admin textarea {
    width: 100%;
    border: 1px solid #aab2bd;
    border-radius: 6px;
    padding: 10px;
    font: 16px Arial, Helvetica, sans-serif;
}

.ticker-admin button,
.admin-link {
    border: 0;
    border-radius: 6px;
    background: #161b24;
    color: white;
    font: 700 15px Arial, Helvetica, sans-serif;
    text-decoration: none;
    cursor: pointer;
}

.ticker-admin button {
    width: 100%;
    padding: 12px;
}

.logout-form {
    margin-top: 10px;
}

.logout-form button {
    background: #6e1620;
}

.admin-link {
    position: fixed;
    left: 14px;
    bottom: 14px;
    z-index: 19;
    padding: 9px 12px;
    opacity: .18;
}

.admin-link:focus,
.admin-link:hover {
    opacity: 1;
}

.notice {
    margin: 0 0 12px;
    padding: 10px;
    border-radius: 6px;
}

.notice.ok {
    background: #d8f5df;
}

.notice.error {
    background: #ffe0e0;
}

@keyframes ticker {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

@keyframes livePulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.55); }
}

@keyframes liveDot {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: .35;
        transform: scale(.78);
    }
}

@media (max-width: 980px) {
    .stage {
        padding-inline: 14px;
    }

    .live-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .timing-panel {
        min-height: 340px;
    }

    .partners {
        flex-wrap: wrap;
        min-height: 160px;
    }

    .crest {
        display: none;
    }

    .brand-plate {
        min-width: 0;
        width: min(720px, 100%);
    }
}

@media (max-width: 560px) {
    .submark {
        letter-spacing: 4px;
    }

    .live-badge {
        left: 10px;
        font-size: 18px;
    }

    .metal-frame {
        border-radius: 20px;
    }

    .video-window {
        border-radius: 12px;
    }

    .ranking {
        padding-left: 34px;
    }
}
