/* Lucky Code (/lucky-code) */
.lc-page {
    --lc-border: var(--vr-gray-200, #e5e7eb);
    --lc-surface: var(--vr-gray-50, #f9fafb);
    --lc-box-bg: #fff;
    --lc-muted: var(--vr-gray-500, #6b7280);
    --lc-accent: var(--vr-color-main, #2563eb);
    --lc-good: #16a34a;
    --lc-bad: #dc2626;
    max-width: 820px;
    margin: 24px auto 48px;
}

[data-bs-theme="dark"] .lc-page {
    --lc-border: var(--vr-gray-700, #374151);
    --lc-surface: var(--vr-gray-800, #1f2937);
    --lc-box-bg: var(--vr-gray-900, #111827);
    --lc-muted: var(--vr-gray-400, #9ca3af);
}

.lc-head { text-align: center; margin-bottom: 20px; }
.lc-title { font-size: 2rem; font-weight: 800; margin: 0 0 8px; }
.lc-lead { color: var(--lc-muted); margin: 0 auto; max-width: 580px; }

.lc-notice, .lc-card {
    border: 1px solid var(--lc-border);
    background: var(--lc-surface);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 16px;
}
.lc-notice { text-align: center; }

.lc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.lc-stat { border: 1px solid var(--lc-border); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; }
.lc-stat span { color: var(--lc-muted); font-size: 12px; }
.lc-stat strong { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Countdown */
.lc-clock { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.lc-code-label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.lc-next-label { color: var(--lc-muted); font-size: 14px; }
.lc-timer { position: relative; width: 60px; height: 60px; flex: 0 0 auto; }
.lc-timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.lc-timer circle { fill: none; stroke-width: 8; }
.lc-timer-bg { stroke: var(--lc-border); }
.lc-timer-fg { stroke: var(--lc-accent); stroke-linecap: round; }
.lc-timer span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.lc-clock.is-low .lc-timer-fg { stroke: var(--lc-bad); }
.lc-clock.is-low .lc-timer span { color: var(--lc-bad); }

/* Four boxes */
.lc-boxes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.lc-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 14px 10px;
    border: 2px solid var(--lc-border);
    border-radius: 12px;
    background: var(--lc-box-bg);
    transition: border-color .2s;
}
.lc-box-label { color: var(--lc-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.lc-box-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: clamp(1.8rem, 6vw, 2.4rem);
    font-weight: 800;
    letter-spacing: .1em;
    line-height: 1;
    color: var(--lc-accent);
}
.lc-box { padding: 16px 10px; }

/* One guess under the boxes */
.lc-form { margin-top: 18px; text-align: center; }
.lc-form-label { display: block; font-weight: 600; margin-bottom: 8px; }
.lc-form-row { display: flex; justify-content: center; gap: 8px; }
.lc-input {
    width: 140px;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: .25em;
    padding: 6px 8px 6px 14px;
    border: 2px solid var(--lc-border);
    border-radius: 10px;
    background: var(--vr-body-bg, #fff);
    color: inherit;
}
.lc-input:focus { outline: none; border-color: var(--lc-accent); }
.lc-input:disabled { opacity: .85; }
.lc-form.is-guessed .lc-input { border-color: var(--lc-accent); }
.lc-btn { font-weight: 700; padding: 0 22px; }
.lc-form-state { min-height: 20px; margin-top: 10px; font-size: 14px; color: var(--lc-muted); }
.lc-form-state.is-guessed { color: var(--lc-accent); font-weight: 700; }
.lc-form-state.is-error { color: var(--lc-bad); font-weight: 700; }

.lc-drawn { margin-right: 6px; }
.lc-drawn.is-match { color: var(--lc-good); font-weight: 800; text-decoration: underline; }

.lc-state { text-align: center; min-height: 20px; margin-top: 10px; color: var(--lc-bad); font-weight: 700; font-size: 14px; }

.lc-results { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.lc-result { padding: 10px 12px; border-radius: 10px; font-weight: 700; text-align: center; font-size: 14px; }
.lc-result.is-win { background: rgba(22, 163, 74, .12); color: var(--lc-good); }
.lc-result.is-lose { background: rgba(107, 114, 128, .12); color: var(--lc-muted); }

.lc-rules { margin: 18px 0 0; padding-left: 18px; color: var(--lc-muted); font-size: 14px; }

.lc-history-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 10px; }
.lc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.lc-table th { color: var(--lc-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--lc-border); }
.lc-table td { padding: 8px; border-bottom: 1px solid var(--lc-border); }
.lc-table .lc-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.lc-table .lc-empty { text-align: center; color: var(--lc-muted); }
.lc-row-win td { color: var(--lc-good); font-weight: 700; }
.lc-row-pending td { color: var(--lc-accent); }

@media (max-width: 767px) {
    .lc-boxes { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 575px) {
    .lc-stats { grid-template-columns: 1fr; }
    .lc-card { padding: 14px; }
}
