:root {
    --bg: #07131f;
    --bg-deep: #04101a;
    --surface: rgba(9, 26, 39, 0.82);
    --surface-strong: rgba(13, 35, 51, 0.94);
    --surface-soft: rgba(120, 255, 214, 0.08);
    --line: rgba(170, 237, 220, 0.16);
    --text: #f4fbff;
    --muted: #b5d0dc;
    --primary: #78ffd6;
    --primary-strong: #3de4b7;
    --secondary: #ffa661;
    --secondary-soft: #ffd3a8;
    --accent: #89b8ff;
    --danger: #ff6b7a;
    --shadow: 0 30px 70px rgba(0, 0, 0, 0.34);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 18%, rgba(120, 255, 214, 0.14), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(255, 166, 97, 0.14), transparent 24%),
        linear-gradient(180deg, #091523 0%, #07111b 42%, #04101a 100%);
    line-height: 1.65;
    overflow-x: hidden;
}

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

button {
    font: inherit;
}

.container,
.nav-container {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.navbar {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
    background: rgba(4, 14, 23, 0.72);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-container {
    min-height: 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: 1.5rem;
    color: var(--secondary);
}

.logo-text {
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 28px;
}

.nav-link {
    position: relative;
    color: var(--muted);
    font-weight: 700;
}

.nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -10px;
    width: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--text);
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
    width: 100%;
}

.hamburger {
    display: none;
    border: 0;
    background: transparent;
    padding: 6px;
    cursor: pointer;
}

.bar {
    display: block;
    width: 26px;
    height: 3px;
    margin: 4px 0;
    border-radius: 999px;
    background: var(--text);
}

section {
    padding: 110px 0;
}

.eyebrow {
    margin-bottom: 16px;
    color: var(--primary);
    letter-spacing: 0.26em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.hero {
    position: relative;
    min-height: 100vh;
    padding-top: 120px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-grid,
.hero-orb {
    position: absolute;
}

.hero-grid {
    inset: 0;
    background-image:
        linear-gradient(rgba(137, 184, 255, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(137, 184, 255, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.92), transparent 92%);
}

.hero-orb {
    width: 340px;
    height: 340px;
    border-radius: 50%;
    filter: blur(18px);
    opacity: 0.6;
}

.hero-orb-a {
    top: 110px;
    left: -60px;
    background: radial-gradient(circle, rgba(120, 255, 214, 0.36), transparent 70%);
}

.hero-orb-b {
    right: -40px;
    bottom: 40px;
    background: radial-gradient(circle, rgba(255, 166, 97, 0.32), transparent 70%);
}

.hero-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
    gap: 42px;
    align-items: center;
}

.hero-copy h1,
.section-heading h2,
.contact-layout h2 {
    font-family: 'ZCOOL KuaiLe', cursive;
    line-height: 1.08;
}

.hero-copy h1 {
    font-size: clamp(3rem, 7vw, 5.6rem);
    margin-bottom: 18px;
}

.hero-text {
    max-width: 680px;
    font-size: 1.08rem;
    color: var(--muted);
}

.hero-actions,
.hero-points,
.action-grid,
.mobile-controls {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.hero-actions {
    margin-top: 30px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border-radius: 999px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover,
.btn:focus-visible,
.control-btn:hover,
.control-btn:focus-visible {
    transform: translateY(-2px);
}

.btn-primary {
    color: #05211a;
    background: linear-gradient(135deg, var(--primary), #b4ffe8);
    box-shadow: 0 20px 44px rgba(120, 255, 214, 0.22);
}

.btn-secondary {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
}

.hero-points {
    margin-top: 28px;
    list-style: none;
}

.hero-points li {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.hero-points i,
.feature-icon,
.contact-item i {
    color: var(--secondary);
}

.hero-panel {
    display: flex;
    justify-content: flex-end;
}

.hero-card,
.panel,
.feature-card,
.contact-card {
    background: linear-gradient(180deg, rgba(11, 29, 43, 0.95), rgba(8, 20, 31, 0.9));
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.hero-card {
    width: 100%;
    padding: 30px;
}

.card-kicker {
    color: var(--secondary);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.75rem;
    margin-bottom: 14px;
}

.hero-card h2 {
    font-size: 2rem;
    margin-bottom: 12px;
}

.hero-card p {
    color: var(--muted);
}

.mini-stats {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.mini-stats div {
    padding: 16px 14px;
    border-radius: 20px;
    background: var(--surface-soft);
    border: 1px solid rgba(120, 255, 214, 0.12);
}

.mini-stats strong {
    display: block;
    color: var(--secondary-soft);
    font-size: 1.3rem;
}

.mini-stats span {
    font-size: 0.88rem;
    color: var(--muted);
}

.section-heading {
    max-width: 760px;
    margin-bottom: 34px;
}

.section-heading p:last-child,
.contact-text,
.feature-card p,
.tips-list {
    color: var(--muted);
}

.game-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 28px;
    align-items: start;
}

.game-stage-wrap {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.game-stage {
    position: relative;
    padding: 18px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(10, 29, 44, 0.94), rgba(5, 14, 23, 0.96));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

#tetrisCanvas {
    display: block;
    width: min(100%, 520px);
    max-width: 100%;
    margin: 0 auto;
    aspect-ratio: 1 / 2;
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(1, 13, 21, 0.94), rgba(7, 20, 31, 0.98));
}

.game-overlay {
    position: absolute;
    inset: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: rgba(4, 14, 23, 0.52);
    backdrop-filter: blur(6px);
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.game-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.overlay-card {
    max-width: 320px;
    padding: 28px;
    text-align: center;
    border-radius: 24px;
    background: rgba(7, 20, 31, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.overlay-badge {
    display: inline-flex;
    padding: 6px 12px;
    margin-bottom: 14px;
    border-radius: 999px;
    background: rgba(120, 255, 214, 0.12);
    color: var(--primary);
}

.game-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.panel {
    padding: 22px;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.panel-header h3 {
    font-size: 1.05rem;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.04);
}

.status-dot.running {
    background: var(--primary);
    box-shadow: 0 0 0 8px rgba(120, 255, 214, 0.12);
}

.status-dot.paused {
    background: var(--secondary);
    box-shadow: 0 0 0 8px rgba(255, 166, 97, 0.12);
}

.status-dot.over {
    background: var(--danger);
    box-shadow: 0 0 0 8px rgba(255, 107, 122, 0.12);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.stat-card {
    padding: 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.5rem;
    color: var(--secondary-soft);
}

#nextCanvas {
    display: block;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    border-radius: 18px;
    background: rgba(0, 0, 0, 0.18);
}

.action-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.tips-list {
    list-style: none;
}

.tips-list li + li {
    margin-top: 10px;
}

.mobile-controls {
    display: none;
}

.control-btn {
    min-height: 46px;
    padding: 0 20px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.control-btn.wide {
    width: 100%;
    justify-content: center;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 26px;
}

.feature-icon {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 18px;
    background: rgba(255, 166, 97, 0.08);
    font-size: 1.2rem;
}

.feature-card h3 {
    margin-bottom: 10px;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: center;
}

.contact-card {
    padding: 26px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
}

.contact-item + .contact-item {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.site-footer {
    padding: 24px 0 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(3, 11, 18, 0.72);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted);
    font-size: 0.95rem;
}

.footer-inner a {
    color: var(--secondary-soft);
}

.footer-inner a:hover,
.footer-inner a:focus-visible {
    color: var(--primary);
}

.fade-in {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 980px) {
    .hero-layout,
    .game-shell,
    .contact-layout,
    .features-grid {
        grid-template-columns: 1fr;
    }

    .hero-panel {
        justify-content: flex-start;
    }

    .game-sidebar {
        order: -1;
    }
}

@media (max-width: 760px) {
    .nav-menu {
        position: fixed;
        top: 74px;
        left: 20px;
        right: 20px;
        display: none;
        flex-direction: column;
        align-items: flex-start;
        padding: 18px;
        border-radius: 20px;
        background: rgba(6, 19, 30, 0.96);
        border: 1px solid rgba(255, 255, 255, 0.07);
    }

    .nav-menu.active,
    .hamburger.active + .nav-menu {
        display: flex;
    }

    .hamburger {
        display: inline-block;
    }

    section {
        padding: 88px 0;
    }

    .hero {
        min-height: auto;
        padding-top: 110px;
    }

    .hero-copy h1 {
        font-size: clamp(2.4rem, 12vw, 4rem);
    }

    .mini-stats,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .mobile-controls {
        display: flex;
    }

    .control-btn {
        flex: 1 1 calc(50% - 10px);
    }

    .panel {
        padding: 18px;
    }
}

@media (max-width: 520px) {
    .container,
    .nav-container {
        width: min(100% - 24px, 100%);
    }

    .footer-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-points li,
    .btn,
    .control-btn {
        width: 100%;
    }

    .overlay-card {
        padding: 22px;
    }
}
