@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&family=Roboto+Mono:wght@400;700&display=swap');

:root {
    --bg-color: #0d0c1d;
    --bg-secondary-color: #1a1a2e;
    --bg-panel-color: rgba(20, 22, 43, 0.82);
    --bg-panel-strong: rgba(10, 13, 30, 0.94);
    --border-color: rgba(0, 255, 255, 0.22);
    --border-strong: rgba(249, 37, 114, 0.34);
    --text-color: #e0e0e0;
    --text-muted: rgba(224, 224, 224, 0.78);
    --text-soft: rgba(224, 224, 224, 0.58);
    --text-glow-color: #00ffff;
    --primary-color: #f92572;
    --primary-soft: rgba(249, 37, 114, 0.18);
    --accent-color: #00ffff;
    --accent-soft: rgba(0, 255, 255, 0.14);
    --font-display: 'Orbitron', sans-serif;
    --font-body: 'Roboto Mono', monospace;
    --border-radius: 14px;
    --card-radius: 22px;
    --box-shadow: 0 0 18px rgba(0, 255, 255, 0.18), 0 0 6px rgba(0, 255, 255, 0.22);
    --panel-shadow: 0 20px 50px rgba(0, 0, 0, 0.35), 0 0 18px rgba(0, 255, 255, 0.12);
    --transition: 220ms ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    background-color: var(--bg-color);
    color: var(--text-color);
    background-image:
        radial-gradient(circle at 12% 18%, rgba(0, 255, 255, 0.14), transparent 28%),
        radial-gradient(circle at 88% 12%, rgba(249, 37, 114, 0.16), transparent 26%),
        linear-gradient(rgba(13, 12, 29, 0.92), rgba(13, 12, 29, 0.97)),
        url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40"%3E%3Cg fill-rule="evenodd"%3E%3Cg fill="%231a1a2e" fill-opacity="0.4"%3E%3Cpath d="M0 38.59l2.83-2.83 1.41 1.41L1.41 40H0v-1.41zM0 1.4l2.83 2.83 1.41-1.41L1.41 0H0v1.41zM38.59 40l-2.83-2.83 1.41-1.41L40 38.59V40h-1.41zM40 1.41l-2.83 2.83-1.41-1.41L38.59 0H40v1.41z"/%3E%3C/g%3E%3C/g%3E%3C/svg%3E');
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: '';
    position: fixed;
    inset: auto 0 -11rem;
    height: 20rem;
    background: radial-gradient(circle at 50% 100%, rgba(0, 255, 255, 0.12), transparent 55%);
    pointer-events: none;
    z-index: 0;
}

main,
.site-header,
.site-footer {
    position: relative;
    z-index: 1;
}

main {
    flex: 1;
}

.container {
    width: min(1200px, calc(100% - 40px));
    margin-left: auto;
    margin-right: auto;
}

h1,
h2,
h3 {
    margin: 0;
    font-family: var(--font-display);
    line-height: 1.2;
    letter-spacing: 0.06em;
}

h1 {
    font-size: clamp(2.25rem, 5vw, 3.4rem);
    color: var(--accent-color);
    text-align: center;
    text-shadow: 0 0 10px var(--text-glow-color);
}

h2 {
    font-size: clamp(1.8rem, 4vw, 2.4rem);
    color: var(--accent-color);
    text-align: center;
    text-shadow: 0 0 10px var(--text-glow-color);
}

h3 {
    font-size: clamp(1.15rem, 2.6vw, 1.45rem);
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color);
}

p {
    margin: 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition), text-shadow var(--transition);
}

a:hover {
    color: #ff5c99;
    text-shadow: 0 0 10px var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

button,
input,
textarea,
select {
    font: inherit;
}

.section {
    padding: clamp(48px, 7vw, 88px) 0;
}

.page-intro,
.subtitle {
    max-width: 64ch;
    margin: 0 auto;
    text-align: center;
}

.page-intro {
    color: var(--text-muted);
}

.subtitle {
    margin-top: 0.9rem;
    color: var(--text-soft);
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 26px;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.14), rgba(0, 255, 255, 0.02));
    box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.1);
    color: var(--accent-color);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-decoration: none;
    text-transform: uppercase;
    transition:
        transform var(--transition),
        background-color var(--transition),
        color var(--transition),
        border-color var(--transition),
        box-shadow var(--transition);
}

.btn:hover {
    background: var(--accent-color);
    color: var(--bg-color);
    box-shadow: var(--box-shadow);
    text-decoration: none;
    transform: translateY(-2px);
}

.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
}

.btn.is-disabled,
.btn[aria-disabled='true'] {
    pointer-events: none;
    opacity: 0.45;
    box-shadow: none;
    filter: saturate(0.7);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 18px 0;
    background-color: rgba(26, 26, 46, 0.82);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-color);
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    text-shadow: 0 0 6px var(--text-glow-color);
}

.logo:hover {
    color: var(--accent-color);
    text-decoration: none;
    text-shadow: 0 0 12px var(--text-glow-color);
}

.main-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 28px;
}

.main-nav a {
    position: relative;
    padding-bottom: 4px;
    color: var(--text-color);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
}

.main-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    transform: scaleX(0);
    transform-origin: center;
    background: currentColor;
    transition: transform var(--transition);
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--text-glow-color);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    transform: scaleX(1);
}

#games-list .container,
#game-section .container {
    display: grid;
    gap: clamp(26px, 4vw, 42px);
}

.games-hero,
.game-hero {
    padding: clamp(28px, 5vw, 44px);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background:
        linear-gradient(160deg, rgba(0, 255, 255, 0.08), rgba(26, 26, 46, 0.85) 38%, rgba(249, 37, 114, 0.12));
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(10px);
}

.games-hero,
.game-hero {
    text-align: center;
}

.games-hero h1,
.game-hero h1 {
    margin-bottom: 0.85rem;
}

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: clamp(22px, 3vw, 30px);
}

.game-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: linear-gradient(180deg, rgba(10, 16, 36, 0.96), rgba(26, 26, 46, 0.84));
    box-shadow: var(--panel-shadow);
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.game-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 255, 255, 0.4);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36), 0 0 22px rgba(0, 255, 255, 0.18);
}

.game-card--soon:hover {
    transform: none;
    border-color: var(--border-color);
}

.game-card-image {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top left, rgba(0, 255, 255, 0.16), transparent 50%),
        linear-gradient(180deg, rgba(26, 26, 46, 0.3), rgba(10, 13, 30, 0.9));
}

.game-card-image a {
    display: block;
    aspect-ratio: 16 / 10;
}

.game-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 32%, rgba(10, 13, 30, 0.82) 100%);
    pointer-events: none;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
    border-radius: 0;
    transition: transform 300ms ease, opacity 300ms ease;
}

.game-card:hover img {
    transform: scale(1.05);
}

.game-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.game-card-content p {
    color: var(--text-muted);
}

.game-card-content .btn {
    margin-top: auto;
    width: fit-content;
}

.game-card--soon img {
    opacity: 0.72;
}

.game-card--soon .game-card-content p {
    color: var(--text-soft);
}

.game-page {
    --cell-size: clamp(1.15rem, 6vw, 2.5rem);
    --cell-font-size: clamp(0.78rem, 2.2vw, 1.08rem);
}

.game-stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    gap: clamp(20px, 4vw, 32px);
    align-items: start;
}

.board-panel,
.sidebar {
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: linear-gradient(180deg, rgba(8, 15, 34, 0.96), rgba(26, 26, 46, 0.84));
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(8px);
}

.board-panel {
    padding: clamp(14px, 3vw, 24px);
    overflow: auto;
}

.board-wrapper {
    width: max-content;
    margin: 0 auto;
    padding: clamp(10px, 2vw, 16px);
    border: 1px solid rgba(0, 255, 255, 0.16);
    border-radius: calc(var(--card-radius) - 6px);
    background: linear-gradient(180deg, rgba(5, 11, 26, 0.96), rgba(16, 22, 48, 0.92));
    touch-action: none;
}

.grid {
    display: grid;
    width: max-content;
    gap: 3px;
    padding: 3px;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 255, 0.16);
    border-radius: 12px;
    background: rgba(0, 255, 255, 0.08);
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--cell-size);
    height: var(--cell-size);
    border: 1px solid rgba(0, 255, 255, 0.08);
    background: rgba(12, 20, 41, 0.96);
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-display);
    font-size: var(--cell-font-size);
    font-weight: 700;
    transition:
        transform 120ms ease,
        background-color 120ms ease,
        border-color 120ms ease,
        color 120ms ease,
        box-shadow 120ms ease;
}

.cell:hover {
    transform: translateY(-1px);
    border-color: rgba(0, 255, 255, 0.24);
    background: rgba(0, 255, 255, 0.14);
    color: #ffffff;
}

.cell.selecting {
    transform: scale(1.04);
    border-color: rgba(249, 37, 114, 0.5);
    background: rgba(249, 37, 114, 0.25);
    box-shadow: inset 0 0 0 1px rgba(249, 37, 114, 0.28), 0 0 12px rgba(249, 37, 114, 0.22);
    color: #ffffff;
}

.cell.found {
    border-color: rgba(0, 255, 255, 0.4);
    background: rgba(0, 255, 255, 0.24);
    box-shadow: inset 0 0 0 1px rgba(0, 255, 255, 0.28), 0 0 14px rgba(0, 255, 255, 0.22);
    color: #ffffff;
    animation: pop 0.28s ease-out;
}

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: clamp(20px, 3vw, 28px);
}

.sidebar h3 {
    margin-bottom: 0;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.16);
}

.word-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.word-list li {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(0, 255, 255, 0.05);
    color: var(--text-color);
    font-size: 0.98rem;
    letter-spacing: 0.05em;
    transition:
        transform var(--transition),
        opacity var(--transition),
        border-color var(--transition),
        color var(--transition),
        background-color var(--transition);
}

.word-list li::before {
    content: '';
    width: 10px;
    height: 10px;
    margin-right: 12px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--primary-color);
    box-shadow: 0 0 10px rgba(249, 37, 114, 0.55);
}

.word-list li.struck {
    transform: scale(0.985);
    border-color: rgba(0, 255, 255, 0.08);
    background: rgba(0, 255, 255, 0.03);
    color: var(--text-soft);
    opacity: 0.68;
    text-decoration: line-through;
}

.word-list li.struck::before {
    background: var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.55);
}

.sidebar .btn {
    width: 100%;
}

.game-page--standalone main {
    display: flex;
    align-items: center;
}

.game-page--standalone .section {
    width: 100%;
    padding-block: clamp(28px, 7vw, 64px);
}

.site-footer {
    margin-top: 40px;
    padding: 36px 0;
    border-top: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    text-align: center;
}

.footer-content p {
    margin: 0;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.footer-content a {
    color: var(--primary-color);
    font-weight: 700;
}

@keyframes pop {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.18);
    }
    100% {
        transform: scale(1);
    }
}

@media (max-width: 980px) {
    .game-stage {
        grid-template-columns: 1fr;
    }

    .sidebar {
        width: 100%;
        max-width: 720px;
        justify-self: center;
    }
}

@media (max-width: 860px) {
    .site-header {
        padding: 16px 0;
    }

    .site-header .container {
        justify-content: center;
    }

    .main-nav {
        justify-content: center;
    }

    .logo {
        font-size: 1.45rem;
    }
}

@media (max-width: 640px) {
    body {
        background-attachment: scroll;
    }

    .container {
        width: min(100% - 32px, 1200px);
    }

    .section {
        padding: 40px 0;
    }

    .games-hero,
    .game-hero,
    .board-panel,
    .sidebar {
        padding: 18px;
    }

    .board-wrapper {
        padding: 8px;
    }

    .grid {
        gap: 2px;
        padding: 2px;
    }

    .main-nav {
        gap: 10px 18px;
    }

    .main-nav a {
        font-size: 0.76rem;
    }

    .game-card-content {
        padding: 20px;
    }

    .page-intro,
    .subtitle {
        font-size: 0.95rem;
    }

    .word-list li {
        min-height: 42px;
        padding: 9px 12px;
        font-size: 0.92rem;
    }
}

@media (max-width: 420px) {
    .logo {
        font-size: 1.22rem;
    }

    .btn {
        width: 100%;
        font-size: 0.84rem;
        letter-spacing: 0.12em;
    }

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

    .game-page {
        --cell-size: clamp(1.05rem, 6.4vw, 1.55rem);
        --cell-font-size: 0.72rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
