/* Tambola: a carnival night. Charcoal-blue room, gold lights, a red ball, tickets in pastel paper. */
:root {
    --bg: #161a2b; --bg2: #232a45; --card: #1e2440; --text: #fff7e6; --dim: #aeb6d6; --line: rgba(255,247,230,.18);
    --gold: #ffc531; --red: #e63946; --green: #2fb344; --ink: #151a2b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; color: var(--text); min-height: 100vh;
    background-color: var(--bg);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='%23ffc531' fill-opacity='.07'%3E%3Ccircle cx='20' cy='24' r='5'/%3E%3Ccircle cx='96' cy='60' r='3.5'/%3E%3Ccircle cx='54' cy='112' r='4.5'/%3E%3Ccircle cx='122' cy='122' r='3'/%3E%3C/g%3E%3C/svg%3E"),
        radial-gradient(1000px 520px at 50% -10%, #34406e 0%, transparent 70%);
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.site-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 0 18px; min-height: 46px; background: #003a7a; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.site-bar a { text-decoration: none; color: #dbe7fb; font-weight: 700; font-size: 14px; }
.site-bar a:hover { color: #fff; }
.site-bar .brand { font-size: 20px; font-weight: 800; color: #fff; letter-spacing: .2px; white-space: nowrap; }
.site-bar nav { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: flex-end; }
.site-bar nav a.on { color: #fff; box-shadow: 0 3px 0 var(--gold); }

.shell { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 760px) minmax(0, 1fr); gap: 18px; max-width: 1420px; margin: 0 auto; padding: 14px 12px 0; align-items: start; }
.rail { max-width: 300px; width: 100%; justify-self: center; margin-top: 8px; }
.stage { grid-column: 2; min-width: 0; }

/* ---------- buttons ---------- */
.btn { border: 0; border-radius: 12px; background: var(--text); color: var(--ink); font-family: 'Bungee', 'Nunito', sans-serif; font-size: 16px; padding: 10px 18px; box-shadow: 0 4px 0 rgba(0,0,0,.45); transition: transform .08s, box-shadow .08s, filter .15s; text-decoration: none; display: inline-block; text-align: center; line-height: 1.3; letter-spacing: .5px; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.45); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn.go { background: #3ed27c; width: 100%; font-size: 19px; padding: 12px 16px; }
.btn.sun { background: var(--gold); } .btn.coral { background: #ff6b6b; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { font-size: 14px; padding: 8px 14px; }
.btn.wa { background: #25d366; color: #05361a; }

/* ---------- the start screen ---------- */
.home { text-align: center; padding: 8px 0 20px; }
.logo { margin: 0; display: flex; justify-content: center; gap: 4px; font-family: 'Bungee', sans-serif; font-weight: 400; font-size: clamp(44px, 10vw, 84px); line-height: 1.05; text-shadow: 0 5px 0 rgba(0,0,0,.35); }
.logo span { display: inline-block; }
.logo span:nth-child(1) { color: #ff6b6b; transform: rotate(-5deg); } .logo span:nth-child(2) { color: var(--gold); transform: rotate(3deg); }
.logo span:nth-child(3) { color: #3ed27c; transform: rotate(-3deg); } .logo span:nth-child(4) { color: #4cc9f0; transform: rotate(4deg); }
.logo span:nth-child(5) { color: #c4a0ff; transform: rotate(-4deg); } .logo span:nth-child(6) { color: #ff6b6b; transform: rotate(3deg); }
.logo span:nth-child(7) { color: var(--gold); transform: rotate(-3deg); }
.tag { margin: 10px auto 20px; max-width: 600px; color: var(--dim); font-size: 17px; line-height: 1.5; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; text-align: left; }
.mode { background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 8px 0 rgba(0,0,0,.28); }
.mode h2 { margin: 0; font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 20px; line-height: 1.15; }
.mode .mtext { margin: 0; color: var(--dim); font-size: 14.5px; line-height: 1.5; }
.mode .btn.go { margin-top: auto; }
.field { display: grid; gap: 6px; }
.lab { font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--dim); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.seg button { border: 2px solid var(--line); background: transparent; border-radius: 10px; padding: 8px 4px; font-weight: 800; font-size: 15px; }
.seg button.on { background: var(--text); color: var(--ink); border-color: var(--text); }
.field input { height: 44px; border: 2px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.25); padding: 0 12px; font-size: 16px; font-weight: 700; }
.field input:focus { border-color: var(--gold); outline: none; }
.err { margin: 14px 0 0; background: #ffe3df; color: #8c2314; border-radius: 10px; padding: 10px 14px; font-weight: 700; }

/* ---------- the game ---------- */
.game { display: grid; justify-items: center; gap: 12px; padding: 4px 0 18px; }
.play { position: relative; display: grid; gap: 12px; width: 100%; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.chip { background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 800; display: inline-flex; gap: 6px; align-items: center; }
.chip.me { border-color: var(--gold); }
.chip.away { opacity: .55; }
.chip b { background: var(--gold); color: var(--ink); border-radius: 999px; padding: 0 7px; font-size: 12px; }

.caller { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 12px 16px; box-shadow: 0 8px 0 rgba(0,0,0,.28); }
.ballwrap { width: 128px; height: 128px; display: grid; place-items: center; }
.ball { width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 34% 30%, #ff8a8a 0%, #e63946 45%, #a3182a 100%); box-shadow: 0 8px 0 rgba(0,0,0,.4), inset 0 -8px 14px rgba(0,0,0,.25); position: relative; }
.ball::before { content: ''; position: absolute; inset: 22px; border-radius: 50%; background: #fff7e6; box-shadow: inset 0 3px 8px rgba(0,0,0,.2); }
.ball span { position: relative; font-family: 'Bungee', sans-serif; font-size: 46px; color: #7a0f1d; line-height: 1; }
.ball.pop { animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.4) rotate(-20deg); } 100% { transform: scale(1) rotate(0); } }
.callinfo { min-width: 0; }
.nick { margin: 0; font-family: 'Bungee', sans-serif; font-size: 20px; line-height: 1.2; color: var(--gold); min-height: 1.3em; }
.timer { margin: 4px 0 8px; font-weight: 800; color: var(--dim); }
.last { display: flex; flex-wrap: wrap; gap: 6px; }
.last i { font-style: normal; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-family: 'Bungee', sans-serif; font-size: 14px; background: #fff7e6; color: #7a0f1d; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
.last i:first-child { background: var(--gold); }

.tickets { display: grid; gap: 12px; }
.ticket { border-radius: 14px; padding: 8px 8px 10px; color: #2a2208; box-shadow: 0 6px 0 rgba(0,0,0,.3); position: relative; background: var(--tb, #fff1b8); border: 3px solid var(--tc, #e0b928); }
.ticket.t1 { --tb: #ffdde4; --tc: #e9879b; } .ticket.t2 { --tb: #d9f1ff; --tc: #6bb6e3; }
.ticket .th { font-family: 'Bungee', sans-serif; font-size: 12px; letter-spacing: 1px; color: rgba(42,34,8,.6); margin: 0 0 4px 4px; display: flex; justify-content: space-between; }
.tgrid { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 3px; }
.c { aspect-ratio: 1 / 1.08; border: 0; border-radius: 6px; padding: 0; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: clamp(14px, 3.6vw, 24px); line-height: 1; background: #fffdf5; color: #2a2208; position: relative; box-shadow: inset 0 0 0 1.5px rgba(42,34,8,.25); display: grid; place-items: center; }
.c.blank { background: repeating-linear-gradient(135deg, rgba(42,34,8,.22) 0 2px, transparent 2px 7px), rgba(42,34,8,.06); box-shadow: none; cursor: default; }
.c.num { cursor: pointer; }
.c.mk { color: #fff; }
.c.mk::before { content: ''; position: absolute; inset: 9%; border-radius: 50%; background: rgba(230,57,70,.92); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.c.mk span { position: relative; }
.c.latest { animation: latest 1s ease-in-out infinite alternate; }
@keyframes latest { from { box-shadow: inset 0 0 0 1.5px rgba(42,34,8,.25), 0 0 0 0 rgba(255,197,49,0); } to { box-shadow: inset 0 0 0 2px #e0a800, 0 0 0 4px rgba(255,197,49,.7); } }

.panelrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.prizes { display: grid; gap: 6px; background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px; }
.pz { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; background: rgba(0,0,0,.2); border-radius: 10px; padding: 6px 8px 6px 12px; min-height: 46px; }
.pz b { font-size: 14px; display: block; }
.pz .who { font-size: 12px; color: var(--dim); font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pz.won { background: rgba(62,210,124,.16); } .pz.won .who { color: #7ee2a8; }
.pz .btn { font-size: 12px; padding: 8px 12px; background: var(--gold); }
.board90 { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 10px; }
.bh { margin: 0 0 6px; font-size: 13px; color: var(--dim); font-weight: 700; }
.bh b { color: var(--gold); }
.b90 { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; }
.b90 i { font-style: normal; text-align: center; font-size: 11px; font-weight: 800; padding: 3px 0; border-radius: 4px; background: rgba(255,255,255,.06); color: #7e87ad; }
.b90 i.on { background: #fff7e6; color: #7a0f1d; }
.b90 i.last { background: var(--gold); color: var(--ink); }

.opts { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: center; }
.tg { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; cursor: pointer; }
.tg input { width: 18px; height: 18px; accent-color: var(--gold); }
.acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.acts .btn.go { width: auto; padding: 10px 24px; }
.banner { position: absolute; left: 50%; top: 22%; transform: translateX(-50%); width: min(92%, 440px); background: rgba(21,26,43,.97); border: 3px solid var(--gold); border-radius: 18px; padding: 14px 18px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.6); z-index: 5; }
.banner h3 { margin: 0 0 6px; font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 24px; color: var(--gold); }
.banner p { margin: 3px 0; font-weight: 700; font-size: 14px; }

.lobby { width: min(100%, 520px); background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 16px; display: grid; gap: 10px; box-shadow: 0 8px 0 rgba(0,0,0,.28); }
.lobby h2 { margin: 0; text-align: center; font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 22px; }
.invrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.invrow input { height: 40px; border: 2px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.3); padding: 0 10px; font-size: 14px; min-width: 0; }
.invrow2 { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lobsub { margin: 4px 0 0; text-align: center; color: var(--dim); font-weight: 700; }
.lobplayers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; }
.lobplayers li { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,.25); border-radius: 10px; padding: 7px 10px; font-weight: 800; font-size: 14px; }
.lobplayers li i { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); flex: 0 0 auto; }
.lobplayers li span { color: var(--dim); font-weight: 700; font-size: 12px; margin-left: auto; }
.lobset { display: grid; gap: 8px; }
.lobset label { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-weight: 800; font-size: 14px; }
.lobset select { height: 38px; border: 2px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.3); padding: 0 10px; font-weight: 700; }
.lobset select option { color: #111; }
.lobwait { margin: 0; text-align: center; color: var(--dim); font-weight: 700; }

.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 50; background: #0b0e1a; color: #fff; padding: 10px 18px; border-radius: 12px; font-weight: 800; box-shadow: 0 6px 20px rgba(0,0,0,.6); max-width: 90vw; text-align: center; }
.netbar { position: fixed; left: 0; right: 0; top: 0; z-index: 60; background: #b91c1c; color: #fff; text-align: center; padding: 6px; font-weight: 800; font-size: 14px; }

/* ---------- ads and the footer ---------- */
.adbox { background: rgba(255,255,255,.06); border-radius: 12px; padding: 6px 8px 8px; overflow: hidden; min-width: 0; }
.adbox small { display: block; text-align: center; font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); margin-bottom: 4px; }
.adbox ins { min-height: 90px; }
.rail .adbox ins { min-height: 250px; }
.adbottom { width: calc(100% - 24px); max-width: 980px; margin: 18px auto 0; }
.site-foot { background: #0d1020; color: #a9b1d1; text-align: center; padding: 22px 16px 26px; font-size: 14px; line-height: 1.6; }
.site-foot p { margin: 4px 0; }
.site-foot a { color: #fff; text-decoration: none; font-weight: 700; }
.site-foot a:hover { text-decoration: underline; }
.site-foot .copy { font-size: 12px; opacity: .7; }

/* ---------- the text under the start screen ---------- */
.about { background: #f6f4ee; color: #1d2240; margin-top: 30px; padding: 30px 16px 40px; }
body.in-game .about { display: none; }
.abwrap { max-width: 760px; margin: 0 auto; }
.about h2 { font-family: 'Bungee', sans-serif; font-weight: 400; font-size: 22px; margin: 26px 0 10px; }
.about h2:first-child { margin-top: 0; }
.about p, .rules { line-height: 1.65; }
.rules { padding-left: 22px; } .rules li { margin: 6px 0; }
.feat { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.feat li { background: #fff; border: 2px solid #e3dccb; border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; }
.feat li span { color: #54597a; font-size: 14.5px; line-height: 1.5; }
details { border: 2px solid #e3dccb; background: #fff; border-radius: 12px; padding: 10px 14px; margin: 8px 0; }
summary { font-weight: 800; cursor: pointer; }
details p { margin: 8px 0 2px; color: #54597a; }
.note { margin-top: 24px; color: #6b6f8e; font-size: 14px; }

/* ---------- a tablet and a phone ---------- */
@media (max-width: 1180px) {
    .shell { grid-template-columns: minmax(0, 760px); justify-content: center; }
    .rail { display: none; }
    .stage { grid-column: 1; }
}
@media (max-width: 760px) {
    .modes { grid-template-columns: minmax(0, 1fr); }
    .panelrow { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
    .site-bar { padding: 0 12px; }
    .site-bar nav a:first-child { display: none; }
    .caller { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 10px; }
    .ballwrap { width: 100px; height: 100px; } .ball { width: 94px; height: 94px; } .ball::before { inset: 17px; } .ball span { font-size: 34px; }
    .nick { font-size: 15px; }
    .last i { width: 30px; height: 30px; font-size: 12px; }
    .tgrid { gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    .ball.pop, .c.latest { animation: none; }
    .btn { transition: none; }
}

@media (max-width: 480px) {
    .site-bar nav { gap: 4px 12px; flex-wrap: nowrap; }
    .site-bar nav a { font-size: 13px; }
    .site-bar .brand { font-size: 17px; }
}
