.battle { max-width: 760px; margin: 0 auto; padding: 8px 0 40px; color: #0f172a; }
.battle * { box-sizing: border-box; }
.battle-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 18px; padding: 24px; box-shadow: 0 8px 24px rgba(15,23,42,.06); margin-bottom: 16px; animation: qb-in .25s ease; }
.battle h1, .battle h2 { margin: 0 0 8px; font-weight: 800; letter-spacing: -.02em; }
.battle h1 { font-size: 2rem; }
.battle h2 { font-size: 1.4rem; }
.battle .qb-explain + h2, .battle .qb-options + h2, .battle .qb-result + h2 { margin-top: 20px; }
.battle .muted { color: #64748b; }
.battle-hero { text-align: center; background: linear-gradient(135deg, #4f46e5, #7c3aed 60%, #db2777); color: #fff; border: 0; }
.battle-hero .muted { color: rgba(255,255,255,.85); }
.battle label { display: block; font-weight: 700; font-size: .85rem; margin: 12px 0 4px; }
.battle input[type=text] { width: 100%; padding: 12px 14px; border: 2px solid #e2e8f0; border-radius: 12px; font-size: 1.05rem; }
.battle input[type=text]:focus { outline: none; border-color: #6366f1; }
.battle input.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 800; font-size: 1.4rem; }
.battle-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .battle-grid { grid-template-columns: 1fr; } }
.qb-btn { display: inline-block; border: 0; border-radius: 12px; padding: 12px 20px; font-size: 1rem; font-weight: 750; cursor: pointer; background: #4f46e5; color: #fff; transition: transform .12s ease, filter .12s ease; }
.qb-btn:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); }
.qb-btn:disabled { opacity: .5; cursor: not-allowed; }
.qb-btn.secondary { background: #e2e8f0; color: #0f172a; }
.qb-btn.block { width: 100%; margin-top: 16px; }
.qb-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; font-weight: 650; }
.qb-code { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.qb-code strong { font-size: 2.4rem; letter-spacing: .25em; font-family: ui-monospace, Menlo, monospace; padding-left: .25em; }
.qb-players { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.qb-players li { background: #eef2ff; color: #3730a3; border-radius: 999px; padding: 6px 14px; font-weight: 700; animation: qb-pop .25s ease; }
.qb-players li.me { background: #4f46e5; color: #fff; }
.qb-players li.away { opacity: .45; }
.qb-badge { font-size: .72rem; background: #fbbf24; color: #78350f; border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.qb-settings { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.qb-settings select { padding: 8px; border-radius: 10px; border: 2px solid #e2e8f0; }
.qb-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.qb-cat { border: 0; border-radius: 14px; padding: 18px 10px; font-weight: 800; color: #fff; cursor: pointer; background: #6d5dfc; text-shadow: 0 1px 2px rgba(0,0,0,.35); transition: transform .12s ease; }
.qb-cat:hover:not(:disabled) { transform: scale(1.04); }
.qb-cat small { display: block; font-weight: 600; opacity: .85; margin-top: 4px; }
.qb-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-weight: 750; }
.qb-timer { height: 12px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-bottom: 16px; }
.qb-timer > div { height: 100%; width: 100%; background: linear-gradient(90deg, #22c55e, #eab308 60%, #ef4444); transform-origin: left; }
.qb-question { font-size: 1.35rem; font-weight: 800; margin: 0 0 18px; line-height: 1.3; }
.qb-options { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 640px) { .qb-options { grid-template-columns: 1fr; } }
.qb-option { text-align: left; border: 2px solid transparent; border-radius: 14px; padding: 16px; font-size: 1.05rem; font-weight: 700; color: #fff; cursor: pointer; transition: transform .12s ease, opacity .2s ease; }
.qb-option:hover:not(:disabled) { transform: translateY(-2px); }
.qb-option:disabled { cursor: default; }
.qb-option.o0 { background: #e11d48; } .qb-option.o1 { background: #2563eb; } .qb-option.o2 { background: #d97706; } .qb-option.o3 { background: #059669; }
.qb-option.picked { border-color: #0f172a; box-shadow: 0 0 0 3px rgba(15,23,42,.25); }
.qb-option.dim { opacity: .35; }
.qb-option.right { outline: 4px solid #16a34a; opacity: 1; }
.qb-wait { text-align: center; padding: 24px 0; font-weight: 700; color: #475569; }
.qb-countdown { font-size: 4rem; font-weight: 900; text-align: center; color: #4f46e5; animation: qb-pop .5s ease; }
.qb-result { text-align: center; font-size: 1.3rem; font-weight: 800; margin: 14px 0; }
.qb-result.good { color: #16a34a; } .qb-result.bad { color: #dc2626; }
.qb-explain { background: #f8fafc; border-left: 4px solid #6366f1; padding: 10px 14px; border-radius: 8px; margin-top: 12px; }
.qb-board { list-style: none; margin: 12px 0 0; padding: 0; }
.qb-board li { display: grid; grid-template-columns: 40px 1fr auto; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 12px; margin-bottom: 6px; background: #f8fafc; animation: qb-in .3s ease; }
.qb-board li.me { background: #eef2ff; font-weight: 800; }
.qb-board .rank { font-weight: 900; color: #6366f1; }
.qb-board .score { font-weight: 800; font-variant-numeric: tabular-nums; }
.qb-board .gain { color: #16a34a; font-size: .85rem; margin-left: 6px; }
.qb-winner { text-align: center; font-size: 2rem; font-weight: 900; margin: 6px 0 14px; animation: qb-pop .5s ease; }
@keyframes qb-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes qb-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .battle * { animation: none !important; transition: none !important; } }
