:root {
    --bg: #050d1b;
    --bg-soft: #0a1f3f;
    --card: rgba(9, 23, 46, 0.65);
    --line: rgba(109, 176, 255, 0.2);
    --text: #eaf4ff;
    --muted: #aac6e6;
    --accent: #3db9ff;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: Inter, Segoe UI, Roboto, Arial, sans-serif;
    color: var(--text);
    background: radial-gradient(1000px 560px at 20% 5%, #10356b 0, transparent 65%),
        radial-gradient(900px 540px at 80% 90%, #0c2a53 0, transparent 65%),
        linear-gradient(180deg, #030712, var(--bg));
    overflow-x: hidden;
    overflow-y: auto;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: -20%;
    pointer-events: none;
    z-index: 0;
}

body::before {
    background: radial-gradient(700px 360px at 15% 8%, rgba(61, 185, 255, 0.1), transparent 64%),
        radial-gradient(640px 300px at 88% 90%, rgba(95, 145, 255, 0.08), transparent 68%);
    filter: blur(34px);
    opacity: 0.88;
}

body::after {
    background: radial-gradient(1200px 520px at 50% 100%, rgba(11, 28, 54, 0.44), transparent 68%);
    opacity: 0.7;
}

#bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.8;
}

.shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    position: relative;
    z-index: 1;
}

.panel {
    width: min(1040px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), 0 2px 0 rgba(255, 255, 255, 0.04) inset;
    animation: panelIn 650ms ease-out;
    position: relative;
    overflow: visible;
}

.panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 22%),
        radial-gradient(300px 140px at 12% 0%, rgba(120, 170, 255, 0.12), transparent 70%);
    opacity: 0.75;
    pointer-events: none;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
}

.brand p {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 14px rgba(61, 185, 255, 0.9);
    animation: statusPulse 2.8s ease-in-out infinite;
}

.status {
    font-size: 12px;
    color: var(--muted);
}

select {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 10px;
    outline: none;
}

.content {
    padding: 30px 26px 14px;
    position: relative;
}

h1 {
    margin: 0;
    font-size: clamp(34px, 5.2vw, 56px);
    letter-spacing: 0.3px;
    line-height: 1.06;
}

.lead {
    margin: 16px 0 0;
    color: var(--muted);
    max-width: 70ch;
    line-height: 1.55;
    font-size: clamp(15px, 1.9vw, 18px);
}

[data-i18n-type="1"] {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
    position: relative;
}

[data-i18n-type="1"].console-line {
    opacity: 0.95;
}

[data-i18n-type="1"].console-line::before {
    content: "> ";
    color: var(--accent);
    opacity: 0.92;
}

[data-i18n-type="1"].typing::after {
    content: "_";
    margin-left: 2px;
    color: var(--accent);
    animation: cursorBlink 0.8s steps(1) infinite;
}

.countdown,
.progress {
    margin-top: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.live-console {
    margin-top: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 0;
    background: rgba(4, 12, 24, 0.78);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.live-console-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(109, 176, 255, 0.18);
    background: rgba(255, 255, 255, 0.02);
}

.live-console-head::after {
    content: "LIVE";
    margin-left: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
    font-size: 11px;
    letter-spacing: 0.8px;
    color: #9dd8ff;
    border: 1px solid rgba(109, 176, 255, 0.35);
    background: rgba(24, 105, 173, 0.2);
    border-radius: 999px;
    padding: 2px 8px;
    animation: none;
}

.live-console-head h2 {
    margin: 0 0 0 6px;
    font-size: 13px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.light {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.light.red {
    background: #ff5f56;
}

.light.yellow {
    background: #ffbd2e;
}

.light.green {
    background: #27c93f;
}

.live-log {
    list-style: none;
    margin: 0;
    padding: 12px 14px;
    min-height: 160px;
    max-height: 170px;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
    font-size: 13px;
}

.live-log-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: #b7d7f8;
    padding: 3px 0;
    opacity: 0;
    transform: translateY(6px);
    animation: logIn 260ms ease forwards;
}

.live-log-item .level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    font-size: 10px;
    letter-spacing: 0.7px;
    font-weight: 700;
    border-radius: 999px;
    padding: 2px 6px;
    border: 1px solid transparent;
}

.live-log-item .level-badge.level-info {
    color: #8fd4ff;
    background: rgba(66, 153, 225, 0.18);
    border-color: rgba(66, 153, 225, 0.35);
}

.live-log-item .level-badge.level-warn {
    color: #ffd989;
    background: rgba(235, 171, 60, 0.18);
    border-color: rgba(235, 171, 60, 0.35);
}

.live-log-item .level-badge.level-ok {
    color: #aef3c0;
    background: rgba(57, 195, 108, 0.18);
    border-color: rgba(57, 195, 108, 0.34);
}

.live-log-item.level-warn .message {
    color: #f6ddb1;
}

.live-log-item.level-ok .message {
    color: #c6f5d4;
}

.live-log-item .time {
    color: #79b8ee;
    opacity: 0.9;
}

.live-log-item .prompt {
    color: var(--accent);
}

.live-log-item .message.typing::after {
    content: "_";
    margin-left: 2px;
    color: var(--accent);
    animation: cursorBlink 0.8s steps(1) infinite;
}

h2 {
    margin: 0 0 14px;
    font-size: 16px;
    color: #c9e4ff;
    font-weight: 600;
}

.timer {
    display: grid;
    grid-template-columns: repeat(4, minmax(84px, 1fr));
    gap: 12px;
}

.time-box {
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 10px;
    background: rgba(0, 0, 0, 0.16);
    transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.time-box:hover {
    transform: translateY(-2px);
    border-color: rgba(109, 176, 255, 0.34);
    background: rgba(0, 0, 0, 0.2);
}

.time-box:nth-child(2) {
    animation-delay: 140ms;
}

.time-box:nth-child(3) {
    animation-delay: 240ms;
}

.time-box:nth-child(4) {
    animation-delay: 340ms;
}

.time-box span {
    display: block;
    font-size: clamp(24px, 3.4vw, 36px);
    font-weight: 700;
}

.time-box small {
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.eta {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.progress ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
    color: var(--muted);
}

.progress li {
    transform: translateX(0);
    transition: transform 250ms ease, color 250ms ease;
}

.progress li:hover {
    transform: translateX(4px);
    color: #d4e8ff;
}

.foot {
    padding: 16px 26px 24px;
    color: #9fc4e8;
    font-size: 14px;
}

.lang-native {
    display: none;
}

.lang-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-left: 4px;
}

.lang-pill {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
    border-radius: 14px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translateY(8px) scale(0.96);
    animation: pillIn 380ms ease forwards;
    transition: transform 180ms ease, color 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.lang-pill img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.lang-pill:nth-child(1) {
    animation-delay: 60ms;
}

.lang-pill:nth-child(2) {
    animation-delay: 120ms;
}

.lang-pill:nth-child(3) {
    animation-delay: 180ms;
}

.lang-pill:nth-child(4) {
    animation-delay: 240ms;
}

.lang-pill:nth-child(5) {
    animation-delay: 300ms;
}

.lang-pill:hover {
    transform: translateY(-2px) scale(1.03);
    color: var(--text);
    border-color: rgba(109, 176, 255, 0.62);
    filter: saturate(1.1);
}

.lang-pill.is-active {
    color: var(--text);
    border-color: rgba(61, 185, 255, 0.7);
    background: rgba(61, 185, 255, 0.24);
    box-shadow: 0 0 0 1px rgba(61, 185, 255, 0.24), 0 10px 20px rgba(9, 33, 64, 0.5);
    transform: translateY(-1px);
}

.lang-pill::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    top: calc(100% + 8px);
    transform: translate(-50%, -6px);
    font-size: 11px;
    line-height: 1;
    letter-spacing: 0.2px;
    color: #d9edff;
    background: rgba(4, 16, 32, 0.96);
    border: 1px solid rgba(109, 176, 255, 0.34);
    border-radius: 8px;
    padding: 6px 8px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms ease, transform 160ms ease;
    z-index: 10;
}

.lang-pill:hover::after,
.lang-pill:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

.live-tools {
    display: none;
}

.mini-game {
    margin-top: 26px;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.game-hint {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.game-row {
    margin-top: 14px;
    display: grid;
    grid-template-columns: minmax(120px, auto) minmax(90px, 120px) auto;
    align-items: center;
    gap: 10px;
}

.game-question {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
    color: #d4e8ff;
    font-size: 16px;
}

#gameAnswer {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    padding: 9px 10px;
    font-size: 14px;
    outline: none;
}

#gameAnswer:focus-visible {
    border-color: rgba(61, 185, 255, 0.66);
    box-shadow: 0 0 0 3px rgba(61, 185, 255, 0.18);
}

#gameCheck {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(61, 185, 255, 0.16);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    padding: 9px 14px;
    cursor: pointer;
    transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

#gameCheck:hover {
    transform: translateY(-1px);
    border-color: rgba(61, 185, 255, 0.66);
    background: rgba(61, 185, 255, 0.25);
}

.game-feedback {
    min-height: 24px;
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.contact-reveal {
    margin: 8px 0 0;
    font-size: 14px;
    color: #d8eaff;
}

.contact-reveal a {
    color: var(--accent);
    text-decoration: none;
    margin-left: 8px;
    border-bottom: 1px solid rgba(61, 185, 255, 0.34);
}

.contact-reveal a:hover {
    border-bottom-color: rgba(61, 185, 255, 0.86);
}

.content>section {
    opacity: 0;
    transform: translateY(8px);
    animation: sectionRise 650ms ease forwards;
}

.content>section:nth-child(3) {
    animation-delay: 90ms;
}

.content>section:nth-child(4) {
    animation-delay: 160ms;
}

.content>section:nth-child(5) {
    animation-delay: 230ms;
}

.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(700px 320px at 10% 0%, rgba(61, 185, 255, 0.1), transparent 60%);
    opacity: 0.45;
    animation: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.75;
        box-shadow: 0 0 10px rgba(61, 185, 255, 0.45);
    }

    50% {
        opacity: 1;
        box-shadow: 0 0 14px rgba(61, 185, 255, 0.75);
    }
}

@keyframes panelIn {
    from {
        transform: translateY(18px) scale(0.985);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@media (max-width: 760px) {
    body {
        overflow-y: auto;
    }

    .shell {
        padding: 14px;
        align-items: start;
    }

    .panel {
        border-radius: 18px;
        width: min(760px, 100%);
    }

    .top {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .controls {
        width: 100%;
        align-items: flex-start;
        flex-direction: column;
    }

    .lang-bar {
        width: 100%;
        margin-left: 0;
    }

    .content {
        padding: 22px 16px 10px;
    }

    h1 {
        font-size: clamp(30px, 9vw, 42px);
    }

    .lead {
        font-size: 15px;
    }

    .timer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .countdown,
    .live-console,
    .progress,
    .mini-game {
        margin-top: 20px;
        padding: 16px;
        border-radius: 14px;
    }

    .live-console {
        padding: 0;
    }

    .game-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    #gameCheck,
    #gameAnswer {
        width: 100%;
    }

    .foot {
        padding: 14px 16px 18px;
    }
}

@media (max-width: 460px) {
    .brand {
        align-items: flex-start;
    }

    .logo {
        width: 40px;
        height: 40px;
    }

    .brand p {
        font-size: 12px;
    }

    .lang-pill {
        width: 42px;
        height: 42px;
    }

    .lang-pill::after {
        display: none;
    }

    .time-box span {
        font-size: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}

@keyframes cursorBlink {

    0%,
    45% {
        opacity: 1;
    }

    46%,
    100% {
        opacity: 0;
    }
}

@keyframes logIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes sectionRise {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pillIn {
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== Modern Operations Layout Overrides ===== */

body {
    background:
        radial-gradient(1200px 700px at 12% -8%, rgba(50, 122, 255, 0.2), transparent 60%),
        radial-gradient(900px 560px at 100% 100%, rgba(61, 185, 255, 0.14), transparent 62%),
        linear-gradient(180deg, #060b14 0%, #040913 100%);
}

#bg {
    opacity: 0.46;
}

.shell {
    padding: 22px;
    place-items: start center;
}

.panel {
    width: min(1220px, 100%);
    border-radius: 18px;
    border-color: rgba(92, 154, 224, 0.24);
    background: linear-gradient(180deg, rgba(9, 17, 31, 0.9), rgba(7, 14, 26, 0.86));
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.44), 0 1px 0 rgba(255, 255, 255, 0.05) inset;
}

.panel::before,
.panel::after {
    animation: none;
}

.panel::before {
    background:
        linear-gradient(180deg, rgba(120, 182, 255, 0.06), transparent 26%),
        linear-gradient(90deg, rgba(61, 185, 255, 0.12), rgba(61, 185, 255, 0));
    opacity: 0.42;
}

.panel::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(420px 180px at 18% -10%, rgba(93, 176, 255, 0.18), transparent 68%);
    opacity: 0.32;
    animation: panelAura 9s ease-in-out infinite;
}

.top {
    padding: 14px 18px;
    background: rgba(0, 0, 0, 0.28);
    border-bottom: 1px solid rgba(92, 154, 224, 0.24);
}

.brand strong {
    font-size: 15px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.brand p {
    margin-top: 4px;
    font-size: 12px;
}

.controls {
    gap: 14px;
}

.status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(111, 196, 255, 0.3);
    background: rgba(20, 50, 82, 0.24);
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.content {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    grid-template-areas:
        "title title"
        "lead lead"
        "countdown live"
        "progress live"
        "game live";
    gap: 16px;
    padding: 24px 22px 20px;
}

h1 {
    grid-area: title;
    font-size: clamp(34px, 4.2vw, 52px);
    margin: 0;
    letter-spacing: 0.01em;
    line-height: 1.05;
}

.lead {
    grid-area: lead;
    margin: 6px 0 4px;
    max-width: 82ch;
    line-height: 1.62;
    font-size: clamp(15px, 1.3vw, 18px);
}

.card {
    margin-top: 0;
    border: 1px solid rgba(96, 160, 236, 0.2);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(13, 22, 38, 0.82), rgba(8, 16, 30, 0.76));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.card h2 {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b7dfff;
    margin-bottom: 10px;
}

.card-countdown {
    grid-area: countdown;
}

.card-progress {
    grid-area: progress;
}

.card-game {
    grid-area: game;
}

.card-live {
    grid-area: live;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.live-log {
    max-height: none;
    min-height: 380px;
}

.timer {
    gap: 10px;
}

.time-box {
    border-radius: 11px;
    border-color: rgba(106, 170, 239, 0.2);
}

.time-box span {
    font-size: clamp(22px, 2.7vw, 34px);
}

.progress ul {
    padding-left: 16px;
}

.progress li {
    font-size: 14px;
}

.game-row {
    grid-template-columns: minmax(130px, auto) minmax(110px, 132px) auto;
}

.foot {
    border-top: 1px solid rgba(92, 154, 224, 0.2);
    padding-top: 14px;
    color: #8ab3d9;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.lang-pill::after {
    max-width: 170px;
    white-space: normal;
    text-align: center;
}

@media (max-width: 980px) {
    .content {
        grid-template-columns: 1fr;
        grid-template-areas:
            "title"
            "lead"
            "countdown"
            "live"
            "progress"
            "game";
        gap: 14px;
    }

    .live-log {
        min-height: 260px;
    }

    .content {
        padding: 18px 16px 16px;
    }
}

@media (max-width: 760px) {
    .shell {
        padding: 12px;
    }

    .panel {
        border-radius: 14px;
    }

    .top {
        padding: 12px;
    }

    .content {
        padding: 14px 12px 12px;
    }

    h1 {
        font-size: clamp(30px, 8.6vw, 40px);
    }

    .lead {
        font-size: 14px;
        line-height: 1.58;
    }

    .controls {
        gap: 10px;
    }

    .lang-bar {
        gap: 8px;
    }

    .lang-pill {
        width: 40px;
        height: 40px;
    }

    .timer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .card {
        padding: 15px;
        border-radius: 12px;
    }

    .live-console {
        padding: 0;
    }

    .live-console-head {
        padding: 10px 12px;
    }

    .live-log {
        min-height: 220px;
        font-size: 12px;
    }

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

@keyframes panelAura {

    0%,
    100% {
        opacity: 0.22;
        transform: translateX(-1.5%) translateY(0);
    }

    50% {
        opacity: 0.4;
        transform: translateX(1.5%) translateY(-1%);
    }
}