:root {
    --pink: #ff4d8d;
    --cyan: #38e8ff;
    --yellow: #ffd23f;
    --green: #7cff6b;
    --bg: #12091f;
    --bg2: #1d1033;
    --card: rgba(36, 20, 60, .82);
    --text: #f6f0ff;
    --muted: #b7a6d6;
    --font-fun: 'Bangers', 'Impact', system-ui, sans-serif;
    --font-body: 'Fredoka', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: radial-gradient(ellipse at top, #2c1352 0%, var(--bg) 60%) fixed;
    color: var(--text);
    font-family: var(--font-body);
}

h1:focus { outline: none; }
a { color: var(--cyan); }

/* ---------- Layout ---------- */
.pub { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }

.bg-board {
    position: fixed; inset: auto -220px -220px auto; width: 640px; height: 640px; border-radius: 50%;
    background: repeating-conic-gradient(from 9deg, #0b0614 0 18deg, #2b0f1b 18deg 36deg),
                radial-gradient(circle, transparent 0);
    opacity: .22; pointer-events: none; z-index: 0;
    mask: radial-gradient(circle, #000 0 58%, transparent 59% 62%, #000 63% 95%, transparent 96%);
    animation: spin 120s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pub-bar.k-appbar {
    position: sticky; top: 0; z-index: 10;
    background: rgba(18, 9, 31, .85) !important;
    backdrop-filter: blur(10px);
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(90deg, var(--pink), var(--cyan), var(--yellow)) 1;
    padding: .4rem 1.2rem;
}

.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text); }
.brand-dart { font-size: 1.8rem; display: inline-block; animation: wobble 4s ease-in-out infinite; }
.brand-text { font-family: var(--font-fun); font-size: 1.9rem; letter-spacing: 2px; text-shadow: 0 0 12px rgba(255, 77, 141, .7); }
.brand-text span { color: var(--pink); }
@keyframes wobble { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(15deg) scale(1.1); } }

.pub-nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.pub-nav a {
    color: var(--muted); text-decoration: none; padding: .45rem .85rem; border-radius: 999px; font-weight: 600;
    transition: all .2s;
}
.pub-nav a:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.pub-nav a.active { color: #1a0b2e; background: var(--yellow); box-shadow: 0 0 16px rgba(255, 210, 63, .5); }
.logout-form { margin: 0; }

.pub-main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
.pub-footer { position: relative; z-index: 1; text-align: center; color: var(--muted); padding: 1rem; font-size: .9rem; }

.page-title { font-family: var(--font-fun); font-size: 2.6rem; letter-spacing: 1.5px; margin: .2rem 0 .4rem; text-shadow: 3px 3px 0 #000, 0 0 18px rgba(56, 232, 255, .4); }
.muted { color: var(--muted); }

/* ---------- Telerik tweaks ---------- */
.k-card.pub-card {
    background: var(--card); border: 1px solid rgba(255, 255, 255, .08); border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45); backdrop-filter: blur(6px); color: var(--text);
}
.pub-card .k-card-header { border-bottom: 1px dashed rgba(255, 255, 255, .12); background: transparent; }
.pub-card .k-card-title { font-family: var(--font-fun); font-size: 1.6rem; letter-spacing: 1px; }
.card-emoji { display: inline-block; animation: wobble 3s ease-in-out infinite; }
.k-button { font-family: var(--font-body); font-weight: 600; border-radius: 12px; }
.k-button-solid-primary { background: linear-gradient(135deg, var(--pink), #ff7a59); border-color: transparent; box-shadow: 0 4px 0 #9c1f50; }
.k-button-solid-primary:hover { filter: brightness(1.1); }
.k-button-solid-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #9c1f50; }
.k-grid.pub-grid { border-radius: 16px; overflow: hidden; background: var(--card); }
.pub-notification .k-notification { font-size: 1.1rem; padding: .8rem 1.2rem; border-radius: 14px; }
.grid-emoji { font-size: 1.6rem; }
.swatch { display: inline-block; width: 46px; height: 22px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, .5); }

/* ---------- Home ---------- */
.hero { text-align: center; margin: 1rem 0 2rem; }
.hero-title { font-family: var(--font-fun); font-size: clamp(2.4rem, 6vw, 4.2rem); margin: 0; letter-spacing: 2px; text-shadow: 4px 4px 0 #000; }
.hero-title span { color: var(--yellow); display: inline-block; transform: rotate(-3deg); }
.hero-sub { color: var(--muted); font-size: 1.2rem; }

.home-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.5rem; }
.side-col { display: flex; flex-direction: column; gap: 1.5rem; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }

.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .8rem; margin: 1rem 0; }
.pick {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem .5rem;
    border-radius: 18px; border: 2px solid rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04);
    color: var(--text); cursor: pointer; font-family: var(--font-body); font-size: 1rem; transition: all .18s;
}
.pick:hover { transform: translateY(-3px) rotate(-1deg); border-color: var(--pc); }
.pick.on { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 22%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--pc) 55%, transparent); }
.pick-emoji { font-size: 2.4rem; }
.pick.on .pick-emoji { animation: bounce .6s ease; }
.pick-name { font-weight: 700; }
.pick-order {
    position: absolute; top: -10px; right: -10px; width: 30px; height: 30px; border-radius: 50%;
    background: var(--yellow); color: #1a0b2e; font-weight: 700; display: grid; place-items: center; box-shadow: 0 2px 0 #000;
}
@keyframes bounce { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.4) rotate(-10deg); } 70% { transform: scale(.9); } }

.options-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.2rem; }
.switch-label { display: flex; align-items: center; gap: .7rem; }
.switch-label small { color: var(--muted); }
.big-go.k-button { width: 100%; font-family: var(--font-fun); font-size: 2rem !important; letter-spacing: 2px; padding: .8rem; }

.game-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.game-list a {
    display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 1rem; border-radius: 12px;
    background: rgba(255, 255, 255, .05); color: var(--text); text-decoration: none; transition: background .2s;
}
.game-list a:hover { background: rgba(255, 255, 255, .12); }
.game-list .go { color: var(--green); white-space: nowrap; font-weight: 700; }
.game-list .when { color: var(--muted); white-space: nowrap; }

/* ---------- Game ---------- */
.game-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.game-actions { display: flex; gap: .5rem; }
.round-chip { font-family: var(--font-body); font-size: 1rem; vertical-align: middle; background: var(--cyan); color: #1a0b2e; padding: .2rem .7rem; border-radius: 999px; letter-spacing: 0; text-shadow: none; }

.banter {
    text-align: center; font-size: 1.4rem; font-weight: 700; padding: .8rem 1rem; border-radius: 16px; margin-bottom: 1rem;
    background: rgba(56, 232, 255, .12); border: 2px solid rgba(56, 232, 255, .4); animation: pop .5s cubic-bezier(.2, 1.6, .5, 1);
}
.banter.bust { background: rgba(255, 59, 59, .15); border-color: #ff3b3b; }
.banter.ton { background: rgba(255, 210, 63, .15); border-color: var(--yellow); }
.banter.max { background: linear-gradient(90deg, #ff3b3b55, #ff8c4255, #ffd23f55); border-color: #ff8c42; font-size: 1.9rem; font-family: var(--font-fun); letter-spacing: 2px; }
.banter.meh { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .2); }
.banter.won { background: rgba(124, 255, 107, .15); border-color: var(--green); }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.winner-ribbon {
    text-align: center; padding: .8rem; margin-bottom: 1rem; border-radius: 16px; font-size: 1.3rem;
    background: linear-gradient(90deg, #ffd23f33, #ff4d8d33); border: 2px solid var(--yellow);
}

.scoreboard { display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: .8rem; margin-bottom: 1rem; }
@media (max-width: 560px) { .scoreboard { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.player-card {
    position: relative; padding: .8rem .8rem .6rem; border-radius: 18px; background: var(--card);
    border: 2px solid color-mix(in srgb, var(--pc) 35%, transparent);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .4); transition: transform .3s, box-shadow .3s; opacity: .78; min-width: 0;
}
.player-card.up {
    opacity: 1; transform: translateY(-3px); border-color: var(--pc);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 30%, transparent), 0 0 30px color-mix(in srgb, var(--pc) 55%, transparent);
    animation: glow 1.6s ease-in-out infinite alternate;
}
.player-card.winner { opacity: 1; border-color: var(--yellow); box-shadow: 0 0 30px rgba(255, 210, 63, .6); }
@keyframes glow { to { box-shadow: 0 0 0 5px color-mix(in srgb, var(--pc) 15%, transparent), 0 0 50px color-mix(in srgb, var(--pc) 70%, transparent); } }

.up-flag {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%) rotate(-2deg); white-space: nowrap;
    background: var(--pc); color: #10061c; font-family: var(--font-fun); letter-spacing: 1.2px; font-size: .9rem;
    padding: .05rem .6rem; border-radius: 999px; box-shadow: 0 3px 0 #000; animation: wiggle 1.2s ease-in-out infinite;
}
@keyframes wiggle { 0%, 100% { transform: translateX(-50%) rotate(-3deg); } 50% { transform: translateX(-50%) rotate(3deg); } }

.pc-head { display: flex; align-items: center; gap: .4rem; font-size: 1.05rem; font-weight: 700; min-width: 0; }
.pc-emoji { font-size: 1.5rem; }
.pc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crown { margin-left: auto; font-size: 1.4rem; animation: bounce 1.2s infinite; }
.pc-score {
    font-family: var(--font-fun); font-size: clamp(2.6rem, 6vw, 3.8rem); line-height: 1; text-align: center; margin: .2rem 0 .3rem;
    color: var(--pc); text-shadow: 3px 3px 0 #000, 0 0 22px color-mix(in srgb, var(--pc) 60%, transparent);
    animation: pop .45s cubic-bezier(.2, 1.6, .5, 1);
}
.pc-progress.k-progressbar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.pc-progress .k-selected, .pc-progress .k-progress-status-wrap.k-selected { background: var(--pc) !important; }
.pc-stats { display: flex; justify-content: space-between; gap: .3rem; color: var(--muted); margin-top: .45rem; font-weight: 600; font-size: .85rem; }
.pc-checkout { margin-top: .4rem; text-align: center; padding: .2rem; border-radius: 8px; background: rgba(124, 255, 107, .12); color: var(--green); font-weight: 700; font-size: .85rem; }
.pc-history { display: flex; gap: .25rem; margin-top: .45rem; min-height: 1.4rem; flex-wrap: wrap; }
.hist { padding: .05rem .4rem; border-radius: 6px; background: rgba(255, 255, 255, .08); font-weight: 600; font-size: .78rem; }
.hist.bust { background: rgba(255, 59, 59, .25); color: #ffb3b3; text-decoration: line-through; }
.hist.ton { background: rgba(255, 210, 63, .25); color: var(--yellow); }

/* Score entry + calculator (sits on top of the board) */
.throw-panel {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "display keypad" "quick keypad";
    gap: .8rem 1.2rem; align-items: start; padding: 1rem; border-radius: 20px; margin-bottom: 1rem;
    background: linear-gradient(135deg, color-mix(in srgb, var(--pc) 18%, var(--bg2)), var(--bg2));
    border: 2px solid color-mix(in srgb, var(--pc) 50%, transparent); box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
}
@media (max-width: 600px) { .throw-panel { grid-template-columns: 1fr; grid-template-areas: "display" "keypad" "quick"; } }
.throw-display { grid-area: display; min-width: 0; }
.throw-who { font-size: 1.2rem; font-weight: 700; }
.throw-expr { color: var(--cyan); font-weight: 700; font-size: 1.15rem; min-height: 1.5rem; letter-spacing: .5px; overflow-wrap: anywhere; }
.throw-value { font-family: var(--font-fun); font-size: 4.6rem; line-height: 1; color: var(--yellow); text-shadow: 4px 4px 0 #000; }
.throw-value.invalid { color: #ff6b6b; animation: shakeX .4s; }
.throw-value.empty { color: var(--muted); opacity: .35; }
.throw-after { color: var(--muted); font-weight: 600; min-height: 1.5rem; margin-top: .2rem; }
.throw-after .warn { color: #ff6b6b; }
.throw-after .win { color: var(--green); font-size: 1.3rem; }

.keypad { grid-area: keypad; display: grid; grid-template-columns: repeat(4, 66px); gap: .45rem; user-select: none; -webkit-user-select: none; }
@media (max-width: 600px) { .keypad { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.keypad .key.k-button {
    height: 56px; font-size: 1.7rem; font-family: var(--font-fun); letter-spacing: 1px; background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15); color: var(--text); box-shadow: 0 4px 0 rgba(0, 0, 0, .5); border-radius: 12px;
}
.keypad .key.k-button:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .5); }
.keypad .key-fn.k-button { background: rgba(255, 255, 255, .03); color: var(--muted); }
.keypad .key-op.k-button { background: rgba(56, 232, 255, .14); border-color: rgba(56, 232, 255, .45); color: var(--cyan); }
.keypad .key-mod.k-button { background: rgba(178, 107, 255, .18); border-color: rgba(178, 107, 255, .5); color: #d6b8ff; }
.keypad .key-go.k-button { grid-column: 1 / -1; background: linear-gradient(135deg, var(--pink), #ff7a59); font-size: 1.6rem; letter-spacing: 2px; }

.quick { grid-area: quick; min-width: 0; }
.quick-title { font-family: var(--font-fun); font-size: 1.1rem; letter-spacing: 1px; margin-bottom: .4rem; }
.quick-grid { display: flex; flex-wrap: wrap; gap: .4rem; }
.quick-btn.k-button { min-width: 64px; height: 46px; font-size: 1.05rem; border-radius: 12px; }
.quick-btn.q180.k-button { border-color: #ff8c42; color: #ff8c42; }
.quick-btn.q0.k-button { border-color: #888; color: #bbb; }
.checkout-btn.k-button { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

/* ---------- Celebration ---------- */
.celebration { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(8, 3, 16, .82); backdrop-filter: blur(4px); animation: fadeIn .4s; }
.cel-rays {
    position: absolute; width: 180vmax; height: 180vmax; opacity: .25;
    background: repeating-conic-gradient(var(--pc) 0 10deg, transparent 10deg 20deg);
    animation: spin 25s linear infinite; mask: radial-gradient(circle, #000 0, transparent 60%);
}
.cel-box {
    position: relative; text-align: center; padding: 2rem 2.5rem; border-radius: 32px; max-width: 680px; width: calc(100% - 2rem);
    background: linear-gradient(160deg, #2a1350, #12091f); border: 3px solid var(--yellow);
    box-shadow: 0 0 80px rgba(255, 210, 63, .5); animation: zoomIn .7s cubic-bezier(.2, 1.6, .5, 1);
}
.cel-trophy { font-size: 6rem; line-height: 1; animation: trophy 1.4s ease-in-out infinite; filter: drop-shadow(0 0 25px rgba(255, 210, 63, .9)); }
.cel-emoji { font-size: 3rem; margin-top: -.5rem; animation: bounce 1s infinite; }
.cel-title {
    font-family: var(--font-fun); font-size: clamp(3rem, 9vw, 5.5rem); line-height: 1; letter-spacing: 3px;
    background: linear-gradient(90deg, var(--yellow), var(--pink), var(--cyan), var(--yellow)); background-size: 300% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: rainbow 3s linear infinite;
    filter: drop-shadow(4px 4px 0 #000);
}
.cel-msg { font-size: 1.4rem; font-weight: 700; margin: .5rem 0 1.2rem; }
.cel-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1rem; }
.cel-stats div { background: rgba(255, 255, 255, .07); border-radius: 14px; padding: .6rem; display: flex; flex-direction: column; }
.cel-stats b { font-family: var(--font-fun); font-size: 2rem; color: var(--yellow); letter-spacing: 1px; }
.cel-stats span { color: var(--muted); font-size: .85rem; }
.cel-losers { display: flex; flex-direction: column; gap: .2rem; color: var(--muted); margin-bottom: 1.4rem; }
.cel-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes zoomIn { from { transform: scale(.3) rotate(-12deg); opacity: 0; } }
@keyframes trophy { 0%, 100% { transform: rotate(-8deg) scale(1); } 50% { transform: rotate(8deg) scale(1.12); } }
@keyframes rainbow { to { background-position: 300% 0; } }
@keyframes shakeX { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.fx-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 2000; }
body.fx-shake .pub-main { animation: bigShake .7s; }
body.fx-bust .pub-main { animation: bigShake .5s; }
body.fx-bust::after { content: ""; position: fixed; inset: 0; background: rgba(255, 0, 0, .25); pointer-events: none; animation: fadeOut .8s forwards; z-index: 1500; }
@keyframes bigShake {
    10%, 90% { transform: translate(-2px, 1px) rotate(-.5deg); }
    20%, 80% { transform: translate(4px, -2px) rotate(.5deg); }
    30%, 50%, 70% { transform: translate(-8px, 3px) rotate(-1deg); }
    40%, 60% { transform: translate(8px, -3px) rotate(1deg); }
}
@keyframes fadeOut { to { opacity: 0; } }

/* ---------- Leaderboard ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 1rem; margin: 2rem 0; }
.podium-step {
    width: 180px; text-align: center; border-radius: 20px 20px 6px 6px; padding: 1rem .5rem;
    background: linear-gradient(180deg, color-mix(in srgb, var(--pc) 35%, var(--bg2)), var(--bg2)); border: 2px solid var(--pc);
}
.podium-step.p1 { order: 2; min-height: 240px; box-shadow: 0 0 40px rgba(255, 210, 63, .5); border-color: var(--yellow); }
.podium-step.p2 { order: 1; min-height: 200px; }
.podium-step.p3 { order: 3; min-height: 170px; }
.podium-emoji { font-size: 3rem; animation: bounce 2s infinite; }
.podium-name { font-weight: 700; font-size: 1.2rem; }
.podium-medal { font-size: 2.4rem; }
.podium-wins { font-family: var(--font-fun); font-size: 1.4rem; letter-spacing: 1px; color: var(--yellow); }
.lb-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; }
@media (max-width: 1100px) { .lb-grid { grid-template-columns: 1fr; } }

/* ---------- Settings ---------- */
.settings-card { max-width: 520px; }

/* ---------- Login ---------- */
.login-pub { display: grid; place-items: center; padding: 1rem; }
.login-card {
    position: relative; z-index: 1; width: 100%; max-width: 420px; text-align: center; padding: 2.5rem 2rem; border-radius: 28px;
    background: var(--card); border: 2px solid rgba(255, 77, 141, .5); box-shadow: 0 0 60px rgba(255, 77, 141, .35);
    animation: zoomIn .6s cubic-bezier(.2, 1.6, .5, 1);
}
.login-dart { font-size: 4.5rem; animation: wobble 3s ease-in-out infinite; }
.login-title { font-family: var(--font-fun); font-size: 3rem; letter-spacing: 2px; margin: 0; text-shadow: 3px 3px 0 #000; }
.login-title span { color: var(--pink); }
.login-sub { color: var(--muted); margin-top: .2rem; }
.login-form { display: flex; flex-direction: column; gap: .7rem; text-align: left; margin-top: 1.5rem; }
.login-form label { font-weight: 600; }
.login-input {
    font-family: var(--font-body); font-size: 1.2rem; padding: .8rem 1rem; border-radius: 14px; color: var(--text);
    background: rgba(0, 0, 0, .35); border: 2px solid rgba(255, 255, 255, .15); outline: none; transition: border-color .2s;
}
.login-input:focus { border-color: var(--cyan); box-shadow: 0 0 18px rgba(56, 232, 255, .35); }
.login-error { color: #ff8080; font-weight: 600; animation: shakeX .4s; }
.login-button {
    margin-top: .5rem; font-family: var(--font-fun); font-size: 1.8rem; letter-spacing: 2px; padding: .6rem; border: 0; border-radius: 14px;
    cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--pink), #ff7a59); box-shadow: 0 5px 0 #9c1f50; transition: transform .1s;
}
.login-button:active { transform: translateY(4px); box-shadow: 0 1px 0 #9c1f50; }

/* ---------- Blazor plumbing ---------- */
.validation-message { color: #ff8080; }

#blazor-error-ui {
    color-scheme: light only; background: lightyellow; color: #000; bottom: 0; box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    box-sizing: border-box; display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 3000;
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

.blazor-error-boundary { background: #b32121; padding: 1rem; color: white; }
.blazor-error-boundary::after { content: "An error has occurred."; }

/* ---------- Language switch ---------- */
.lang-switch { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); }
.lang-switch .lang { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .6rem; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .85rem; }
.lang-switch .lang:hover { color: var(--text); background: rgba(255, 255, 255, .08); }
.lang-switch .lang.on { background: var(--cyan); color: #1a0b2e; }
.lang-switch .flag { font-size: 1rem; line-height: 1; }
.login-lang { position: fixed; top: 1rem; right: 1rem; z-index: 2; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 520px)); gap: 1.2rem; }

/* ---------- Touch / tablet (iPad mini) ---------- */
button, a, .k-button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.game-head .page-title { font-size: 2rem; margin: 0; }
.game-meta { font-size: .9rem; }
.game-head { margin-bottom: .8rem; align-items: center; }
.banter { font-size: 1.15rem; padding: .55rem .8rem; margin-bottom: .8rem; }
.banter.max { font-size: 1.5rem; }

@media (max-width: 1100px) {
    .pub-nav .nav-label, .logout-form .nav-label { display: none; }
    .pub-nav a { font-size: 1.25rem; padding: .35rem .6rem; }
    .pub-bar.k-appbar { padding: .3rem .7rem; }
    .brand-text { font-size: 1.6rem; }
    .pub-main { padding: 1rem .8rem 2rem; }
}
@media (max-width: 820px) {
    .pub-bar.k-appbar { flex-wrap: nowrap; gap: .3rem; }
    .pub-nav { flex-wrap: nowrap; gap: 0; }
    .pub-nav a { padding: .35rem .45rem; }
    .lang-switch .flag { display: none; }
    .brand-text { font-size: 1.35rem; letter-spacing: 1px; }
}
@media (max-width: 420px) { .lang-switch .code { display: none; } .lang-switch .flag { display: inline; } }
.number-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .3rem; }
.keypad .key-op.k-button { font-family: system-ui, -apple-system, sans-serif; font-size: 2.1rem; font-weight: 800; }
