/* Bingo on a phone: the card fills the screen, the BINGO button is big and only lights up when it's true. Modern
   browsers only (the TV's Chromium 56 rules don't apply here). Night blue #13314a, cream #fff8e7, sun #ffd23f. */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { background: #13314a; color: #fff8e7; font: 600 17px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-user-select: none; user-select: none; overscroll-behavior: none; }
#app { min-height: 100%; display: flex; flex-direction: column; }
button { font: inherit; color: #13314a; border: 0; background: #fff8e7; border-radius: 16px; cursor: pointer; touch-action: manipulation; }
button:active { transform: translateY(2px); }
img { display: block; }
.pic, .av { width: 100%; height: 100%; pointer-events: none; }
.note { font-size: 15px; opacity: .75; text-align: center; }
h1 { font-size: 42px; font-weight: 800; color: #ffd23f; text-align: center; }
section { flex: 1; display: flex; flex-direction: column; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.center { align-items: center; justify-content: center; gap: 14px; text-align: center; }
.row { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
button.big { background: #ffd23f; padding: 14px 34px; font-size: 22px; font-weight: 800; box-shadow: 0 5px 0 rgba(0,0,0,.25); }
button.small { padding: 9px 16px; font-size: 15px; background: rgba(255,248,231,.15); color: #fff8e7; }
input { font: inherit; font-size: 20px; padding: 12px 14px; border-radius: 14px; border: 3px solid transparent; width: 100%; -webkit-user-select: text; user-select: text; }
input.need { border-color: #ff7a59; }
#code { width: 130px; text-align: center; letter-spacing: 6px; text-transform: uppercase; font-weight: 800; }

/* join */
.join { gap: 10px; max-width: 560px; margin: 0 auto; width: 100%; }
.join label { display: flex; flex-direction: column; gap: 6px; }
.join h2 { font-size: 16px; margin-top: 6px; opacity: .85; }
.group { display: flex; flex-wrap: wrap; gap: 10px; }
.group button { padding: 12px 16px; border: 4px solid transparent; background: rgba(255,248,231,.12); color: #fff8e7; }
.group button.on { border-color: #ffd23f; background: #fff8e7; color: #13314a; }
.group[data-group="kind"] button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; padding: 14px 8px; }
.group[data-group="kind"] .kt { font-size: 30px; line-height: 44px; }
.group[data-group="kind"] .kp { width: 44px; height: 44px; }
.group[data-group="lang"] button { flex: 1; }
.group[data-group="age"] button { width: 54px; font-size: 20px; font-weight: 800; }
.group[data-group="avatar"] button { width: calc(16.66% - 9px); aspect-ratio: 1; padding: 3px; border-radius: 50%; }
.toggle { flex-direction: row !important; align-items: center; gap: 12px !important; margin-top: 8px; }
.toggle small { display: block; font-size: 13px; opacity: .7; font-weight: 500; }
.switch { flex: none; width: 58px; height: 34px; border-radius: 17px; background: rgba(255,248,231,.25); position: relative; padding: 0; }
.switch i { position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff8e7; transition: left .2s; }
.switch.on { background: #3cba6b; }
.switch.on i { left: 28px; }

/* waiting */
.me { width: 120px; height: 120px; display: flex; flex-direction: column; align-items: center; }
.me b { margin-top: 6px; font-size: 20px; }
.lobby { align-items: center; gap: 8px; text-align: center; }
.lobby .me { height: auto; margin-bottom: 30px; }
.lobby .me .av { width: 100px; height: 100px; }
.lobby h2 { font-size: 26px; color: #ffd23f; }
.preview { width: 100%; max-width: 420px; margin-top: 12px; opacity: .85; pointer-events: none; }
.dots { display: flex; gap: 12px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: #fff8e7; opacity: .4; animation: blink 1.2s infinite; }
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }

/* playing: what was called last, the card, the button */
.play { gap: 10px; padding-top: calc(10px + env(safe-area-inset-top)); }
#now { display: flex; align-items: center; gap: 14px; min-height: 76px; }
#now .what b { display: block; font-size: 26px; font-weight: 800; }
#now .what small { font-size: 14px; opacity: .75; }
.ball { flex: none; width: 70px; height: 70px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #13314a; background: #e9e2d0; box-shadow: inset -5px -6px 0 rgba(0,0,0,.15); animation: pop .5s ease-out; }
.ball b { font-size: 14px; line-height: 1; }
.ball i { font-style: normal; font-weight: 800; font-size: 28px; line-height: 1.05; }
.ball.none { background: rgba(255,248,231,.15); color: #fff8e7; animation: none; }
.callpic { flex: none; width: 76px; height: 76px; border-radius: 16px; background: #fff8e7; padding: 6px; box-shadow: 0 0 0 4px #ffd23f; animation: pop .5s ease-out; }
.c-B { background: #3d8bfd; } .c-I { background: #ff5a5f; } .c-N { background: #e9e2d0; } .c-G { background: #3cba6b; } .c-O { background: #ffa62b; }
.t-0 { background: #3d8bfd; } .t-1 { background: #ff5a5f; } .t-2 { background: #3cba6b; } .t-3 { background: #ffa62b; } .t-4 { background: #a77bf3; }
.t-5 { background: #26c6da; } .t-6 { background: #ff7eb6; } .t-7 { background: #ffd23f; } .t-8 { background: #8bc34a; }

.cardwrap { flex: 1; display: flex; align-items: center; justify-content: center; }
.card { width: 100%; max-width: 460px; background: #fff8e7; border-radius: 20px; padding: 8px; box-shadow: 0 6px 0 rgba(0,0,0,.3); }
.head { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 6px; }
.head b { text-align: center; font-size: 24px; font-weight: 900; color: #fff; border-radius: 10px; line-height: 38px; }
.head b.c-N { color: #13314a; }
.cells { display: grid; gap: 6px; }
.c5x5 .cells { grid-template-columns: repeat(5, 1fr); }
.c9x3 .cells { grid-template-columns: repeat(9, 1fr); gap: 3px; }
.c3x3 .cells { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cell { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 12px; background: #fff; color: #13314a; font-size: 26px; font-weight: 800; box-shadow: inset 0 0 0 2px #e6dcc4; padding: 0; }
.c9x3 .cell { aspect-ratio: .8; font-size: 17px; border-radius: 7px; }
.c3x3 .cell { padding: 10%; border-radius: 18px; }
.cell.blank { background: #e9e2d0; box-shadow: none; }
.cell.free { background: #ffd23f; font-size: 28px; }
.cell.dab::after { content: ''; position: absolute; left: 8%; top: 8%; right: 8%; bottom: 8%; border-radius: 50%; background: rgba(255,90,95,.55); box-shadow: 0 0 0 3px rgba(255,90,95,.8); animation: dab .25s ease-out; }
.c3x3 .cell.dab::after { left: 4%; top: 4%; right: 4%; bottom: 4%; background: rgba(60,186,107,.16); box-shadow: 0 0 0 5px #3cba6b; border-radius: 22px; }
.cell.wiggle { animation: wiggle .5s; }

.msg { min-height: 24px; text-align: center; font-size: 16px; opacity: 0; transition: opacity .3s; }
.msg.show { opacity: 1; }
.bingo { width: 100%; padding: 18px; font-size: 34px; font-weight: 900; letter-spacing: 3px; background: rgba(255,248,231,.12); color: rgba(255,248,231,.35); border-radius: 22px; }
.bingo.lit { background: #ff7a59; color: #fff; box-shadow: 0 6px 0 #b8492f; animation: glow 1s ease-in-out infinite; }
.k-pic .bingo { padding: 26px; font-size: 42px; }
.pveil { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(9,24,38,.93); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; gap: 12px; z-index: 5; }
.pveil h2 { font-size: 44px; font-weight: 900; color: #ffd23f; }
.pveil p { font-size: 20px; }
.pveil .avs { display: flex; gap: 10px; }
.pveil .avs .av { width: 90px; height: 90px; }
.pveil .avs.big .av { width: 150px; height: 150px; animation: jump .7s ease-in-out infinite alternate; }
.pveil.party h2 { animation: pop .6s ease-out; }

/* game over */
.over { align-items: center; gap: 14px; text-align: center; justify-content: center; }
.prize { background: rgba(255,248,231,.1); border-radius: 18px; padding: 12px; width: 100%; max-width: 420px; }
.prize h3 { color: #ffd23f; margin-bottom: 8px; }
.prize .w { display: inline-block; width: 90px; margin: 0 6px; vertical-align: top; }
.prize .w .av { width: 64px; height: 64px; margin: 0 auto; }
.prize .w.me span { color: #ffd23f; }

@keyframes jump { from { transform: translateY(0); } to { transform: translateY(-18px); } }
@keyframes blink { 0%, 100% { opacity: .2; } 50% { opacity: .8; } }
@keyframes pop { from { transform: scale(.3); } 70% { transform: scale(1.1); } to { transform: scale(1); } }
@keyframes dab { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 0 #b8492f, 0 0 0 0 rgba(255,210,63,.8); } 50% { box-shadow: 0 6px 0 #b8492f, 0 0 0 12px rgba(255,210,63,0); } }
