@font-face {
    font-family: "ADJMN Press Start";
    src: url("/games/fonts/PressStart2P-Regular.ttf") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

.arcade-site.casual-puzzle-site {
    min-height: 100vh;
    margin: 0;
    color: #f5f0ff;
    background:
        radial-gradient(ellipse at 50% 5%, rgba(91,48,137,.28), transparent 56%),
        linear-gradient(180deg, #130d2b 0%, #100b21 48%, #190b23 100%);
    font: 400 16px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

.casual-puzzle-page {
    position: relative;
    z-index: 1;
    width: min(100% - 36px, 940px);
    margin: 0 auto;
    padding: 34px 0 52px;
}

.casual-puzzle-page *,
.casual-puzzle-page *::before,
.casual-puzzle-page *::after { box-sizing: border-box; }

.puzzle-intro { margin: 0 auto 23px; }
.puzzle-eyebrow {
    margin: 0 0 9px;
    color: #4ce8ff;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.puzzle-intro h1,
.puzzle-machine > h2,
.puzzle-win h3 {
    font-family: "ADJMN Press Start", "Courier New", monospace;
    font-weight: 400;
    line-height: 1.55;
}
.puzzle-intro h1 {
    margin: 0;
    color: #fff2c4;
    font-size: clamp(1.1rem, 4vw, 1.8rem);
    text-shadow: 3px 3px 0 #5c318b;
}
.puzzle-intro h1 span { color: #ffe17b; }
.puzzle-intro > p:last-child {
    max-width: 68ch;
    margin: 10px 0 0;
    color: #e2dced;
    font-size: 1rem;
    line-height: 1.6;
}

.puzzle-machine {
    --puzzle-accent: #4ce8ff;
    position: relative;
    overflow: hidden;
    padding: clamp(15px, 3.5vw, 30px);
    border: 2px solid color-mix(in srgb, var(--puzzle-accent), #251938 32%);
    background:
        repeating-linear-gradient(0deg, rgba(76,232,255,.025) 0, rgba(76,232,255,.025) 1px, transparent 1px, transparent 4px),
        radial-gradient(ellipse at 50% 12%, color-mix(in srgb, var(--puzzle-accent), transparent 91%), transparent 66%),
        #100d20;
    box-shadow: 0 8px 0 #090615, 0 0 24px color-mix(in srgb, var(--puzzle-accent), transparent 83%), inset 0 0 0 4px rgba(15,11,31,.82);
}
.maze-machine { --puzzle-accent: #4ce8ff; }
.sudoku-machine { --puzzle-accent: #ffe17b; }
.word-find-machine { --puzzle-accent: #d776ff; }

.puzzle-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #4ce8ff;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .08em;
}
.puzzle-machine > h2 {
    margin: 17px 0 2px;
    color: #ffe17b;
    font-size: clamp(.85rem, 2.7vw, 1.15rem);
    text-align: center;
    text-shadow: 2px 2px #5c318b;
}
.puzzle-tagline {
    margin: 3px 0 20px;
    color: #4ce8ff;
    font-size: .8rem;
    font-weight: 750;
    letter-spacing: .08em;
    text-align: center;
}
.puzzle-hud {
    display: grid;
    grid-template-columns: minmax(90px, 145px) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 58px;
    margin: 0 auto 17px;
    padding: 10px 14px;
    border: 1px solid #51436f;
    border-radius: 7px;
    background: rgba(5,5,14,.88);
}
.puzzle-hud > div { display: grid; gap: 3px; }
.puzzle-hud > div span {
    color: #bcb3d2;
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.puzzle-hud > div strong {
    color: #4ce8ff;
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}
.puzzle-hud > p {
    margin: 0;
    color: #f5f0ff;
    font-size: 1rem;
    line-height: 1.45;
}
.puzzle-instructions {
    max-width: 68ch;
    margin: 14px auto 18px;
    color: #ddd6ea;
    font-size: 1rem;
    line-height: 1.55;
    text-align: center;
}
.puzzle-button,
.puzzle-key,
.maze-direction {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 1px solid #b9304b;
    border-radius: 7px;
    color: #fff;
    background: linear-gradient(180deg, #f0445e, #c91f3c);
    box-shadow: 0 4px 0 #70152a, 0 0 14px rgba(239,48,73,.2);
    font: 700 1rem/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
    cursor: pointer;
    touch-action: manipulation;
    transition: filter .16s ease, transform .16s ease, box-shadow .16s ease;
}
.puzzle-button { padding: 10px 18px; }
.puzzle-button:hover,
.puzzle-key:hover,
.maze-direction:hover { filter: brightness(1.12); }
.puzzle-button:active,
.puzzle-key:active,
.maze-direction:active { transform: translateY(2px); box-shadow: 0 2px 0 #70152a; }
.puzzle-button:focus-visible,
.puzzle-key:focus-visible,
.maze-direction:focus-visible,
.sudoku-cell:focus-visible,
.word-cell:focus-visible,
.puzzle-back-link:focus-visible {
    outline: 3px solid #ffe17b;
    outline-offset: 3px;
}
.puzzle-actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }
.puzzle-back-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 9px 15px;
    border: 1px solid #7653ad;
    border-radius: 7px;
    color: #e4d6ff;
    background: #211735;
    font-weight: 700;
    text-decoration: none;
}
.puzzle-back-link:hover { border-color: #4ce8ff; color: #fff; }
.puzzle-win {
    margin: 18px auto 0;
    padding: 15px;
    border: 1px solid var(--puzzle-accent);
    border-radius: 8px;
    background: rgba(17,12,32,.96);
    text-align: center;
    box-shadow: 0 0 20px color-mix(in srgb, var(--puzzle-accent), transparent 78%);
}
.puzzle-win[hidden] { display: none; }
.puzzle-win h3 { margin: 0 0 8px; color: #ffe17b; font-size: .9rem; }
.puzzle-win p { margin: 0 0 12px; color: #e2dced; }
.puzzle-disclaimer {
    margin: 17px 0 0;
    color: #bcb3d2;
    font-size: .875rem;
    text-align: center;
}

/* Cable Maze */
.maze-board-wrap { width: min(100%, 420px); margin: 0 auto; }
.maze-canvas {
    display: block;
    width: 100%;
    height: auto;
    border: 2px solid #4c3f76;
    background: #080812;
    box-shadow: inset 0 0 18px rgba(0,0,0,.75), 0 0 15px rgba(76,232,255,.13);
    image-rendering: pixelated;
}
.maze-marker-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px auto 0;
    color: #d8d1e7;
    font-size: .9rem;
}
.maze-marker-legend strong {
    margin-right: 5px;
    color: #4ce8ff;
    font-size: .75rem;
    letter-spacing: .08em;
}
.maze-marker-legend span:last-child strong { color: #ffe17b; }
.maze-dpad {
    display: grid;
    grid-template: " . up . " 48px "left down right" 48px / 48px 48px 48px;
    justify-content: center;
    gap: 5px;
    margin: 13px auto 0;
    touch-action: none;
}
.maze-direction { width: 48px; min-height: 48px; padding: 0; font-size: 1.35rem; touch-action: none; }
.maze-direction[data-direction="up"] { grid-area: up; }
.maze-direction[data-direction="left"] { grid-area: left; }
.maze-direction[data-direction="down"] { grid-area: down; }
.maze-direction[data-direction="right"] { grid-area: right; }

/* Wedding Sudoku */
.sudoku-board {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    width: min(100%, 414px);
    margin: 0 auto 14px;
    overflow: hidden;
    border: 2px solid #9b7e49;
    border-radius: 5px;
    background: #6a5b46;
}
.sudoku-cell {
    display: grid;
    min-width: 0;
    aspect-ratio: 1;
    place-items: center;
    padding: 0;
    border: 0;
    border-right: 1px solid #4f4662;
    border-bottom: 1px solid #4f4662;
    color: #4ce8ff;
    background: #151328;
    font: 600 clamp(.92rem, 4vw, 1.25rem)/1 Inter, ui-sans-serif, system-ui, sans-serif;
    cursor: pointer;
}
.sudoku-cell:nth-child(3n) { border-right: 3px solid #82704f; }
.sudoku-cell:nth-child(9n) { border-right: 0; }
.sudoku-cell:nth-child(n+19):nth-child(-n+27),
.sudoku-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 3px solid #82704f; }
.sudoku-cell.given { color: #ffe17b; font-weight: 800; }
.sudoku-cell.selected { color: #fff; background: #bf2548; }
.sudoku-cell.related:not(.selected) { background: #24203b; }
.sudoku-cell.same-value:not(.selected) { background: #3c315c; }
.sudoku-number-pad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: min(100%, 300px);
    margin: 0 auto 12px;
}
.puzzle-key { width: 100%; min-height: 46px; border-color: #5d4a8c; background: #281d47; box-shadow: 0 3px 0 #160e2c; }
.puzzle-key:hover { border-color: #ffe17b; }
.sudoku-clear { min-width: 104px; }

/* DJ Word Find */
.word-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    margin: 0 auto 13px;
    padding: 10px;
    border: 1px solid #51436f;
    border-radius: 7px;
    background: rgba(5,5,14,.88);
}
.word-item {
    padding: 4px 8px;
    border: 1px solid #51436f;
    border-radius: 5px;
    color: #a3f5ff;
    background: #211735;
    font-size: .95rem;
    font-weight: 750;
    letter-spacing: .04em;
}
.word-item.found { border-color: #4ce8ff; color: #baf7ce; text-decoration: line-through; opacity: .78; }
.word-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: clamp(2px, .7vw, 5px);
    width: min(100%, 420px);
    margin: 0 auto;
    padding: clamp(6px, 1.4vw, 10px);
    border: 2px solid #65508e;
    border-radius: 8px;
    background: #080812;
}
.word-cell {
    display: grid;
    min-width: 0;
    aspect-ratio: 1;
    place-items: center;
    padding: 0;
    border: 1px solid #51436f;
    border-radius: 4px;
    color: #f7f3ff;
    background: #201a38;
    font: 700 clamp(.9rem, 4.2vw, 1.2rem)/1 Inter, ui-sans-serif, system-ui, sans-serif;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}
.word-cell:hover { border-color: #d776ff; background: #32204d; }
.word-cell.selected { border-color: #ffe17b; color: #fff; background: #b72e5b; }
.word-cell.found { border-color: #65ecc2; color: #baf7ce; background: #17443d; }
.word-cell.found.selected {
    border-color: #ffe17b;
    color: #fff;
    background: #684218;
    box-shadow: inset 0 0 0 2px #ffe17b;
}
.word-hint { margin: 11px auto 17px; color: #d8d1e7; font-size: 1rem; text-align: center; }

@media (max-width: 600px) {
    .casual-puzzle-page { width: min(100% - 28px, 480px); padding: 28px 0 42px; }
    .puzzle-intro { margin-bottom: 18px; }
    .puzzle-intro > p:last-child { font-size: 1rem; }
    .puzzle-machine { padding: 13px 10px 17px; }
    .puzzle-topline { font-size: .75rem; }
    .puzzle-hud { grid-template-columns: 86px minmax(0,1fr); gap: 8px; padding: 9px; }
    .puzzle-hud > p { font-size: .95rem; }
    .puzzle-instructions { margin: 12px auto 15px; }
    .puzzle-actions { gap: 9px; }
    .puzzle-button, .puzzle-back-link { min-height: 46px; }
    .maze-dpad { grid-template: " . up . " 50px "left down right" 50px / 50px 50px 50px; }
    .maze-direction { width: 50px; min-height: 50px; }
    .puzzle-tagline { font-size: .72rem; }
    .word-grid { width: min(100%, 380px); }
}

@media (prefers-reduced-motion: reduce) {
    .puzzle-button, .puzzle-key, .maze-direction { transition: none; }
}
