/* ===== Reset & Variables ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg:       #0d0020;
    --bg2:      #160038;
    --card:     rgba(255 255 255 / .06);
    --border:   rgba(255 215 0  / .25);
    --gold:     #ffd700;
    --gold2:    #ffaa00;
    --orange:   #ff6b35;
    --green:    #27ae60;
    --red:      #e74c3c;
    --blue:     #3498db;
    --white:    #ffffff;
    --muted:    rgba(255 255 255 / .55);
    --radius:   12px;
    --radius-sm: 7px;
    --shadow:   0 8px 32px rgba(0 0 0 / .45);
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
.hidden { display: none !important; }

/* ===== Utility ===== */
.btn {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .55rem 1.2rem;
    border: none; border-radius: var(--radius-sm);
    font-size: .9rem; font-weight: 600; letter-spacing: .02em;
    transition: opacity .15s, transform .1s, box-shadow .15s;
}
.btn:hover  { opacity: .88; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-gold    { background: var(--gold);   color: #1a0533; }
.btn-orange  { background: var(--orange); color: #fff; }
.btn-outline { background: transparent; color: var(--gold); border: 1.5px solid var(--gold); }
.btn-ghost   { background: var(--card);   color: var(--white); border: 1px solid var(--border); }
.btn-red     { background: var(--red);    color: #fff; }
.btn-green   { background: var(--green);  color: #fff; }
.btn-sm      { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg      { padding: .75rem 1.8rem; font-size: 1.05rem; }
.btn-xl      { padding: 1.1rem 2.4rem; font-size: 1.25rem; border-radius: var(--radius); }

/* ===== Toast ===== */
.toast {
    position: fixed; bottom: 1.5rem; left: 50%; transform: translateX(-50%) translateY(6rem);
    padding: .65rem 1.4rem; border-radius: 99px;
    background: #2b1a4a; border: 1px solid var(--border);
    font-size: .9rem; font-weight: 500;
    transition: transform .3s ease; z-index: 9999; white-space: nowrap;
    pointer-events: none;
}
.toast.show    { transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); color: #7effa7; }
.toast.warn    { border-color: var(--gold2); color: var(--gold); }
.toast.info    { border-color: var(--blue);  color: #7ec8ff; }

/* ===== Modal ===== */
.modal {
    position: fixed; inset: 0;
    background: rgba(0 0 0 / .75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 500; padding: 1rem;
}
.modal-box {
    background: #1a0040; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.75rem;
    width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto;
    box-shadow: var(--shadow);
}
.modal-title { font-size: 1.25rem; font-weight: 700; color: var(--gold); margin-bottom: 1.1rem; }
.modal-actions { display: flex; gap: .7rem; flex-wrap: wrap; margin-top: 1.25rem; }

/* ===== Ticket (shared) ===== */
.ticket-card {
    background: #fff; color: #111;
    border-radius: var(--radius); overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .3s;
}
.ticket-card.full-house-glow { box-shadow: 0 0 0 4px var(--gold), var(--shadow); }

.ticket-header {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    color: #fff; padding: .6rem 1rem;
    display: flex; justify-content: space-between; align-items: center;
    font-size: .8rem;
}
.ticket-title { font-size: 1rem; font-weight: 800; letter-spacing: .1em; }
.ticket-id    { opacity: .85; font-size: .75rem; }

.ticket-grid { display: grid; }
.ticket-row  { display: grid; grid-template-columns: repeat(9, 1fr); }

.tcell {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: clamp(.75rem, 2.5vw, 1rem); font-weight: 700;
    border: 1px solid #ddd;
}
.tcell.blank  { background: #f5f5f5; color: transparent; }
.tcell.number { background: #fff; color: #222; cursor: pointer; transition: background .15s, color .15s; }
.tcell.number:hover { background: #fff8e1; }
.tcell.marked {
    background: #27ae60; color: #fff;
    text-decoration: line-through;
}
.ticket-row.row-win .tcell.marked { background: #d4ac0d; color: #1a0533; }

.ticket-footer {
    background: #f9f9f9; border-top: 1px solid #eee;
    padding: .4rem 1rem; font-size: .78rem; color: #555;
    display: flex; justify-content: flex-end;
}

/* Mini ticket (verify / claim preview) */
.ticket-mini { display: grid; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.ticket-mini .ticket-row { display: grid; grid-template-columns: repeat(9,1fr); }
.ticket-mini .tcell {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: clamp(.82rem, 2.2vw, 1.05rem); font-weight: 700;
    border: 1px solid #ddd;
}
.ticket-mini .tcell.blank { background: #f0f0f0; }
.ticket-mini .tcell.hit   { background: #27ae60; color: #fff; }
.ticket-mini .tcell.miss  { background: #fff; color: #444; }

/* Win badges */
.win-panel { display: flex; flex-wrap: wrap; gap: .5rem; }
.win-badge {
    display: flex; align-items: center; gap: .35rem;
    padding: .4rem .85rem; border-radius: 99px;
    border: 1.5px solid var(--border);
    font-size: .8rem; color: var(--muted);
    background: var(--card); transition: all .2s;
}
.win-badge.won {
    border-color: var(--gold); color: var(--gold);
    background: rgba(255 215 0 / .12);
    cursor: pointer; animation: badge-pulse 1.5s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255,215,0,.4); }
    50%       { box-shadow: 0 0 0 6px rgba(255,215,0,0); }
}
.badge-icon { font-size: .95rem; }

/* ===== Landing Page ===== */
.page-landing {
    background: radial-gradient(ellipse at 30% 20%, #2d0060 0%, var(--bg) 65%);
    min-height: 100vh; display: flex; flex-direction: column;
}
.landing-hero {
    flex: 1; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 3rem 1.5rem 2rem;
}
.landing-logo {
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 900; letter-spacing: .06em;
    background: linear-gradient(135deg, #ffd700, #ff8c00, #ff3e55);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; line-height: 1;
    filter: drop-shadow(0 0 18px rgba(255,215,0,.35));
}
.landing-sub {
    margin-top: .5rem; font-size: clamp(.9rem,2.5vw,1.15rem);
    color: var(--muted); letter-spacing: .05em;
}

.mode-cards {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem; margin-top: 2.5rem; width: 100%; max-width: 700px;
}
.mode-card {
    display: flex; flex-direction: column; align-items: center;
    gap: .75rem; padding: 2rem 1.5rem;
    background: var(--card); border: 1.5px solid var(--border);
    border-radius: var(--radius); text-align: center;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255,215,0,.12);
    border-color: var(--gold2);
}
.mode-card.host:hover { border-color: var(--orange); }

.mode-icon { font-size: 3rem; line-height: 1; }
.mode-card h2 { font-size: 1.4rem; font-weight: 800; }
.mode-card p  { font-size: .88rem; color: var(--muted); line-height: 1.5; }
.mode-card .enter-btn {
    margin-top: .5rem; padding: .6rem 1.6rem;
    border: none; border-radius: 99px;
    font-weight: 700; font-size: .9rem;
    transition: opacity .2s;
}
.mode-card.host   .enter-btn { background: var(--orange); color: #fff; }
.mode-card.player .enter-btn { background: var(--gold);   color: #1a0533; }
.mode-card:hover .enter-btn  { opacity: .88; }

.how-to-section {
    padding: 2.5rem 1.5rem; max-width: 860px; margin: 0 auto; width: 100%;
}
.how-to-section h3 { text-align: center; font-size: 1.1rem; color: var(--muted); margin-bottom: 1.25rem; letter-spacing: .08em; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.step {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.1rem 1rem; text-align: center;
}
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.2rem; height: 2.2rem; border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #1a0533; font-weight: 900; font-size: 1rem; margin-bottom: .6rem;
}
.step p { font-size: .84rem; color: var(--muted); line-height: 1.5; }

/* ===== Page shell (Host + Player) ===== */
.page-header {
    background: rgba(0 0 0 / .45); border-bottom: 1px solid var(--border);
    padding: .7rem 1.25rem;
    display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 100; backdrop-filter: blur(8px);
}
.page-title {
    font-size: 1.1rem; font-weight: 800; letter-spacing: .08em;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.header-right { margin-left: auto; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }

/* ===== Host Page ===== */
.host-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1rem; padding: 1rem;
    max-width: 1200px; margin: 0 auto;
    align-items: start;
}
@media (max-width: 900px) {
    .host-layout { grid-template-columns: 1fr; }
}

.host-main { display: flex; flex-direction: column; gap: 1rem; }

/* Call phrase card */
.call-card {
    background: linear-gradient(135deg, rgba(26,0,80,.95), rgba(45,0,96,.95));
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    display: flex; flex-direction: column; gap: .55rem;
    position: relative; overflow: hidden;
}
.call-card::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,215,0,.04), transparent);
    pointer-events: none;
}
@keyframes call-slide-in {
    0%   { opacity: 0; transform: translateY(-10px); }
    100% { opacity: 1; transform: translateY(0); }
}
.call-slide-in { animation: call-slide-in .35s ease forwards; }

.call-line {
    font-size: clamp(.82rem, 2.2vw, 1rem);
    line-height: 1.45;
    padding-left: 1.8rem;
    position: relative;
}
.call-line::before {
    content: '';
    position: absolute; left: 0; top: .15em;
    width: 1.2rem; height: 1.2rem;
    border-radius: 3px;
    display: flex; align-items: center; justify-content: center;
    font-size: .6rem; font-weight: 800; letter-spacing: 0;
    line-height: 1.2rem; text-align: center;
}
.call-line.en {
    color: #ffe680;
    font-weight: 600;
}
.call-line.en::before { content: 'EN'; background: #ffe680; color: #1a1a1a; }
.call-line.hi {
    color: #ffb347;
    font-weight: 500;
    font-size: clamp(.8rem, 2vw, .95rem);
}
.call-line.hi::before { content: 'हि'; background: #ffb347; color: #1a1a1a; font-size: .7rem; }
.call-line.ne {
    color: #7ec8ff;
    font-weight: 500;
    font-size: clamp(.8rem, 2vw, .95rem);
}
.call-line.ne::before { content: 'ने'; background: #7ec8ff; color: #1a1a1a; font-size: .7rem; }

/* Current draw panel */
.draw-panel {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1.25rem;
    display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap;
}
.current-number-wrap {
    position: relative; width: 5.5rem; height: 5.5rem; flex-shrink: 0;
}
.current-number {
    width: 5.5rem; height: 5.5rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    color: #1a0533; font-size: 2.2rem; font-weight: 900;
    box-shadow: 0 0 24px rgba(255,215,0,.45);
}
.empty-draw {
    width: 5.5rem; height: 5.5rem; border-radius: 50%;
    border: 3px dashed var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); font-size: .78rem; text-align: center; line-height: 1.3;
}
@keyframes pop-in {
    0%   { transform: scale(.4); opacity: 0; }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}
.pop-in { animation: pop-in .38s cubic-bezier(.22,.68,0,1.2) forwards; }

.draw-controls { display: flex; flex-direction: column; gap: .75rem; flex: 1; min-width: 180px; }
.auto-row      { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.speed-select {
    background: var(--card); border: 1px solid var(--border);
    color: var(--white); border-radius: var(--radius-sm);
    padding: .35rem .55rem; font-size: .82rem;
}
.stats-chips { display: flex; gap: .6rem; flex-wrap: wrap; }
.stat-chip {
    background: var(--card); border: 1px solid var(--border);
    border-radius: 99px; padding: .25rem .8rem; font-size: .8rem;
    color: var(--muted);
}
.stat-chip strong { color: var(--gold); }

/* Drawn strip */
.drawn-strip-wrap {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: .75rem 1rem;
    overflow: hidden;
}
.drawn-strip-label { font-size: .72rem; color: var(--muted); margin-bottom: .4rem; letter-spacing: .06em; }
.drawn-strip {
    display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .25rem;
    scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.strip-num {
    flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700;
    background: var(--card); border: 1px solid var(--border); color: var(--muted);
}
.strip-num.latest {
    background: var(--gold); color: #1a0533; border-color: var(--gold);
    font-size: .9rem;
}

/* Number board */
.board-wrap {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
}
.board-title { font-size: .75rem; color: var(--muted); letter-spacing: .08em; margin-bottom: .75rem; }
.number-board {
    display: grid; grid-template-columns: repeat(10, 1fr); gap: .3rem;
}
.board-cell {
    aspect-ratio: 1; border: none; border-radius: 6px;
    font-size: clamp(.7rem, 1.5vw, .88rem); font-weight: 700;
    background: rgba(255 255 255 / .06); color: var(--muted);
    transition: all .25s;
}
.board-cell.drawn  {
    background: rgba(255,215,0,.18); color: var(--gold);
    border: 1px solid rgba(255,215,0,.35);
}
.board-cell.latest {
    background: var(--gold); color: #1a0533;
    box-shadow: 0 0 14px rgba(255,215,0,.6);
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }

.sidebar-card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 1rem;
}
.sidebar-title { font-size: .8rem; color: var(--gold); letter-spacing: .08em; font-weight: 700; margin-bottom: .85rem; }

.claim-select {
    width: 100%; background: var(--bg2); border: 1px solid var(--border);
    color: var(--white); border-radius: var(--radius-sm);
    padding: .5rem .65rem; font-size: .88rem; margin-bottom: .75rem;
}
.ticket-input {
    width: 100%; background: var(--bg2); border: 1px solid var(--border);
    color: var(--white); border-radius: var(--radius-sm);
    padding: .5rem .65rem; font-size: .8rem; font-family: monospace;
    resize: vertical; min-height: 70px;
}
.ticket-input::placeholder { color: var(--muted); }

.verify-result { margin-top: .75rem; }
.verify-win, .verify-fail {
    padding: .6rem .85rem; border-radius: var(--radius-sm);
    font-size: .88rem; font-weight: 600;
}
.verify-win  { background: rgba(39,174,96,.2);  border: 1px solid var(--green); color: #7effa7; }
.verify-fail { background: rgba(231,76,60,.15); border: 1px solid var(--red);   color: #ff9f9f; }
.verify-win span, .verify-fail span { font-weight: 800; }
.error-text { color: var(--red); font-size: .85rem; margin-top: .5rem; }

/* Save winner row inside verify modal */
.save-winner-row {
    display: flex; align-items: center; gap: .5rem;
    margin-top: .65rem; padding: .6rem .75rem;
    background: rgba(255,215,0,.08); border: 1px solid rgba(255,215,0,.3);
    border-radius: var(--radius-sm);
}
.winner-name-input {
    flex: 1; min-width: 0;
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .45rem .7rem;
    color: var(--white); font-size: .88rem;
    outline: none;
}
.winner-name-input:focus { border-color: var(--gold); }

/* Winners panel in main game view */
.winners-section {
    background: var(--card); border: 1px solid rgba(255,215,0,.35);
    border-radius: var(--radius); padding: .85rem 1rem;
    margin-bottom: .5rem;
}
.winners-list { display: flex; flex-direction: column; gap: .45rem; margin-top: .5rem; }
.winner-entry {
    display: flex; align-items: center; gap: .65rem;
    background: rgba(255,215,0,.06); border: 1px solid rgba(255,215,0,.18);
    border-radius: var(--radius-sm); padding: .5rem .75rem;
    font-size: .85rem;
}
.winner-prize-icon { font-size: 1.2rem; flex-shrink: 0; }
.winner-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.winner-name { font-weight: 700; color: var(--white); }
.winner-meta { font-size: .75rem; color: var(--muted); }
.winner-ticket-id {
    font-family: monospace; font-size: .72rem; color: var(--gold2);
    flex-shrink: 0;
}
.winner-remove {
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 1.1rem; line-height: 1;
    padding: 0 .2rem; flex-shrink: 0;
    transition: color .15s;
}
.winner-remove:hover { color: var(--red); }

.decode-row { display: flex; gap: .5rem; }
.decode-row .ticket-input { flex: 1; min-height: auto; }
.decode-load-btn { align-self: flex-start; }

/* ===== Player Page ===== */
.player-layout {
    padding: 1rem; max-width: 780px; margin: 0 auto;
    display: flex; flex-direction: column; gap: 1rem;
}
.tab-bar {
    display: flex; gap: .4rem; flex-wrap: wrap;
}
.tab-btn {
    padding: .4rem 1rem; border: 1.5px solid var(--border);
    background: var(--card); color: var(--muted);
    border-radius: 99px; font-size: .85rem; font-weight: 600;
    transition: all .15s;
}
.tab-btn.active { background: var(--gold); color: #1a0533; border-color: var(--gold); }
.tab-btn.add-tab { color: var(--gold); border-style: dashed; }

.ticket-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

#ticketContainer { /* dynamic */ }

.claim-preview { margin: .75rem 0; }
.claim-code-box {
    background: var(--bg2); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: .6rem .85rem;
    font-family: monospace; font-size: .75rem; word-break: break-all;
    color: var(--gold2); max-height: 80px; overflow-y: auto;
}
.code-label { font-size: .75rem; color: var(--muted); margin-bottom: .35rem; }

/* ===== Book / 5-House Ticket Layout (Player Page) ===== */

.book-wrap {
    display: flex; flex-direction: column; gap: .75rem;
}

.book-header {
    background: linear-gradient(135deg, rgba(26,0,80,.9), rgba(45,0,96,.9));
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: .65rem 1rem;
    display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
}
.book-title {
    font-size: 1rem; font-weight: 900; letter-spacing: .14em;
    background: linear-gradient(135deg, var(--gold), var(--orange));
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent;
}
.book-meta  { font-size: .75rem; color: var(--muted); font-family: monospace; }
.book-marked { margin-left: auto; font-size: .75rem; color: var(--muted); }

.early-five-strip {
    display: flex; align-items: center; gap: .5rem;
    padding: .35rem .5rem;
}
.ef-badge {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .35rem .9rem; border-radius: 99px;
    border: 1.5px solid var(--border);
    font-size: .82rem; font-weight: 600; color: var(--muted);
    background: var(--card); transition: all .2s;
}
.ef-badge.won {
    border-color: var(--gold); color: var(--gold);
    background: rgba(255,215,0,.12);
    cursor: pointer; animation: badge-pulse 1.5s ease-in-out infinite;
}

/* Individual house block */
.house-block {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
}

.house-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: .45rem .75rem; gap: .5rem;
}
.house-label {
    font-size: .78rem; font-weight: 700; color: #fff;
    letter-spacing: .06em; text-transform: uppercase;
}
.house-badges { display: flex; gap: .3rem; }
.hbadge {
    background: rgba(0 0 0 / .25); border: 1px solid rgba(255 255 255 / .25);
    color: rgba(255 255 255 / .6);
    border-radius: 6px; padding: .2rem .35rem;
    font-size: .82rem; line-height: 1; cursor: default;
    transition: all .15s;
}
.hbadge.won {
    background: rgba(255,215,0,.22); border-color: var(--gold);
    color: var(--gold); cursor: pointer;
    animation: badge-pulse 1.5s ease-in-out infinite;
}

/* House grid */
.house-grid { display: flex; flex-direction: column; }
.house-row  {
    display: grid; grid-template-columns: repeat(9, 1fr);
    border-top: 1px solid rgba(255 255 255 / .07);
}
.house-row.row-win { background: rgba(255,215,0,.07); }

.hcell {
    aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
    font-size: clamp(.7rem, 1.8vw, .9rem); font-weight: 700;
    border-right: 1px solid rgba(255 255 255 / .07);
    transition: background .15s, color .15s;
}
.hcell:last-child { border-right: none; }
.hcell.blank { background: rgba(255 255 255 / .03); color: transparent; }
.hcell.num   { color: var(--white); cursor: pointer; }
.hcell.num:hover { background: rgba(255,215,0,.14); }
.hcell.num.marked {
    background: rgba(39,174,96,.3); color: #7effa7;
    text-decoration: line-through;
}
.house-row.row-win .hcell.marked {
    background: rgba(255,215,0,.25); color: var(--gold);
}

/* Claim modal house mini */
.claim-house-mini { margin-bottom: .65rem; }
.claim-house-label {
    font-size: .72rem; color: var(--muted); letter-spacing: .05em;
    text-transform: uppercase; margin-bottom: .3rem;
}

/* ===== Host Mode — Mobile responsive (≤ 600px) ===== */
@media (max-width: 600px) {

    /* Header: 2-row layout — home+title on row 1, actions on row 2 */
    .page-header { padding: .45rem .75rem; gap: .3rem; }
    .page-title  { font-size: .88rem; }
    .header-right {
        width: 100%; margin-left: 0;
        justify-content: space-between; gap: .35rem;
    }
    .stats-chips { flex: 1; gap: .35rem; }
    .stat-chip   { font-size: .75rem; padding: .2rem .65rem; }

    /* Host layout padding */
    .host-layout { padding: .45rem; gap: .55rem; }

    /* Draw panel — stack number + controls vertically, centred */
    .draw-panel {
        flex-direction: column;
        align-items: center;
        padding: 1rem .85rem;
        gap: .9rem;
    }
    .current-number-wrap { width: 6.5rem; height: 6.5rem; }
    .current-number      { width: 6.5rem; height: 6.5rem; font-size: 2.6rem; }
    .empty-draw          { width: 6.5rem; height: 6.5rem; font-size: .85rem; }
    .draw-controls       { width: 100%; min-width: 0; }
    #btnDraw             { width: 100%; justify-content: center; }
    .auto-row            { gap: .45rem; }
    .auto-row .speed-select { flex: 1; min-width: 0; }

    /* Number board — tighter grid */
    .board-wrap   { padding: .6rem .4rem; }
    .number-board { gap: .15rem; }
    .board-cell   { border-radius: 4px; }

    /* Drawn strip */
    .drawn-strip-wrap { padding: .55rem .75rem; }

    /* Call card */
    .call-card { padding: .8rem .9rem; }

    /* Winners panel */
    .winner-ticket-id { display: none; }
    .winner-entry { gap: .45rem; padding: .45rem .6rem; }
    .winner-meta  { font-size: .7rem; }

    /* Verify modal — bottom-sheet style */
    .modal { padding: .25rem; align-items: flex-end; }
    .modal-box {
        max-height: 93vh;
        padding: 1.1rem .9rem;
        border-radius: var(--radius) var(--radius) 0 0;
    }
    .modal-title { font-size: 1.05rem; margin-bottom: .85rem; }
    .modal-actions { flex-direction: column; }
    .modal-actions .btn { text-align: center; justify-content: center; }

    /* Ticket code input area — stack vertically */
    .decode-row { flex-direction: column; gap: .45rem; }
    .decode-row .btn { align-self: stretch; text-align: center; justify-content: center; }

    /* Save-winner row — stacked on mobile */
    .save-winner-row { flex-wrap: wrap; gap: .45rem; }
    .winner-name-input { flex-basis: 100%; }
    .save-winner-row .btn { flex: 1; justify-content: center; }

    /* Sidebar cards — reduce padding to save vertical space */
    .sidebar-card { padding: .75rem; }
    .sidebar-title { margin-bottom: .55rem; }
}

/* Very small phones (≤ 380px) — hide secondary sidebar to reduce scrolling */
@media (max-width: 380px) {
    .sidebar { display: none; }
}

/* ===== Print styles ===== */
@media print {
    body { background: #fff; color: #000; }
    .page-header, .tab-bar, .ticket-actions, .win-panel, .toast, .modal,
    .house-badges, .early-five-strip { display: none !important; }
    .player-layout { padding: 0; }
    .book-wrap { gap: .4rem; }
    .book-header { background: #333; color: #fff; }
    .house-block { border: 1px solid #999; break-inside: avoid; }
    .house-header { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .hcell { color: #000; border-color: #ccc; }
    .hcell.blank { background: #f0f0f0; }
    .hcell.marked { background: #27ae60 !important; color: #fff !important; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
