html {
    background-color: #121213;
}

:root {
    --navbar-h: 48px;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden;
    background-color: #121213;
    color: #ffffff;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* ===========================
   Layout shell: sidebar + content
   =========================== */
.game-shell {
    display: contents;
}

.game-shell-content {
    position: fixed;
    top: var(--navbar-h);
    left: 200px;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.game-shell-content>main {
    flex: 1 0 auto;
    min-height: 0;
    display: flex;
}

/* Slim icon-only sidebar nav */
.game-nav-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 200px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: calc(var(--navbar-h) + 0.25rem);
    padding-bottom: 0.75rem;
    gap: 0.25rem;
    background-color: #1a1a1b;
    border-right: 1px solid #2d2d2e;
    z-index: 100;
}

.game-nav-sidebar a {
    color: #818384;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 40px;
    border-radius: 4px;
    transition: background-color 0.15s, color 0.15s;
    text-decoration: none;
    padding: 0 0.75rem;
    gap: 0.75rem;
}

.game-nav-sidebar a:hover {
    background-color: #2d2d2e;
    color: #ffffff;
}

.game-nav-sidebar a.active {
    background-color: #538d4e;
    color: #ffffff;
}

.game-nav-sidebar .nav-label {
    display: inline;
    font-size: 0.875rem;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

/* Top navbar */
.game-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-h);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1rem;
    background-color: #1a1a1b;
    border-bottom: 1px solid #2d2d2e;
}

.game-topbar-brand {
    font-size: 1.1rem;
    font-weight: 700;
    color: #d7dadc;
    text-decoration: none;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.5px;
}

.game-topbar-brand:hover {
    color: #ffffff;
}

.game-topbar-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-left: auto;
    z-index: 201;
}

.game-topbar-actions .game-date-display {
    align-self: auto;
    min-height: 0;
    max-width: min(44vw, 220px);
    margin-top: 0;
    overflow: hidden;
    color: #d7dadc;
    font-size: clamp(0.62rem, 1.25vh, 0.78rem);
    font-weight: 600;
    line-height: 1.2;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.game-calendar-btn {
    position: relative;
    z-index: 202;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #3a3a3c;
    border-radius: 6px;
    background-color: #2a2a2c;
    color: #d7dadc;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.game-calendar-btn:hover,
.game-calendar-btn[aria-expanded="true"] {
    background-color: #3a3a3c;
    border-color: #85c0f9;
    color: #ffffff;
}

.game-calendar-btn.is-hidden {
    display: none;
}

.game-calendar-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: min(92vw, 320px);
    padding: 12px;
    border: 1px solid #3a3a3c;
    border-radius: 8px;
    background: #1a1a1b;
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.55);
    color: #d7dadc;
    z-index: 260;
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.calendar-title {
    flex: 1;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
}

.calendar-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #2a2a2c;
    color: #d7dadc;
    cursor: pointer;
}

.calendar-nav-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.calendar-weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.calendar-weekday {
    padding: 4px 0;
    font-size: 0.68rem;
    color: #818384;
    text-align: center;
    font-weight: 700;
}

.calendar-day {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #2a2a2c;
    color: #d7dadc;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
}

.calendar-day:hover:not(:disabled) {
    border-color: #85c0f9;
    color: #ffffff;
}

.calendar-day:disabled {
    background: transparent;
    color: #4b5563;
    cursor: default;
}

.calendar-day.is-today {
    border-color: #85c0f9;
}

.calendar-day.is-selected {
    background: #85c0f9;
    color: #121213;
    border-color: #85c0f9;
}

.calendar-day.is-empty {
    visibility: hidden;
}

.game-burger-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    color: #d7dadc;
    cursor: pointer;
    border-radius: 6px;
    padding: 0;
    flex-shrink: 0;
}

.game-burger-btn:hover {
    background-color: #2d2d2e;
}

.game-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--navbar-h);
    background: rgba(0, 0, 0, 0.5);
    z-index: 140;
}

.game-sidebar-overlay.open {
    display: block;
}

/* Content pages (game_page.html) */
.game-page-content {
    width: 100%;
    box-sizing: border-box;
    color: #d7dadc;
}

.game-container {
    --tower-top-offset: calc(2vh + 50px);
    width: 100%;
    max-width: 1400px;
    min-height: 100%;
    height: auto;
    flex: 1 0 auto;
    margin: 0 auto;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: center;
    overflow: visible;
    -webkit-user-select: none;
    user-select: none;
}

.game-container input,
.game-container textarea,
.game-container .about-page {
    -webkit-user-select: text;
    user-select: text;
}

/* Left side: Tower section (15%) */
.tower-section {
    width: 15%;
    min-width: 80px;
    flex-shrink: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    padding: var(--tower-top-offset) 2vh 2vh;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    transition: opacity 0.3s ease;
}

.tower-inner-container {
    width: 70%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.game-over-label {
    font-size: clamp(0.65rem, 1.5vh, 1rem);
    color: #cccccc;
    /* barely visible grey */
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    margin-bottom: 2vh;
    text-align: center;
    width: 100%;
}

.game-over-label.neon-glow {
    color: #ff4444;
    text-shadow:
        0 0 10px #ff4444,
        0 0 20px #ff4444,
        0 0 30px #ff4444,
        0 0 40px #ff0000,
        0 0 70px #ff0000,
        0 0 80px #ff0000,
        0 0 100px #ff0000;
    animation: neonPulse 1.5s ease-in-out infinite;
}

@keyframes neonPulse {

    0%,
    100% {
        text-shadow:
            0 0 10px #ff4444,
            0 0 20px #ff4444,
            0 0 30px #ff4444,
            0 0 40px #ff0000,
            0 0 70px #ff0000,
            0 0 80px #ff0000,
            0 0 100px #ff0000;
    }

    50% {
        text-shadow:
            0 0 5px #ff4444,
            0 0 10px #ff4444,
            0 0 15px #ff4444,
            0 0 20px #ff0000,
            0 0 35px #ff0000,
            0 0 40px #ff0000,
            0 0 50px #ff0000;
    }
}

/* Right side: Main game section (85%) */
.main-game {
    flex: 1;
    min-width: 0;
    min-height: 0;
    overflow: visible;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2vh 3vw;
    gap: clamp(22px, 3vh, 36px);
    box-sizing: border-box;
}

/* ── Toast notifications (Tailscale-style) ─────────────────────────── */
.toast-container {
    position: fixed;
    bottom: clamp(16px, 4vh, 32px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    color: #f9fafb;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: clamp(0.8rem, 1.8vh, 1rem);
    font-weight: 500;
    white-space: nowrap;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: min(90vw, 420px);
    white-space: normal;
    text-align: center;
}

.toast.toast--show {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast--hide {
    opacity: 0;
    transform: translateY(12px);
}

.toast__icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.toast--error .toast__icon {
    color: #f87171;
}

.toast--warning .toast__icon {
    color: #fbbf24;
}

.toast--success .toast__icon {
    color: #34d399;
}

.toast--info .toast__icon {
    color: #60a5fa;
}

.toast--error {
    border-color: rgba(248, 113, 113, 0.3);
}

.toast--warning {
    border-color: rgba(251, 191, 36, 0.3);
}

.toast--success {
    border-color: rgba(52, 211, 153, 0.3);
}

.toast--info {
    border-color: rgba(96, 165, 250, 0.3);
}

/* ───────────────────────────────────────────────────────────────────── */


.difficulty-selector {
    height: auto;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(3px, 0.8vw, 15px);
    flex-shrink: 0;
}

.game-date-display {
    align-self: flex-start;
    min-height: 1rem;
    margin-top: -14px;
    color: #d7dadc;
    font-size: clamp(0.62rem, 1.25vh, 0.78rem);
    font-weight: 600;
    text-align: left;
}

.game-date-display.is-hidden {
    visibility: hidden;
}

.game-date-today-btn {
    margin-left: 10px;
    color: #85c0f9;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.game-date-today-btn:hover {
    color: #a8d4ff;
}

/* Board container: flexible height */
#board-container {
    flex: 0 0 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    align-content: flex-start;
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
}

.storage-consent-panel {
    width: min(92vw, 640px);
    max-width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: clamp(18px, 2.4vw, 26px) clamp(18px, 3vw, 30px);
    background: #1f2937;
    border: 1px solid rgba(96, 165, 250, 0.34);
    border-radius: 10px;
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.48);
    color: #f9fafb;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.storage-consent-panel--show {
    opacity: 1;
    transform: translateY(0);
}

.storage-consent-panel--hide {
    opacity: 0;
    transform: translateY(10px);
}

.storage-consent-panel__icon {
    width: 22px;
    height: 22px;
    color: #60a5fa;
}

.storage-consent-panel__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

.storage-consent-panel__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    line-height: 1.35;
    text-align: left;
}

.storage-consent-panel__copy strong {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.storage-consent-panel__copy span {
    color: #cbd5e1;
    font-size: clamp(0.88rem, 1.5vw, 1rem);
}

.storage-consent-panel__actions {
    display: flex;
    gap: 8px;
}

.storage-consent-panel .toast__btn {
    padding: 7px 14px;
    font-size: 0.92rem;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .storage-consent-panel {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .storage-consent-panel__actions {
        grid-column: 2;
        flex-wrap: wrap;
    }
}

/* Keyboard container: auto height at bottom */
#keyboard-container {
    flex: 0 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.duration-display {
    display: block;
    min-height: clamp(1.5rem, 3vh, 2.5rem);
    font-size: clamp(0.75rem, 1.8vh, 1.2rem);
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    padding: 1vh;
    animation: fadeInScale 0.5s ease-out;
    transition: opacity 0.3s ease;
    text-shadow:
        0 0 10px #6aaa64,
        0 0 20px #6aaa64,
        0 0 30px #6aaa64,
        0 0 40px #538d4e;
    visibility: hidden;
}

.duration-display.visible {
    visibility: visible;
}

.next-puzzle-display {
    display: block;
    min-height: clamp(1.8rem, 3.4vh, 2.8rem);
    font-size: clamp(1rem, 2.2vh, 1.45rem);
    font-weight: bold;
    color: #85c0f9;
    text-align: center;
    padding: 1vh;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    visibility: hidden;
    opacity: 0;
    transform: scale(0.98);
    text-shadow:
        0 0 8px rgba(133, 192, 249, 0.3),
        0 0 18px rgba(133, 192, 249, 0.18);
    transition: opacity 0.3s ease, transform 0.3s ease;
    will-change: transform, text-shadow;
}

.next-puzzle-display.visible {
    visibility: visible;
    opacity: 1;
    transform: scale(1);
    animation: nextPuzzlePulse 2.8s ease-in-out infinite;
}

@keyframes nextPuzzlePulse {

    0%,
    100% {
        transform: scale(1);
        text-shadow:
            0 0 8px rgba(133, 192, 249, 0.3),
            0 0 18px rgba(133, 192, 249, 0.18);
    }

    50% {
        transform: scale(1.025);
        text-shadow:
            0 0 14px rgba(133, 192, 249, 0.44),
            0 0 28px rgba(133, 192, 249, 0.26);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* hint display styled the same as streak for consistency */
.hint-display {
    display: block;
    min-height: clamp(1.5rem, 3vh, 2.5rem);
    font-size: clamp(0.9rem, 2.2vh, 1.5rem);
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    padding: 1vh;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    opacity: 1;
    transition: all 0.3s ease;
    /* no text shadow - plain white */
    visibility: hidden;
}

.hint-display.visible {
    visibility: visible;
}

.hint-category-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
}

/* optionally reuse streak highlight style for hint */
.hint-display.highlight {
    transform: scale(1.05);
}

.streak-display {
    display: block;
    min-height: clamp(1.5rem, 3vh, 2.5rem);
    font-size: clamp(0.7rem, 1.6vh, 1.1rem);
    font-weight: bold;
    color: #ffffff;
    text-align: center;
    padding: 1vh;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    opacity: 1;
    transition: all 0.3s ease;
    /* no text shadow - plain white */
    visibility: hidden;
}

.streak-display.visible {
    visibility: visible;
}

.streak-display.highlight {
    /* highlight present but no neon glow */
    transform: scale(1.05);
}

@keyframes streakPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Custom difficulty wrapper — keeps bin icon anchored to the button */
.custom-difficulty-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
}

.delete-custom-btn {
    /* Centred above the keyboard inside .main-game-content */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto;
    flex-shrink: 0;
    width: auto;
    height: 36px;
    background: #7f1d1d;
    border: 1.5px solid #991b1b;
    border-radius: 10px;
    color: #fecaca;
    cursor: pointer;
    padding: 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.85);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s, color 0.2s, border-color 0.2s;
}

.delete-custom-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
}

.delete-custom-btn:hover {
    background: #991b1b;
    border-color: #b91c1c;
    color: #fecaca;
}

/* Toast action buttons (used by confirm toasts) */
.toast__actions {
    display: flex;
    gap: 8px;
    margin-left: 8px;
    flex-shrink: 0;
}

.toast__btn {
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    transition: background 0.15s;
}

.toast__btn--confirm {
    background: #f87171;
    color: #fff;
    border-color: #f87171;
}

.toast__btn--confirm:hover {
    background: #ef4444;
}

.toast__btn--primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

.toast__btn--primary:hover {
    background: #1d4ed8;
}

.toast__btn--cancel {
    background: #3a3a3c;
    color: #d1d5db;
    border-color: #555;
}

.toast__btn--cancel:hover {
    background: #4a4a4c;
}

.difficulty-btn {
    padding: clamp(0.3rem, 1vh, 0.6rem) clamp(0.3rem, 1vw, 1.5rem);
    font-size: clamp(0.78rem, 1.7vw, 1rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 2px solid #3a3a3c;
    background-color: #2a2a2c;
    color: #818384;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}

.difficulty-btn:hover {
    background-color: #3a3a3c;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.difficulty-btn.active {
    background-color: #85c0f9;
    color: #000000;
    border-color: #85c0f9;
    box-shadow: 0 0 20px rgba(133, 192, 249, 0.4);
}

.difficulty-btn:active {
    transform: translateY(0);
}

/* Small screen adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .game-container {
        min-height: 500px;
        height: auto;
    }
}

/* ===========================
   Main game content wrapper
   Sits below the difficulty selector and acts as the positioning
   context for the create overlay.
   =========================== */
.main-game-content {
    flex: 1;
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2.2vh, 24px);
    min-height: 0;
    overflow: visible;
    transition: opacity 0.35s ease;
}

.game-status-panel,
.game-puzzle-panel,
.game-result-panel,
.game-input-panel {
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.3s ease;
}

.game-status-panel {
    flex: 0 0 auto;
    justify-content: center;
}

.game-puzzle-panel {
    flex: 0 0 auto;
    justify-content: center;
    gap: clamp(8px, 1.4vh, 16px);
    position: relative;
}

.game-result-panel {
    flex: 0 0 auto;
    justify-content: center;
    gap: clamp(4px, 0.8vh, 10px);
}

/* Empty result messages must not reserve space between the board and keyboard. */
.game-result-panel:not(:has(.visible)),
.game-result-panel > :not(.visible) {
    display: none;
}

.game-input-panel {
    flex: 0 0 auto;
    justify-content: center;
    padding-top: 8px;
    gap: clamp(8px, 1.4vh, 16px);
}

.main-game-content.compose-active > [data-game-fade-panel] {
    display: none;
}

.main-game-content.compose-active > .about-page {
    display: none !important;
}

/* ===========================
   Create Puzzle Screen
   Kept out of the layout while inactive. The active form supplies its
   own height so the page scrolls and the footer follows the content.
   =========================== */
#create-container {
    position: absolute;
    inset: 0;
    display: flex;
    /* always rendered; visibility toggled via opacity + pointer-events */
    flex-direction: column;
    align-items: center;
    background-color: #121213;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    /* invisible/inactive state */
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
    overflow-y: auto;
    gap: clamp(12px, 2.2vh, 24px);
    padding: 1vh 1vw;
    box-sizing: border-box;
    z-index: 10;
}

.main-game-content.compose-active #create-container {
    position: relative;
    inset: auto;
    width: 100%;
    flex: 0 0 auto;
    overflow: visible;
    visibility: visible;
    transition-delay: 0s;
}

.create-title {
    font-size: clamp(0.85rem, 2.2vh, 1.4rem);
    color: #ffffff;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: bold;
    text-align: center;
    flex-shrink: 0;
}

.create-fields {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 2vh, 22px);
    flex-shrink: 0;
}

.create-field {
    display: flex;
    flex-direction: column;
    gap: 0.6vh;
    padding: 0.4vh 0;
}

.create-field-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.create-field-label {
    font-size: clamp(0.6rem, 1.3vh, 0.9rem);
    color: #ffffff;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.create-char-count {
    font-size: clamp(0.55rem, 1.1vh, 0.8rem);
    color: #6b7280;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    transition: color 0.2s ease;
}

.create-char-count--low {
    color: #f87171;
}

/* Tailwind-style inputs */
.create-input {
    width: 100%;
    box-sizing: border-box;
    background-color: #1f2937;
    border: 1px solid #374151;
    border-radius: 0.375rem;
    color: #f9fafb;
    font-size: clamp(1rem, 2.2vh, 1.35rem);
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    padding: 0.625rem 0.875rem;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    caret-color: #f9fafb;
}

.create-input.active-input {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

.create-input::placeholder {
    color: #6b7280;
}

.create-puzzle-textarea {
    resize: none;
    height: clamp(80px, 14vh, 130px);
    line-height: 1.6;
    overflow-y: auto;
}

.create-reset-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0 auto;
    flex-shrink: 0;
    width: auto;
    height: 36px;
    background: #7f1d1d;
    border: 1.5px solid #991b1b;
    border-radius: 10px;
    color: #fecaca;
    cursor: pointer;
    padding: 0 14px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    transition: background 0.2s, border-color 0.2s;
}

.create-reset-btn:hover {
    background: #991b1b;
    border-color: #b91c1c;
    color: #fecaca;
}

/* Create keyboard container – mirror the game's #keyboard-container rules */
#create-keyboard-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: transparent;
    border-radius: 8px;
    padding: clamp(5px, 1.5vh, 20px) 0;
    gap: clamp(2px, 0.8vh, 8px);
    flex-shrink: 0;
}

.create-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.5vh 0;
    flex-shrink: 0;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
}

.create-url-btn {
    width: 100%;
    padding: clamp(0.6rem, 1.5vh, 1rem) clamp(1rem, 2vw, 2rem);
    font-size: clamp(0.5rem, 1.4vw, 0.9rem);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: #538d4e;
    color: #ffffff;
    border: 2px solid #538d4e;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

.create-url-btn:hover {
    background-color: #6aaa64;
    border-color: #6aaa64;
    box-shadow: 0 0 24px rgba(106, 170, 100, 0.45);
    transform: translateY(-1px);
}

.create-url-btn:active {
    transform: translateY(0);
}

/* Result box shown after URL is generated */
.create-result-box {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0.5vh 0;
    flex-shrink: 0;
}

.create-result-url {
    flex: 1;
    min-width: 0;
    padding: clamp(0.5rem, 1.2vh, 0.9rem) 0.75rem;
    font-size: clamp(0.95rem, 2.2vh, 1.05rem);
    background: #1a1a1b;
    color: #d7dadc;
    border: 2px solid #538d4e;
    border-radius: 6px;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    cursor: default;
    outline: none;
    resize: none;
    word-break: break-all;
    line-height: 1.5;
}

@media (max-width: 768px) {
    #create-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    #create-keyboard-container {
        width: 100%;
    }

    .create-result-url {
        font-size: clamp(1rem, 2.4vh, 1.1rem);
        padding: clamp(0.75rem, 2vh, 1rem) 0.9rem;
    }

    .create-result-box {
        flex-direction: column;
        align-items: stretch;
    }

    .create-copy-btn {
        width: 100%;
        min-height: 44px;
        align-self: stretch;
    }

    .create-actions {
        max-width: 280px;
        padding: 0.25vh 0;
    }

    .create-url-btn {
        padding: 0.5rem 0.75rem;
        font-size: clamp(0.72rem, 2.8vw, 0.82rem);
        letter-spacing: 0.06em;
        border-width: 1.5px;
    }
}

.create-copy-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    background: #538d4e;
    border: 2px solid #538d4e;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    font-size: clamp(0.75rem, 1.6vh, 0.875rem);
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    white-space: nowrap;
    align-self: flex-start;
}

.create-copy-btn svg {
    width: 1.1rem;
    height: 1.1rem;
    flex-shrink: 0;
}

.create-copy-btn:hover {
    background: #6aaa64;
    border-color: #6aaa64;
    box-shadow: 0 0 16px rgba(106, 170, 100, 0.45);
}

.create-copy-btn.copied {
    background: #3a3a3c;
    border-color: #3a3a3c;
}

/* Tailwind-style range slider */
.create-slider {
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: #374151;
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
    accent-color: #60a5fa;
    margin-top: 0.4vh;
}

/* ===========================
   About page
   =========================== */
.about-page {
    max-width: 720px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
    padding-bottom: 3rem;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

.about-hero {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #2d2d2e;
}

.about-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 700;
    color: #d7dadc;
    margin: 0 0 0.5rem 0;
}

.about-tagline {
    font-size: 1.05rem;
    color: #818384;
    margin: 0;
}

.about-section {
    margin-bottom: 2.25rem;
    background-color: #1f1f20;
    border: 1px solid #2d2d2e;
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
}

.about-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.about-section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #d7dadc;
    margin: 0;
}

.about-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 12px;
    flex-shrink: 0;
}

.about-icon--game {
    background-color: #1a3a2a;
    color: #538d4e;
}

.about-icon--balance {
    background-color: #1a2a3a;
    color: #5b8dd9;
}

.about-icon--trophy {
    background-color: #3a2a10;
    color: #c8a94c;
}

.about-icon--share {
    background-color: #2a1a3a;
    color: #9a6dd9;
}

.about-section p {
    color: #b2b4b6;
    font-size: 0.975rem;
    line-height: 1.7;
    margin: 0 0 0.75rem 0;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.about-section strong {
    color: #d7dadc;
}

.about-section em {
    color: #d7dadc;
    font-style: italic;
}

.about-steps {
    margin: 0.75rem 0 0.75rem 1.25rem;
    padding: 0;
    color: #b2b4b6;
    font-size: 0.975rem;
    line-height: 1.7;
}

.about-steps li {
    margin-bottom: 0.6rem;
}

.about-steps li:last-child {
    margin-bottom: 0;
}

.about-steps strong {
    color: #d7dadc;
}

/* ===========================
   Compose instructions (shown inside the compose overlay)
   =========================== */
.compose-instructions {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 0.9rem 1.1rem;
    background: #1a1a1b;
    border: 1px solid #2d2d2e;
    border-radius: 8px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.compose-instructions-title {
    font-size: clamp(0.9rem, 1.8vh, 1.05rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #d7dadc;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    margin: 0 0 0.6rem 0;
}

.compose-instructions-section-label {
    font-size: clamp(0.8rem, 1.4vh, 0.95rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #818384;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    margin: 0.85rem 0 0.35rem 0;
}

.compose-instructions-intro,
.compose-instructions-body {
    margin: 0 0 0.2rem 0;
    color: #b2b4b6;
    font-size: 0.975rem;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.55;
}

.compose-instructions-dl {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.2rem 0.75rem;
}

.compose-instructions-dl dt {
    font-size: 0.975rem;
    font-weight: 700;
    color: #d7dadc;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    padding-top: 0.15rem;
    white-space: nowrap;
}

.compose-instructions-dl dd {
    margin: 0;
    color: #b2b4b6;
    font-size: 0.975rem;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.55;
}

.compose-instructions-optional {
    font-weight: 400;
    color: #6b7280;
    font-size: 0.9em;
}

.compose-instructions-code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    background: #2d2d2e;
    border-radius: 3px;
    padding: 0.05em 0.3em;
    color: #d7dadc;
}

.compose-instructions-disclaimer {
    margin-top: 0.85rem;
    padding: 0.6rem 0.75rem;
    background: #1f1f20;
    border-left: 3px solid #4b5563;
    border-radius: 0 4px 4px 0;
    font-size: clamp(0.75rem, 1.35vh, 0.88rem);
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    color: #9ca3af;
    line-height: 1.55;
}

/* ===========================
   Landing page
   =========================== */
.landing-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: clamp(1rem, 4vw, 2.5rem);
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

.landing-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(0.9rem, 2.5vw, 1.4rem);
}

.landing-card {
    display: flex;
    min-width: 0;
    min-height: 260px;
    flex-direction: column;
    gap: 0.7rem;
    padding: clamp(1rem, 2.5vw, 1.35rem);
    border: 1px solid #2d2d2e;
    border-radius: 8px;
    background: #1a1a1b;
    color: #d7dadc;
    text-decoration: none;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.landing-card:hover {
    border-color: #565758;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
    transform: translateY(-2px);
}

.landing-card--game {
    border-color: rgba(83, 141, 78, 0.65);
}

.landing-card-icon {
    display: inline-flex;
    width: 52px;
    height: 52px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #2d2d2e;
}

.landing-card-icon--tower {
    width: 88px;
    height: 58px;
    background: transparent;
}

.landing-tower-svg {
    display: block;
    width: 88px;
    height: 58px;
    filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.26));
}

.landing-card-icon--boardgames {
    position: relative;
    width: 88px;
    height: 58px;
    background: transparent;
}

.landing-boardgame-icon {
    position: absolute;
    display: flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.24);
}

.landing-boardgame-icon svg {
    width: 38px;
    height: 38px;
}

.landing-boardgame-icon--chess {
    z-index: 3;
    left: 0;
    top: 7px;
    background: #1c1917;
}

.landing-boardgame-icon--connect4 {
    z-index: 2;
    left: 27px;
    top: 0;
    background: #1457d9;
}

.landing-boardgame-icon--dominoes {
    z-index: 1;
    left: 44px;
    top: 12px;
    background: #1f2937;
}

.landing-card-title {
    color: #f9fafb;
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    font-weight: 900;
    letter-spacing: 0;
}

.landing-card-text {
    color: #b2b4b6;
    font-size: clamp(0.95rem, 2vw, 1rem);
    line-height: 1.6;
}

.landing-card-cta {
    margin-top: auto;
    color: #85c0f9;
    font-weight: 800;
}

.landing-seo {
    max-width: 860px;
    margin-top: clamp(1.4rem, 4vw, 2.5rem);
    padding-top: clamp(1rem, 3vw, 1.8rem);
    border-top: 1px solid #2d2d2e;
}

.landing-seo h1 {
    margin: 0 0 0.9rem;
    color: #f9fafb;
    font-size: clamp(1.75rem, 4vw, 2.7rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: 0;
}

.landing-seo p {
    margin: 0;
    color: #b2b4b6;
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    line-height: 1.7;
}

.landing-seo p+p {
    margin-top: 0.85rem;
}

/* ===========================
   SEO content pages
   =========================== */
.seo-page {
    max-width: 860px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem);
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

.seo-hero {
    padding-bottom: 1.4rem;
    margin-bottom: 1.4rem;
    border-bottom: 1px solid #2d2d2e;
}

.seo-kicker {
    margin: 0 0 0.45rem;
    color: #538d4e;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.seo-hero h1 {
    margin: 0 0 0.7rem;
    color: #f9fafb;
    font-size: clamp(1.85rem, 5vw, 3.1rem);
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.08;
}

.seo-hero p,
.seo-section p {
    color: #b2b4b6;
    font-size: clamp(0.92rem, 2vw, 1rem);
    line-height: 1.65;
}

.seo-primary-link,
.seo-secondary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.9rem;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
}

.seo-primary-link {
    background: #538d4e;
    color: #ffffff;
}

.seo-secondary-link {
    border: 1px solid #3f3f46;
    color: #d7dadc;
}

.seo-section {
    margin-bottom: 1.5rem;
}

.seo-section h2 {
    margin: 0 0 0.55rem;
    color: #d7dadc;
    font-size: clamp(1.05rem, 2.4vw, 1.35rem);
    font-weight: 800;
    letter-spacing: 0;
}

.seo-steps {
    margin: 0;
    padding-left: 1.35rem;
    color: #b2b4b6;
    font-size: clamp(0.9rem, 2vw, 0.98rem);
    line-height: 1.65;
}

.seo-steps li+li {
    margin-top: 0.5rem;
}

/* ===========================
   Nav separator
   =========================== */
.nav-separator {
    height: 1px;
    background: #2d2d2e;
    margin: 0.4rem 0.75rem;
    flex-shrink: 0;
}

/* ===========================
   Board Games — listing page
   =========================== */
.boardgames-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem);
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

.boardgames-hero {
    margin-bottom: 2rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #2d2d2e;
}

.boardgames-hero h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: #d7dadc;
    margin: 0 0 0.4rem 0;
}

.boardgames-hero p {
    color: #818384;
    font-size: clamp(0.85rem, 2vw, 1rem);
    margin: 0;
}

.boardgames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: clamp(0.75rem, 2vw, 1.25rem);
}

.bg-card {
    background: #1a1a1b;
    border: 1px solid #2d2d2e;
    border-radius: 10px;
    padding: 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    text-decoration: none;
    transition: border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.bg-card:hover {
    border-color: #538d4e;
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(83, 141, 78, 0.18);
}

.bg-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    flex-shrink: 0;
}

.bg-card-name {
    font-size: clamp(0.9rem, 2.5vw, 1.05rem);
    font-weight: 700;
    color: #d7dadc;
    margin: 0;
    line-height: 1.2;
}

.bg-card-tagline {
    font-size: clamp(0.7rem, 1.8vw, 0.8rem);
    color: #538d4e;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0;
}

.bg-card-desc {
    font-size: clamp(0.75rem, 1.8vw, 0.85rem);
    color: #818384;
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.bg-card-cta {
    font-size: 0.78rem;
    color: #60a5fa;
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ===========================
   Support / legal pages
   =========================== */
.site-footer {
    flex: 0 0 auto;
    border-top: 1px solid #2d2d2e;
    background: #1a1a1b;
    color: #818384;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    font-size: 0.82rem;
    padding: 1rem clamp(1rem, 3vw, 2rem);
}

.site-footer-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-footer p {
    margin: 0;
}

.site-footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem 1.1rem;
}

.site-footer a {
    color: #818384;
    text-decoration: none;
    transition: color 0.15s ease;
}

.site-footer a:hover {
    color: #d7dadc;
}

.site-footer-link-button {
    appearance: none;
    border: 0;
    padding: 0;
    background: transparent;
    color: #818384;
    font: inherit;
    cursor: pointer;
}

.site-footer-link-button:hover,
.site-footer-link-button:focus-visible {
    color: #d7dadc;
    text-decoration: underline;
}

.analytics-consent {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1000;
    width: min(23rem, calc(100vw - 2rem));
    padding: 1rem;
    border: 1px solid #3a3a3c;
    border-radius: 0.75rem;
    background: #1a1a1b;
    color: #f8f8f8;
    box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
}

.analytics-consent[hidden] { display: none; }

.analytics-consent h2 {
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.analytics-consent p {
    margin: 0 0 0.85rem;
    color: #b8b8ba;
    font-size: 0.9rem;
    line-height: 1.45;
}

.analytics-consent a {
    color: inherit;
    text-decoration: underline;
}

.analytics-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.analytics-consent-actions button {
    min-height: 2.5rem;
    border: 1px solid #56565a;
    border-radius: 0.5rem;
    background: transparent;
    color: #f8f8f8;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.analytics-consent-actions button:hover,
.analytics-consent-actions button:focus-visible {
    border-color: #d7dadc;
    background: rgb(255 255 255 / 8%);
}

.support-page {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2rem);
    padding-bottom: 3rem;
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

.support-page--narrow {
    max-width: 620px;
}

.support-hero {
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #2d2d2e;
}

.support-kicker {
    color: #60a5fa;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin: 0 0 0.45rem 0;
    text-transform: uppercase;
}

.support-hero h1,
.support-result h1 {
    color: #d7dadc;
    font-size: clamp(1.55rem, 4vw, 2.15rem);
    font-weight: 700;
    margin: 0 0 0.55rem 0;
}

.support-hero p,
.support-result p {
    color: #818384;
    font-size: clamp(0.88rem, 2vw, 1rem);
    line-height: 1.6;
    margin: 0;
}

.support-section {
    background: #1f1f20;
    border: 1px solid #2d2d2e;
    border-radius: 10px;
    padding: clamp(1.1rem, 3vw, 1.75rem);
}

.support-result {
    text-align: center;
}

.support-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.support-field {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.support-field label {
    color: #d7dadc;
    font-size: 0.86rem;
    font-weight: 700;
}

.support-field input,
.support-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #3a3a3c;
    border-radius: 7px;
    background: #121213;
    color: #d7dadc;
    font: inherit;
    font-size: 0.95rem;
    line-height: 1.45;
    outline: none;
    padding: 0.78rem 0.85rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.support-field textarea {
    resize: vertical;
}

.support-field input:focus,
.support-field textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.support-field input::placeholder,
.support-field textarea::placeholder {
    color: #6b7280;
}

.support-short-input {
    max-width: 9rem;
}

.support-field-help,
.support-check-text,
.support-field-note {
    color: #818384;
    font-size: 0.8rem;
    line-height: 1.45;
    margin: 0;
}

.support-field-help {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.support-honeypot {
    display: none;
}

.support-button {
    align-self: flex-start;
    border: 1px solid #85c0f9;
    border-radius: 7px;
    background: #85c0f9;
    color: #000000;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    min-height: 42px;
    padding: 0.65rem 1.05rem;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.support-button:hover {
    background: #a8d4ff;
    border-color: #a8d4ff;
    transform: translateY(-1px);
}

.support-button:disabled {
    background: #3a3a3c;
    border-color: #3a3a3c;
    color: #818384;
    cursor: not-allowed;
    transform: none;
}

.support-button-link {
    margin-top: 1.25rem;
}

.support-copy {
    display: flex;
    flex-direction: column;
    gap: 1.55rem;
}

.support-copy section {
    margin: 0;
}

.support-copy h2 {
    color: #d7dadc;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.45rem 0;
}

.support-copy p {
    color: #b2b4b6;
    font-size: 0.96rem;
    line-height: 1.7;
    margin: 0;
}

.support-copy a {
    color: #85c0f9;
    font-weight: 700;
    text-decoration: none;
}

.support-copy a:hover {
    color: #a8d4ff;
}

/* ===========================
   Board Games — detail page
   =========================== */
.bg-detail {
    max-width: 680px;
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 1.5rem);
    font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
}

.bg-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: #818384;
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    transition: color 0.15s ease;
}

.bg-detail-back:hover {
    color: #d7dadc;
}

.bg-detail-hero {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bg-detail-icon {
    width: 68px;
    height: 68px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    flex-shrink: 0;
}

.bg-detail-hero h1 {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 700;
    color: #d7dadc;
    margin: 0 0 0.25rem 0;
}

.bg-detail-tagline {
    font-size: clamp(0.8rem, 2vw, 0.95rem);
    color: #818384;
    margin: 0;
    font-style: italic;
}

.bg-detail-personal {
    background: #1f1f20;
    border-left: 3px solid #538d4e;
    border-radius: 0 6px 6px 0;
    padding: 0.75rem 1rem;
    margin-bottom: 1.25rem;
    font-size: clamp(0.8rem, 1.8vw, 0.92rem);
    color: #b2b4b6;
    font-style: italic;
    line-height: 1.55;
}

.bg-detail-board-image {
    width: 100%;
    clear: both;
    margin: 1.5rem 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
    border: 1px solid #2d2d2e;
}

.bg-detail-board-image--ludo {
    aspect-ratio: 720 / 580;
}

.risk-figure {
    background: #142c32;
}

.risk-world-board {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: min(1280px, calc(100vw - 200px - 2rem));
}

.risk-map-frame { position: relative; }
.risk-map-viewport { overflow: auto; }
.risk-map-zoom {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #a1b6a2;
    border-radius: 8px;
    background: #f5f7ef;
    color: #243d39;
    box-shadow: 0 2px 5px #10272e26;
    cursor: pointer;
}
.risk-map-zoom:hover { background: #e8eee4; }
.risk-map-zoom:focus-visible { outline: 3px solid #243d39; outline-offset: 2px; }
.risk-map-zoom[hidden],
.risk-map-zoom .risk-collapse-icon,
.risk-map-zoom[aria-pressed="true"] .risk-expand-icon { display: none; }
.risk-map-zoom[aria-pressed="true"] .risk-collapse-icon { display: block; }
.risk-map-viewport:focus-visible { outline: 3px solid #e6c77c; outline-offset: -3px; }
.risk-map-enlarged canvas { min-width: 1400px; }
.risk-map-enlarged { max-height: 75vh; }
.risk-controls button[hidden] { display: none; }

.risk-figure figcaption {
    padding: 1rem 1.25rem;
    color: #e1e8e5;
    font-size: 0.9rem;
    line-height: 1.6;
    border-top: 1px solid #385057;
}

.risk-controls, .scrabble-controls, .snakes-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding: 0 1.25rem 1.25rem;
}

.risk-controls[hidden], .scrabble-controls[hidden], .snakes-controls[hidden] { display: none; }

.risk-controls button, .scrabble-controls button, .snakes-controls button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid #91a5b2;
    border-radius: 8px;
    background: #203443;
    color: #eaf0f6;
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
}

.risk-controls button:hover:not(:disabled), .scrabble-controls button:hover:not(:disabled), .snakes-controls button:hover:not(:disabled) { background: #344d60; }
.risk-controls button:focus-visible, .scrabble-controls button:focus-visible, .snakes-controls button:focus-visible { outline: 3px solid #eaf0f6; outline-offset: 3px; }
.risk-controls button:disabled, .scrabble-controls button:disabled, .snakes-controls button:disabled { opacity: 0.5; cursor: default; }
.risk-controls .guide-pause-icon,
.risk-controls [data-playing="true"] .guide-play-icon { display: none; }
.risk-controls [data-playing="true"] .guide-pause-icon { display: block; }
.risk-guide .bg-starting-table { margin-bottom: 1.5rem; }
.risk-guide .bg-starting-table caption { text-align: left; color: #d7dadc; padding-bottom: 0.75rem; }

.scrabble-figure { background: #152b41; }
.scrabble-figure figcaption {
    padding: 1rem 1.25rem;
    color: #eaf0f6;
    font-size: 0.95rem;
    line-height: 1.6;
    border-top: 1px solid #567088;
}
.scrabble-guide .bg-starting-table caption { text-align: left; color: #d7dadc; padding-bottom: 0.75rem; }

.bg-detail-board-image--monopoly {
    aspect-ratio: 720 / 520;
}

.bg-detail-board-image--monopoly-board {
    aspect-ratio: 1 / 1;
}

.bg-detail-board-image--othello {
    aspect-ratio: 720 / 430;
}

.bg-detail-board-image canvas {
    width: 100%;
    height: auto;
    display: block;
}

.bg-detail-board-image--ludo canvas {
    height: 100%;
}

.bg-detail-board-image--monopoly canvas {
    height: 100%;
}

.bg-detail-board-image--monopoly-board canvas {
    height: 100%;
}

.bg-detail-board-image--othello canvas {
    height: 100%;
}

.bg-detail-board-image img {
    width: 100%;
    display: block;
    object-fit: cover;
    height: 280px;
}

.chess-move-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.9rem;
    margin: 1.35rem 0 1.75rem;
}

.go-concept-grid {
    grid-template-columns: 1fr;
}

.chess-move-card {
    background: #1a1a1b;
    border: 1px solid #2d2d2e;
    border-radius: 8px;
    overflow: hidden;
}

.chess-move-card h3 {
    color: #d7dadc;
    font-size: 0.92rem;
    font-weight: 700;
    margin: 0;
    padding: 0.75rem 0.85rem 0.25rem;
}

.chess-move-card p {
    color: #9ca3af;
    font-size: 0.78rem;
    line-height: 1.45;
    margin: 0;
    min-height: 4.4rem;
    padding: 0 0.85rem 0.7rem;
}

.go-concept-grid .chess-move-card p {
    min-height: 0;
}

.chess-move-card canvas {
    width: 100%;
    height: auto;
    display: block;
    border-top: 1px solid #2d2d2e;
}

.bg-detail-list {
    margin: 0.4rem 0 1.3rem 1.25rem;
    color: #d1d5db;
    font-size: clamp(0.82rem, 1.8vw, 0.96rem);
    line-height: 1.55;
    list-style: disc;
}

.bg-detail-stats {
    display: flex;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: #1a1a1b;
    border: 1px solid #2d2d2e;
    border-radius: 8px;
}

.bg-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bg-stat-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #6b7280;
}

.bg-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #d7dadc;
}

.bg-detail-description {
    color: #b2b4b6;
    font-size: clamp(0.85rem, 2vw, 0.97rem);
    line-height: 1.65;
    margin-bottom: 1.75rem;
}

.bg-starting-table {
    width: 100%;
    border-collapse: collapse;
    font-size: clamp(0.78rem, 1.7vw, 0.88rem);
    color: #b2b4b6;
    margin-bottom: 0;
}

.bg-starting-table th,
.bg-starting-table td {
    padding: 0.4rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #2d2d2e;
}

.bg-starting-table thead tr:first-child th {
    font-size: clamp(0.72rem, 1.5vw, 0.8rem);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #818384;
    padding-top: 0;
}

.bg-starting-table thead tr:first-child th:last-child,
.bg-starting-table thead tr:first-child th:nth-child(3),
.bg-starting-table td:nth-child(3),
.bg-starting-table td:nth-child(4),
.bg-starting-table thead tr:last-child th:nth-child(3),
.bg-starting-table thead tr:last-child th:nth-child(4) {
    border-left: 1px solid #2d2d2e;
}

.bg-starting-table tfoot td {
    color: #818384;
    font-size: 0.78rem;
    border-bottom: none;
}

.monopoly-card-stack-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 9.5rem;
}

.monopoly-mini-card {
    position: relative;
    flex: 0 0 auto;
    width: 3rem;
    height: 2.25rem;
    border-radius: 0.25rem;
    background: #f8fafc;
    border: 2px solid currentColor;
    box-shadow:
        0.18rem -0.18rem 0 #dbe4df,
        0.36rem -0.36rem 0 #b7c8bd;
}

.monopoly-mini-card--chance {
    color: #f59e0b;
}

.monopoly-mini-card--chance span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #f59e0b;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
}

.monopoly-mini-card--community {
    color: #0ea5e9;
}

.monopoly-mini-card--community span {
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    bottom: 0.45rem;
    height: 0.8rem;
    border: 2px solid #0ea5e9;
    border-radius: 0.15rem;
}

.monopoly-mini-card--community span::before {
    content: "";
    position: absolute;
    left: 0.25rem;
    right: 0.25rem;
    top: -0.55rem;
    height: 0.55rem;
    border: 2px solid #0ea5e9;
    border-bottom: 0;
    border-radius: 0.55rem 0.55rem 0 0;
}

.monopoly-mini-card--community span::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0.18rem;
    width: 0.3rem;
    height: 0.3rem;
    transform: translateX(-50%);
    border-radius: 50%;
    background: #0ea5e9;
}

.go-scoring-table {
    margin: 0.4rem 0 1.5rem;
}

.bg-starting-table.go-scoring-table th,
.bg-starting-table.go-scoring-table td {
    border-left: none;
}

.bg-detail-section-title {
    font-size: clamp(0.7rem, 1.5vw, 0.85rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #818384;
    margin: 2.35rem 0 0.75rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #2d2d2e;
}

.bg-detail-steps {
    margin: 0;
    padding-left: 1.4rem;
    color: #b2b4b6;
    font-size: clamp(0.82rem, 1.8vw, 0.93rem);
    line-height: 1.65;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.bg-detail-steps+.bg-detail-description {
    margin-top: 1.25rem;
    padding-left: 1.4rem;
}

.letter-tower-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 2rem 0 0;
    padding: 1rem;
    background: #1a1a1b;
    border: 1px solid #2d2d2e;
    border-left: 3px solid #538d4e;
    border-radius: 8px;
}

.letter-tower-cta-kicker {
    margin: 0 0 0.25rem;
    color: #538d4e;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.letter-tower-cta h2 {
    margin: 0 0 0.35rem;
    color: #f9fafb;
    font-size: clamp(1rem, 2.2vw, 1.25rem);
    font-weight: 800;
    letter-spacing: 0;
}

.letter-tower-cta p {
    margin: 0;
    color: #b2b4b6;
    font-size: clamp(0.84rem, 1.8vw, 0.94rem);
    line-height: 1.5;
}

.letter-tower-cta-link {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.65rem 0.9rem;
    background: #538d4e;
    color: #ffffff;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

/* ===========================
   Narrow-screen / mobile layout
   On small widths keep the original tower section as a fixed left column.
   =========================== */
@media (max-width: 768px) {

    .game-burger-btn {
        display: flex;
    }

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

    .game-shell-content {
        left: 0;
        overflow-x: hidden;
    }

    .risk-world-board {
        width: min(1280px, calc(100vw - 2rem));
    }

    .game-nav-sidebar {
        position: fixed;
        top: var(--navbar-h);
        left: -220px;
        width: 220px;
        height: calc(100vh - var(--navbar-h));
        flex-direction: column;
        padding: 0.75rem 0;
        border-right: 1px solid #2d2d2e;
        z-index: 150;
        transition: left 0.15s ease;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .game-nav-sidebar.open {
        left: 0;
    }

    .game-nav-sidebar a {
        width: 100%;
        justify-content: flex-start;
        padding: 0 1rem;
        height: 44px;
        border-radius: 0;
        gap: 0.75rem;
    }

    .game-nav-sidebar .nav-label {
        display: inline;
        font-size: 0.9rem;
        font-family: 'Clear Sans', 'Helvetica Neue', Arial, sans-serif;
    }

    .game-container {
        --tower-top-offset: 48px;
        display: grid;
        grid-template-columns: 50px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        overflow-x: hidden;
        padding: 8px 8px 8px 4px;
        column-gap: 4px;
        row-gap: 18px;
        box-sizing: border-box;
    }

    .game-container.compose-mode .tower-section {
        display: none;
    }

    .game-container.compose-mode {
        padding-left: 0;
        padding-right: 0;
    }

    .game-container.compose-mode .main-game-content {
        grid-column: 1 / -1;
    }

    .tower-section {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        position: relative;
        width: 50px;
        min-width: 50px;
        max-width: 50px;
        flex: 0 0 50px;
        height: auto;
        z-index: 1;
        overflow: visible;
        padding: 0;
        box-sizing: border-box;
    }

    .tower-inner-container {
        width: 100%;
        align-items: center;
        justify-content: flex-start;
    }

    .game-over-label {
        display: block;
        width: 100%;
        min-height: 28px;
        margin: 0 0 5px;
        padding: 3px 2px;
        font-size: 0.72rem;
        line-height: 1.05;
        letter-spacing: 0.02em;
        text-align: center;
        color: #d7dadc;
        opacity: 1;
        visibility: visible;
        box-sizing: border-box;
    }

    /* Let the selector span both columns while the board stays beside the tower. */
    .main-game {
        display: contents;
    }

    .main-game-content {
        grid-column: 2;
        grid-row: 2;
        min-width: 0;
        gap: 12px;
        overflow-x: visible;
    }

    .difficulty-selector {
        grid-column: 1 / -1;
        grid-row: 1;
        width: 100%;
        margin: 0;
        gap: 3px;
        box-sizing: border-box;
    }

    .difficulty-btn {
        flex: 1 1 0;
        min-height: 36px;
        padding: 8px 1px;
        font-size: clamp(0.68rem, 3vw, 0.9rem);
        border-width: 1px;
        border-radius: 4px;
        letter-spacing: 0;
    }

    .landing-page {
        padding: 1rem;
    }

    .landing-card-grid {
        grid-template-columns: 1fr;
    }

    .landing-card {
        min-height: 0;
    }

    .landing-seo h1 {
        font-size: clamp(1.65rem, 8vw, 2.35rem);
    }

    .letter-tower-cta {
        align-items: stretch;
        flex-direction: column;
    }

    .letter-tower-cta-link {
        width: 100%;
    }
}

/* Treat phone-sized landscape viewports as mobile even when their width
   exceeds the normal mobile breakpoint. */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 1024px) {
    .game-burger-btn {
        display: flex;
    }

    .game-shell-content {
        left: 0;
        overflow-x: hidden;
    }

    .risk-world-board {
        width: min(1280px, calc(100vw - 2rem));
    }

    .game-nav-sidebar {
        top: var(--navbar-h);
        left: -220px;
        width: 220px;
        height: calc(100vh - var(--navbar-h));
        flex-direction: column;
        padding: 0.75rem 0;
        border-right: 1px solid #2d2d2e;
        z-index: 150;
        transition: left 0.15s ease;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .game-nav-sidebar.open {
        left: 0;
    }

    .game-nav-sidebar a {
        width: 100%;
        justify-content: flex-start;
        padding: 0 1rem;
        height: 44px;
        border-radius: 0;
        gap: 0.75rem;
    }

    .game-nav-sidebar .nav-label {
        display: inline;
        font-size: 0.9rem;
    }
}

/* Ultra-narrow screens: shrink tower column, clip its shadow, and widen gap. */
@media (max-width: 430px) {
    .game-container {
        grid-template-columns: 36px minmax(0, 1fr);
        padding-left: 6px;
        padding-right: 6px;
        padding-bottom: 6px;
        column-gap: 6px;
    }

    .tower-section {
        width: 36px;
        min-width: 36px;
        max-width: 36px;
        flex: 0 0 36px;
        overflow-x: hidden;
    }

    .main-game-content {
        margin-left: 3px;
    }
}

.snakes-figure { background: #1a352b; }
.snakes-figure figcaption { padding: 1rem 1.25rem; color: #eaf3e9; font-size: 0.95rem; line-height: 1.6; border-top: 1px solid #567361; }

.hint-reveal-button {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    height: 1.5em;
    padding: 0;
    color: #f2c94c;
    background: transparent;
    border: 1px solid currentColor;
    border-radius: 50%;
    font-size: inherit;
    font-weight: bold;
    line-height: 1;
    animation: hint-reveal-pulse 2s ease-in-out infinite;
}

.hint-reveal-button svg {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hint-reveal-button:focus-visible {
    outline: 2px solid #f2c94c;
    outline-offset: 2px;
}

@keyframes hint-reveal-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

@media (prefers-reduced-motion: reduce) {
    .hint-reveal-button {
        animation: none;
    }
}
