/* Logic King page: the game's own look (charcoal, white and orange, chess ranks, coloured puzzle shapes).
   Only loaded on /games/logic-king; the site header and footer keep Blurrydream's style. */

@font-face {
    font-family: 'Big Shoulders Display';
    src: url('/public/fonts/big-shoulders-display.woff2') format('woff2');
    font-weight: 100 900;
    font-display: swap;
}

body.theme-logicking {
    --bg: #0E0E10;
    --surface: #1A1A1D;
    --surface-strong: #232327;
    --border: rgba(255, 255, 255, 0.1);
    --lk-orange: #FF7A1A;
    --lk-orange-soft: rgba(255, 122, 26, 0.16);
    --lk-white: #F4F4F4;
    --lk-green: #2DB04A;
    --lk-blue: #2F8FD8;
    --lk-red: #E84A3F;
    --lk-peach: #E07B4F;
    --lk-font: 'Big Shoulders Display', var(--font-display);
    --muted: rgba(244, 244, 244, 0.72);
    --faint: rgba(244, 244, 244, 0.5);
    background: #0E0E10;
}

/* faint chessboard that fades out towards the bottom */
body.theme-logicking::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background: repeating-conic-gradient(#17171A 0 25%, #0E0E10 0 50%) 0 0 / 72px 72px;
    -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
    mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 0%, transparent 75%);
    pointer-events: none;
}

.theme-logicking #bg {
    background: transparent;
}

.theme-logicking .section-title {
    font-family: var(--lk-font);
    font-weight: 900;
    font-size: clamp(32px, 5vw, 52px);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.theme-logicking .breadcrumb a:hover {
    color: var(--lk-orange);
}

.theme-logicking .btn-ghost:hover {
    border-color: var(--lk-orange);
}

/* ---------- Hero ---------- */

.lk-hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: clamp(32px, 6vw, 72px);
    align-items: center;
    margin-top: 18px;
}

.lk-icon {
    width: clamp(88px, 11vw, 120px);
    height: auto;
    border-radius: 24%;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.lk-logo {
    margin: 20px 0 6px;
    font-family: var(--lk-font);
    font-weight: 900;
    font-size: clamp(64px, 10vw, 118px);
    line-height: 0.9;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--lk-white);
}

.lk-logo span {
    color: var(--lk-orange);
}

.lk-tagline {
    font-family: var(--lk-font);
    font-weight: 800;
    font-size: clamp(22px, 3vw, 30px);
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--lk-white);
}

.lk-tagline span {
    color: var(--lk-orange);
}

.lk-text {
    max-width: 560px;
    margin: 16px 0 28px;
    color: var(--muted);
}

.lk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.lk-appstore {
    background: var(--lk-white);
    color: #111;
    box-shadow: 0 10px 30px rgba(255, 122, 26, 0.25);
}

.lk-appstore:hover {
    background: #fff;
    box-shadow: 0 14px 40px rgba(255, 122, 26, 0.4);
}

.lk-appstore--dark {
    background: #111;
    color: var(--lk-white);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.lk-appstore--dark:hover {
    background: #000;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
}

.lk-systems {
    display: flex;
    gap: 8px;
    list-style: none;
}

.lk-systems li {
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--faint);
    font-size: 13px;
}

/* ---------- Playable phone ---------- */

.lk-try {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lk-phone {
    width: min(100%, 320px);
    padding: 12px;
    background: #050505;
    border-radius: 44px;
    box-shadow:
        0 0 0 2px #2A2A2E,
        0 30px 70px rgba(0, 0, 0, 0.7),
        0 0 60px rgba(255, 122, 26, 0.18);
}

.lk-screen {
    display: flex;
    flex-direction: column;
    min-height: 540px;
    padding: 26px 18px 18px;
    background: #141416;
    border-radius: 34px;
    color: var(--lk-white);
}

.lk-puzzle {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.lk-puzzle[hidden] {
    display: none;
}

.lk-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lk-level {
    font-family: var(--lk-font);
    font-weight: 900;
    font-size: 22px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.lk-crown {
    width: 20px;
    height: 20px;
    color: var(--lk-white);
}

.lk-rank {
    color: var(--faint);
    font-size: 12px;
}

.lk-board {
    display: grid;
    flex: 1;
    place-items: center;
    margin: 14px 0 10px;
    padding: 18px 8px;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    font-size: 22px;
}

.lk-seq {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 14px;
}

.lk-seq b,
.lk-grid b,
.lk-eq b {
    font-weight: 500;
}

.lk-q {
    color: var(--lk-orange);
}

.lk-eq {
    display: grid;
    gap: 14px;
}

.lk-eq p {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lk-dot,
.lk-sq {
    display: inline-block;
    width: 24px;
    height: 24px;
}

.lk-dot {
    border-radius: 50%;
    background: var(--lk-peach);
}

.lk-sq {
    background: var(--lk-green);
}

.lk-grid {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    gap: 3px;
}

.lk-grid b {
    display: grid;
    place-items: center;
    height: 48px;
    background: #0B0B0C;
}

.lk-feedback {
    min-height: 22px;
    margin-bottom: 8px;
    font-size: 14px;
    text-align: center;
}

.lk-feedback.is-good {
    color: var(--lk-green);
}

.lk-feedback.is-bad {
    color: var(--lk-red);
}

.lk-keys {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.lk-answer {
    display: flex;
    grid-column: span 2;
    align-items: center;
    padding: 0 10px;
    min-height: 40px;
    background: #1F1F22;
    border-radius: 6px;
    color: var(--faint);
    font-size: 13px;
}

.lk-answer.has-value {
    color: var(--lk-white);
    font-size: 18px;
}

.lk-key {
    min-height: 40px;
    background: #1F1F22;
    border: 0;
    border-radius: 6px;
    color: var(--lk-white);
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.lk-key:hover {
    background: #2A2A2E;
}

.lk-key:active {
    transform: scale(0.94);
}

.lk-key:focus-visible {
    outline: 2px solid var(--lk-orange);
    outline-offset: 2px;
}

.lk-key--fn {
    color: var(--faint);
}

.lk-key--enter {
    grid-column: span 2;
    font-family: var(--lk-font);
    font-weight: 800;
    letter-spacing: 1px;
}

.lk-key--enter:hover {
    background: var(--lk-orange);
    color: #111;
}

.lk-phone.is-good .lk-board {
    border-color: var(--lk-green);
    background: rgba(45, 176, 74, 0.1);
}

.lk-phone.is-bad .lk-board {
    animation: lk-shake 0.35s ease;
    border-color: var(--lk-red);
}

@keyframes lk-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

.lk-try-caption {
    margin-top: 16px;
    color: var(--lk-orange);
    font-family: var(--lk-font);
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ---------- The King's Path ---------- */

.lk-path {
    display: grid;
    gap: 10px;
    max-width: 820px;
    margin: 0 auto;
    list-style: none;
}

.lk-step {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.lk-step:hover {
    background: #1D5A2C;
    border-color: var(--lk-green);
}

.lk-step-piece {
    display: grid;
    flex-shrink: 0;
    place-items: center;
    width: 52px;
    height: 52px;
    background: #111;
    border-radius: 8px;
    color: var(--lk-white);
    font-family: 'Segoe UI Symbol', 'DejaVu Sans', 'Noto Sans Symbols 2', serif;
    font-size: 30px;
    line-height: 1;
}

.lk-step:last-child .lk-step-piece {
    background: var(--lk-orange);
    color: #111;
}

.lk-step-body {
    flex: 1;
    min-width: 0;
}

.lk-step-body h3 {
    font-family: var(--lk-font);
    font-weight: 800;
    font-size: 22px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.lk-step-body p {
    color: var(--muted);
    font-size: 16px;
}

.lk-step-rank {
    flex-shrink: 0;
    color: var(--faint);
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.lk-rank span {
    font-family: 'Segoe UI Symbol', 'DejaVu Sans', 'Noto Sans Symbols 2', serif;
}

/* ---------- Gallery ---------- */

.lk-gallery .gallery-item {
    border-radius: 14px;
    border: 1px solid var(--border);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.lk-gallery .gallery-item:hover {
    transform: translateY(-6px);
    border-color: var(--lk-orange);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(255, 122, 26, 0.25);
}

/* ---------- CTA ---------- */

.lk-cta {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: clamp(36px, 6vw, 60px) var(--gutter);
    background: var(--lk-orange);
    border-radius: 20px;
    color: #111;
    text-align: center;
    box-shadow: 0 24px 60px rgba(255, 122, 26, 0.25);
}

.lk-cta-crown {
    width: 52px;
    height: 52px;
}

.lk-cta-title {
    margin: 6px 0 4px;
    font-family: var(--lk-font);
    font-weight: 900;
    font-size: clamp(44px, 7vw, 76px);
    line-height: 1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.lk-cta-text {
    margin-bottom: 24px;
    font-size: 18px;
}

@media (max-width: 860px) {
    .lk-hero-grid {
        grid-template-columns: 1fr;
    }

    .lk-brand {
        text-align: center;
    }

    .lk-icon {
        margin: 0 auto;
    }

    .lk-text {
        margin-left: auto;
        margin-right: auto;
    }

    .lk-actions {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .lk-step {
        gap: 14px;
        padding: 14px;
    }

    .lk-step-rank {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lk-phone.is-bad .lk-board {
        animation: none;
    }
}
