:root {
    --bg: #07090b;
    --bg-raised: #0d1114;
    --bg-soft: #11171b;

    --text: #d3d7d8;
    --muted: #8a9296;
    --faint: #5b6367;

    --line: #8f989c;
    --line-dim: #394247;

    --ruby: #b92b4b;
    --ruby-bright: #e34a69;
    --cyan: #69d8e6;
    --green: #79eaa0;
    --yellow: #e2cf69;
    --danger: #ef5bca;

    --display: "Rajdhani", Arial, sans-serif;
    --mono: "Share Tech Mono", "Courier New", monospace;

    --shadow-soft: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 78% 14%, rgba(185, 43, 75, 0.09), transparent 28rem),
        radial-gradient(circle at 15% 70%, rgba(105, 216, 230, 0.05), transparent 28rem),
        var(--bg);
    color: var(--text);
    font-family: var(--mono);
    line-height: 1.6;
}

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

p {
    margin-top: 0;
}

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

.site-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

/* CRT atmosphere: keep it subtle. */
.crt-overlay {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 50;
    background:
        repeating-linear-gradient(
            to bottom,
            rgba(255, 255, 255, 0.018) 0,
            rgba(255, 255, 255, 0.018) 1px,
            transparent 1px,
            transparent 4px
        );
    opacity: 0.6;
}

.crt-overlay::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(
            ellipse at center,
            transparent 48%,
            rgba(0, 0, 0, 0.36) 100%
        );
}

/* Header */
.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-bottom: 1px solid var(--line-dim);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    color: var(--ruby-bright);
    font-family: var(--display);
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    box-shadow: 0 0 14px rgba(185, 43, 75, 0.15);
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-family: var(--display);
    font-size: 1.35rem;
    line-height: 1;
    letter-spacing: 0.08em;
}

.brand small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
}

.system-readout {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
}

/* Shared panel */
.panel {
    position: relative;
    background:
        linear-gradient(
            180deg,
            rgba(16, 21, 24, 0.96),
            rgba(10, 14, 17, 0.96)
        );
    border: 1px solid var(--line-dim);
    box-shadow: var(--shadow-soft);
}

.panel::before,
.panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.panel::before {
    inset: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.025);
}

.panel::after {
    top: -1px;
    right: -1px;
    width: 90px;
    height: 1px;
    background: var(--line);
}

/* Hero */
.hero {
    margin-top: 26px;
    display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
}

.hero-copy {
    padding: clamp(34px, 6vw, 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eyebrow,
.panel-label,
.service-tag,
.rule-key,
.notice-title {
    color: var(--muted);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--display);
    font-weight: 700;
    line-height: 0.96;
    text-transform: uppercase;
}

h1 {
    margin-top: 12px;
    max-width: 760px;
    font-size: clamp(4rem, 10vw, 8.6rem);
    letter-spacing: 0.015em;
}

h2 {
    font-size: clamp(2rem, 4vw, 3.35rem);
    letter-spacing: 0.035em;
}

h3 {
    font-size: 1.75rem;
    letter-spacing: 0.04em;
}

.accent-ruby {
    color: var(--ruby-bright);
    text-shadow: 0 0 18px rgba(227, 74, 105, 0.16);
}

.hero-lede {
    max-width: 60ch;
    margin: 26px 0 0;
    color: var(--text);
    font-size: 1rem;
}

.hero-actions {
    margin-top: 28px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid var(--line);
    background: rgba(8, 11, 13, 0.72);
    color: var(--text);
    font-family: var(--display);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease,
        transform 160ms ease;
}

.button span {
    color: var(--muted);
}

.button:hover,
.button:focus-visible {
    border-color: var(--cyan);
    color: var(--cyan);
    transform: translateY(-1px);
}

.button-primary {
    border-color: var(--ruby);
    color: #f5d8de;
    box-shadow: 0 0 20px rgba(185, 43, 75, 0.10);
}

.button-primary:hover,
.button-primary:focus-visible {
    border-color: var(--ruby-bright);
    color: #fff;
}

/* Terminal panel */
.hero-terminal {
    display: flex;
    flex-direction: column;
    margin: 0 22px 22px;
    border: 1px solid var(--line-dim);
    background: #090d10;
}

.terminal-header,
.terminal-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.terminal-header {
    border-bottom: 1px solid var(--line-dim);
}

.terminal-footer {
    margin-top: auto;
    border-top: 1px solid var(--line-dim);
}

.status-dot {
    width: 8px;
    height: 8px;
    align-self: center;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 10px rgba(121, 234, 160, 0.65);
}

.terminal-body {
    padding: 24px 18px;
}

.terminal-line {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 12px;
    padding: 5px 0;
    font-size: 0.9rem;
}

.terminal-key {
    color: var(--cyan);
}

.terminal-rule {
    margin: 20px 0;
    border-top: 1px solid var(--line-dim);
}

.terminal-prompt {
    margin-bottom: 8px;
    color: var(--yellow);
}

.terminal-dim {
    color: var(--faint);
    font-size: 0.88rem;
}

/* Section heading */
.section-heading {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: end;
    padding: 82px 4px 24px;
}

.section-intro {
    max-width: 60ch;
    margin: 0;
    color: var(--muted);
}

/* Service grid */
.service-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.service {
    min-height: 255px;
    padding: 24px;
}

.service-tag {
    color: var(--cyan);
}

.service h3 {
    margin-top: 22px;
}

.service p {
    max-width: 56ch;
    margin: 18px 0 24px;
    color: var(--muted);
}

.service-code {
    color: var(--faint);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Game information */
.game-info {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 16px;
    margin-top: 16px;
}

.rules,
.timeline,
.house-rules {
    padding: 28px;
}

.rules h2,
.timeline h2 {
    margin-top: 10px;
}

.rules > p {
    max-width: 70ch;
    margin: 22px 0 0;
    color: var(--muted);
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin-top: 24px;
    border: 1px solid var(--line-dim);
    background: var(--line-dim);
}

.rules-grid div {
    min-height: 94px;
    padding: 16px;
    background: var(--bg-raised);
}

.rules-grid strong,
.rule-key {
    display: block;
}

.rules-grid strong {
    margin-top: 8px;
    font-family: var(--display);
    font-size: 1.25rem;
    letter-spacing: 0.05em;
}

.timeline-item {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line-dim);
}

.timeline-item:last-child {
    border-bottom: 0;
}

.timeline-item > span {
    color: var(--ruby-bright);
    font-family: var(--display);
    font-size: 1.4rem;
    font-weight: 700;
}

.timeline-item strong {
    font-family: var(--display);
    font-size: 1.1rem;
    letter-spacing: 0.08em;
}

.timeline-item p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

/* House rules */
.house-rules {
    margin-top: 16px;
}

.notice-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 24px;
    align-items: start;
}

.notice-layout h2 {
    margin-top: 10px;
}

.notice-layout p {
    margin: 18px 0 0;
    color: var(--muted);
}

.notice-box {
    display: grid;
    gap: 6px;
    padding: 18px;
    border: 1px solid var(--line-dim);
    background: var(--bg-raised);
}

.notice-box strong {
    color: var(--yellow);
    font-family: var(--display);
    font-size: 1.4rem;
    letter-spacing: 0.08em;
}

.notice-box span:last-child {
    color: var(--muted);
    font-size: 0.75rem;
    text-transform: uppercase;
}

/* Footer */
.footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 4px 52px;
    color: var(--faint);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.footer > div > strong,
.footer > div > span {
    display: block;
}


.footer strong {
    color: var(--muted);
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
}

/* Responsive */
@media (max-width: 900px) {
    .hero,
    .game-info,
    .section-heading {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
    }

    .hero-terminal {
        min-height: 420px;
    }

    .section-heading {
        align-items: start;
    }

    .notice-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(100% - 18px, 1180px);
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px 0;
    }

    .system-readout {
        justify-content: flex-start;
        gap: 8px 14px;
    }

    .hero-copy {
        padding: 30px 22px;
    }

    h1 {
        font-size: clamp(3rem, 18vw, 5rem);
    }

    .hero-terminal {
        margin: 10px;
    }

    .service-grid,
    .rules-grid {
        grid-template-columns: 1fr;
    }

    .service,
    .rules,
    .timeline,
    .house-rules {
        padding: 22px;
    }

    .footer {
        flex-direction: column;
    }

    .footer-meta {
        justify-content: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .button {
        transition: none;
    }
}

/* ---- Phone fixes (appended) ---- */
.site-shell, main, .hero > * { min-width: 0; }
.terminal-line { grid-template-columns: 140px minmax(0, 1fr); overflow-wrap: anywhere; }

@media (max-width: 640px) {
    h1 { font-size: clamp(2.4rem, 12vw, 5rem); overflow-wrap: anywhere; }
    .terminal-line { grid-template-columns: 112px minmax(0, 1fr); gap: 8px; font-size: 0.85rem; }
    .terminal-body { padding: 18px 14px; }
    .terminal-header, .terminal-footer { flex-wrap: wrap; }
}
