body[data-project="shifted"] {
    --accent: #ff3b30;
    --game-ink: #1a1a1a;
    --game-1: #ff3b30;
    --game-2: #007aff;
    --game-3: #ffcc00;
    --game-bg: #f4f1ea;
    --game-line: rgba(26, 26, 26, 0.15);
}

html.dark body[data-project="shifted"] {
    --accent: #ff5e55;
    --game-ink: #e0e0e0;
    --game-1: #ff5e55;
    --game-2: #3395ff;
    --game-3: #ffd633;
    --game-bg: #151e2e;
    --game-line: rgba(224, 224, 224, 0.15);
}

.shifted-title {
    text-transform: uppercase;
}

.shifted-hero {
    padding-top: calc(var(--nav-h) + var(--space-8));
    padding-bottom: var(--space-12);
}

.shifted-grid {
    display: flex;
    align-items: stretch;
    gap: var(--space-5);
}

.shifted-sidetitle {
    align-self: flex-end;
    margin: 0;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-family: var(--font-display);
    font-size: clamp(3rem, 9vw, 6.5rem);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.02em;
    text-transform: uppercase;
    color: var(--accent);
    user-select: none;
    flex-shrink: 0;
}

.stage-frame {
    flex: 1;
    min-width: 0;
}

.shifted-below {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-12);
    text-align: center;
}

.shifted-tagline {
    font-size: var(--text-lg);
    color: var(--text-muted);
}

/* Rate + platforms cards fill the page width; the Download button lives inside the platforms card. */
[data-project="shifted"] .project-cta {
    width: 100%;
}

[data-project="shifted"] .platforms-card .btn {
    margin-bottom: var(--space-2);
}

@media (max-width: 48rem) {
    .shifted-grid {
        flex-direction: column;
        align-items: center;
        gap: var(--space-3);
    }
    .shifted-sidetitle {
        align-self: center;
        writing-mode: horizontal-tb;
        transform: none;
        font-size: clamp(2.5rem, 13vw, 4rem);
    }
}

.stage {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: var(--r-lg);
    border: 1px solid var(--border);
    background: var(--game-bg);
    box-shadow: var(--elev-2);
    touch-action: none;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    transition: background var(--dur-3) ease, border-color var(--dur-1) ease;
}

.stage:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

@media (min-width: 48rem) {
    .stage {
        aspect-ratio: auto;
        height: min(70vh, 40rem);
    }
}

#artCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.stage-score {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    color: var(--game-ink);
    z-index: 2;
}

.score-board {
    font-family: var(--font-display);
    font-size: var(--text-6xl);
    font-weight: 800;
    line-height: 1;
    opacity: 0.12;
    transition: opacity var(--dur-1) ease, transform var(--dur-1) ease;
}

.score-board.active {
    opacity: 0.28;
    transform: scale(1.08);
}

.global-record {
    margin-top: var(--space-3);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    opacity: 0.45;
}

.stage-controls {
    position: absolute;
    right: var(--space-4);
    bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-2);
    z-index: 3;
}

.icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border: 1px solid var(--game-ink);
    border-radius: var(--r-pill);
    background: var(--game-bg);
    color: var(--game-ink);
    cursor: pointer;
    opacity: 0.85;
    transition: background var(--dur-1) ease, color var(--dur-1) ease, opacity var(--dur-1) ease;
}

.icon-btn:hover {
    background: var(--game-ink);
    color: var(--game-bg);
    opacity: 1;
}

.icon-btn svg {
    display: block;
    width: 0.85rem;
    height: 0.85rem;
    fill: currentColor;
}

.instructions {
    position: absolute;
    left: 50%;
    bottom: var(--space-4);
    transform: translateX(-50%);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--r-pill);
    background: var(--game-ink);
    color: var(--game-bg);
    font-size: var(--text-xs);
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    z-index: 3;
    transition: opacity var(--dur-3) ease;
}

.countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 4;
}

.countdown span {
    font-family: var(--font-display);
    font-size: clamp(5rem, 30vw, 10rem);
    font-weight: 800;
    color: var(--game-ink);
    opacity: 0;
}

.countdown.go span {
    animation: shiftedCountdown 0.6s ease-out;
}

@keyframes shiftedCountdown {
    0% { opacity: 0; transform: scale(0.4); }
    30% { opacity: 0.85; }
    100% { opacity: 0; transform: scale(1.4); }
}

.overlay-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    z-index: 5;
    transition: opacity var(--dur-2) ease;
}

.overlay-screen.visible {
    opacity: 1;
}

.game-over-card {
    padding: var(--space-10) var(--space-12);
    border-radius: var(--r-lg);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--glass-shadow);
    text-align: center;
    color: var(--game-ink);
    pointer-events: auto;
    transform: translateY(20px);
    animation: shiftedSlideUp 0.3s forwards;
}

@keyframes shiftedSlideUp {
    to { transform: translateY(0); }
}

.overlay-title {
    font-family: var(--font-display);
    font-size: var(--text-4xl);
    font-weight: 800;
    line-height: 1;
    margin-bottom: var(--space-2);
}

.overlay-score {
    font-size: var(--text-lg);
    font-weight: 600;
    opacity: 0.85;
    margin-bottom: var(--space-1);
}

.record-badge {
    height: 1rem;
    margin-bottom: var(--space-6);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--game-3);
}

.btn-restart {
    padding: 0.85rem 2.25rem;
    border: none;
    border-radius: var(--r-pill);
    background: var(--game-ink);
    color: var(--game-bg);
    font-size: var(--text-sm);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: transform var(--dur-1) var(--ease-standard);
}

.btn-restart:hover {
    transform: scale(1.05);
}

.how-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gap-lg);
    margin-top: var(--space-8);
}

@media (min-width: 48rem) {
    .how-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.how-grid h3 {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--text-strong);
}

.how-grid p {
    margin-top: var(--space-2);
    font-size: var(--text-sm);
    line-height: var(--lh-relaxed);
    color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
    .countdown.go span {
        animation-duration: 0.01s;
    }
    .game-over-card {
        animation: none;
        transform: none;
    }
}
