/* =====================================================================
   SUDOKA — стили игры «Выключи свет»
   Самодостаточный файл: подключается только на странице игры.
   ===================================================================== */

.lot-page { max-width: 640px; margin-inline: auto; }

.lot-head { text-align: center; margin-bottom: 1rem; }
.lot-head h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); }
.lot-head p { color: var(--ink-muted); max-width: 46ch; margin: .35rem auto 0; }

/* ---------- Панель управления ---------- */
.lot-toolbar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
    gap: .75rem; margin-bottom: .9rem;
}
.lot-size-group {
    display: inline-flex; background: var(--bg-alt); border-radius: 999px; padding: .25rem; gap: .15rem;
}
.lot-size-btn {
    border: 0; background: transparent; color: var(--ink-muted); font-weight: 800; font-size: .9rem;
    padding: .4rem .85rem; border-radius: 999px; transition: background .15s, color .15s;
}
.lot-size-btn:hover { color: var(--terracotta-d); }
.lot-size-btn.active { background: var(--terracotta); color: #fff; box-shadow: var(--shadow-sm); }
.lot-actions { display: inline-flex; gap: .5rem; align-items: center; }

/* ---------- Статистика ---------- */
.lot-stats {
    display: flex; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
    color: var(--ink-muted); font-weight: 700; font-size: .95rem; margin-bottom: .75rem;
}
.lot-stats b { color: var(--ink); }
.lot-stats .num {
    display: inline-block; min-width: 2.6ch; text-align: center;
    font-variant-numeric: tabular-nums; color: var(--terracotta-d);
}

/* ---------- Игровое поле ---------- */
.lot-wrap { position: relative; }

.lot-grid {
    width: 100%;
    max-width: 520px;
    aspect-ratio: 1 / 1;
    margin: 0 auto;
    display: grid;
    gap: 3px;
    background: var(--border);
    border: 3px solid var(--ink);
    border-radius: 12px;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    padding: 3px;
}

.lot-cell {
    background: var(--ink-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: background .2s ease, box-shadow .2s ease;
    position: relative;
}
.lot-cell:hover { 
    background: color-mix(in srgb, var(--ink-muted) 85%, var(--card) 15%);
    box-shadow: inset 0 0 0 2px var(--terracotta-l);
}
.lot-cell.on {
    background: #F0B340;
    box-shadow: 0 0 12px rgba(240, 179, 64, 0.55), 0 0 4px rgba(240, 179, 64, 0.35);
}
.lot-cell.on:hover {
    background: #F5C862;
    box-shadow: 0 0 16px rgba(240, 179, 64, 0.7), 0 0 6px rgba(240, 179, 64, 0.5);
}

/* Подсветка при наведении на строку/столбец */
.lot-cell.highlight {
    background: color-mix(in srgb, var(--ink-muted) 75%, var(--terracotta-l) 25%);
}
.lot-cell.on.highlight {
    background: color-mix(in srgb, #F0B340 75%, #fff 25%);
}

/* ---------- Подсказка ---------- */
.lot-help {
    text-align: center; color: var(--ink-muted); font-size: .9rem; margin-top: .9rem;
}
.lot-help kbd {
    background: var(--bg-alt); border: 1px solid var(--border); border-bottom-width: 2px;
    border-radius: 5px; padding: .05rem .4rem; font-size: .8rem; font-family: var(--font);
}

/* ---------- Финальное окно ---------- */
.lot-modal {
    position: fixed; inset: 0;
    background: rgba(58, 46, 42, .45);
    display: flex; align-items: center; justify-content: center;
    z-index: 999; visibility: hidden; opacity: 0; pointer-events: none;
    transition: opacity .3s, visibility .3s;
    padding: 1rem;
}
.lot-modal.show { visibility: visible; opacity: 1; pointer-events: auto; }

.lot-result {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem 2.5rem;
    text-align: center;
    max-width: 92vw;
}
.lot-result-msg { font-size: 1.8rem; line-height: 1.15; margin-bottom: .4rem; }
.lot-result-msg.lot-win { color: var(--sage-d); }
.lot-result-stats { color: var(--ink-muted); margin-bottom: 1.25rem; font-weight: 700; }
.lot-result .btn { margin-top: .25rem; }

/* ---------- Анимация решалки ---------- */
.lot-grid.solving .lot-cell {
    pointer-events: none;
}
