/* ============================================================
   SHREEWIN LUCKY CHALLENGE — GAME STYLES
   ============================================================ */

:root {
    --g-bg: #f4f6f5;
    --g-card: #ffffff;
    --g-text: #111318;
    --g-muted: #6b7280;
    --g-border: #e5e7eb;
    --g-primary: #14532d;
    --g-primary-hover: #0f4023;
    --g-accent: #b98a2f;
    --g-win: #15803d;
    --g-lose: #b91c1c;
    --g-radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--g-bg);
    color: var(--g-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.game-header {
    background: #fff;
    border-bottom: 1px solid var(--g-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--g-text); }
.brand span { font-weight: 700; font-size: 1.05rem; }
.back-link { color: var(--g-primary); text-decoration: none; font-size: 0.92rem; font-weight: 500; }
.back-link:hover { text-decoration: underline; }

/* Layout */
.game-wrap { flex: 1; display: flex; justify-content: center; padding: 32px 16px; }
.game-card {
    background: var(--g-card);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    box-shadow: 0 10px 30px rgba(17, 19, 24, 0.07);
    max-width: 560px;
    width: 100%;
    padding: 32px 28px;
    text-align: center;
}
.game-card h1 { font-size: 1.5rem; letter-spacing: -0.02em; margin-bottom: 6px; }
.game-tagline { color: var(--g-muted); font-size: 0.9rem; margin-bottom: 22px; }

/* Scoreboard */
.scoreboard { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.score-box {
    flex: 1;
    background: #f8f9fb;
    border: 1px solid var(--g-border);
    border-radius: 10px;
    padding: 12px 8px;
}
.score-label { display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--g-muted); margin-bottom: 4px; }
.score-value { font-size: 1.35rem; font-weight: 700; }

/* Difficulty */
.difficulty { display: flex; gap: 8px; justify-content: center; margin-bottom: 22px; }
.diff-btn {
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 999px;
    border: 1px solid var(--g-border);
    background: #fff;
    color: var(--g-text);
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    min-height: 40px;
}
.diff-btn:hover { border-color: var(--g-primary); }
.diff-btn.is-active { background: var(--g-primary); border-color: var(--g-primary); color: #fff; }

/* Game area */
.instructions { color: var(--g-muted); font-size: 0.92rem; margin-bottom: 16px; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.tiles.cols-4 { grid-template-columns: repeat(4, 1fr); }
.tile {
    aspect-ratio: 1;
    font-size: 1.6rem;
    border-radius: 12px;
    border: 1px solid var(--g-border);
    background: linear-gradient(180deg, #ffffff, #f3f4f6);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
}
.tile:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 6px 14px rgba(17, 19, 24, 0.1); }
.tile:disabled { cursor: default; }
.tile.revealed { color: inherit; background: #fff; }
.tile.win { background: #ecfdf5; border-color: var(--g-win); animation: pop 0.35s ease; }
.tile.lose { background: #fef2f2; border-color: #fecaca; }

@keyframes pop {
    0% { transform: scale(0.9); }
    60% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.result { min-height: 28px; font-weight: 700; font-size: 1.02rem; margin-bottom: 14px; }
.result.win { color: var(--g-win); }
.result.lose { color: var(--g-lose); }

/* Actions */
.game-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.btn-game {
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 44px;
    transition: background 0.15s ease;
}
.btn-go { background: var(--g-primary); color: #fff; }
.btn-go:hover { background: var(--g-primary-hover); }
.btn-reset { background: #fff; border-color: var(--g-border); color: var(--g-text); }
.btn-reset:hover { border-color: var(--g-text); }
.btn-sound { background: #fff; border-color: var(--g-border); color: var(--g-muted); }

/* History */
.history-wrap { text-align: left; margin-bottom: 18px; }
.history-wrap h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--g-muted); margin-bottom: 10px; }
.history { list-style: none; max-height: 160px; overflow-y: auto; border: 1px solid var(--g-border); border-radius: 10px; }
.history li { padding: 9px 14px; font-size: 0.87rem; border-bottom: 1px solid var(--g-border); display: flex; justify-content: space-between; gap: 10px; }
.history li:last-child { border-bottom: none; }
.history .h-win { color: var(--g-win); font-weight: 600; }
.history .h-lose { color: var(--g-lose); font-weight: 600; }
.history-empty { color: var(--g-muted); }

.disclaimer { font-size: 0.78rem; color: var(--g-muted); line-height: 1.5; }
.game-about { margin-top: 28px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,0.08); }
.game-about h2 { font-size: 1.1rem; margin-bottom: 10px; }
.game-about p { font-size: 0.92rem; color: var(--g-muted); line-height: 1.6; margin-bottom: 10px; }
.game-about a { color: inherit; text-decoration: underline; }

/* Footer */
.game-footer { text-align: center; padding: 18px; color: var(--g-muted); font-size: 0.85rem; }
.game-footer a { color: var(--g-primary); text-decoration: none; }

:focus-visible { outline: 2px solid var(--g-primary); outline-offset: 2px; }

@media (max-width: 420px) {
    .game-card { padding: 24px 16px; }
    .scoreboard { flex-direction: row; }
    .score-value { font-size: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
