:root {
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  color: #f1edff; background: #100c1d; font-synthesis: none;
  --muted: #a397b9; --accent: #b699ff; --orange: #ffad61;
  --line: #332842; --panel: #1a1429; --display: 'Segoe UI', Tahoma, Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(ellipse at 45% 0, #28183c 0, #100c1d 60%); min-height: 100vh; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; color: inherit; transition: background .15s, border-color .15s, transform .15s; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:active:not(:disabled) { transform: translateY(1px); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, canvas:focus-visible { outline: 2px solid #c9b3ff; outline-offset: 4px; }
a { color: inherit; }
button svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.6; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.tiny-cross { color: var(--accent); }
.app-shell { max-width: 1600px; margin: auto; padding: 0 40px; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font: 800 26px var(--display); letter-spacing: -.8px; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; font: 29px Arial; color: #fff; background: linear-gradient(145deg, #ba93ff, #7951dc); border: 1px solid #c7a9ff; border-radius: 11px; box-shadow: 0 4px 20px #9c6bff25; }
.brand-light { font-weight: 400; margin-left: 3px; }
.brand-dot { font: 9px Arial; vertical-align: top; margin-left: 4px; color: var(--accent); }
.nav-label { font-size: 10px; letter-spacing: 1.5px; color: #b2a4c8; display: flex; align-items: center; gap: 10px; }
.nav-divider { color: #69567f; margin: 0 7px; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; flex-shrink: 0; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.quality-control select { background: #211831; border: 1px solid #49355f; color: #d9c9f4; font-size: 11px; border-radius: 7px; padding: 8px 10px; cursor: pointer; }
.icon-button { border: 1px solid #443456; background: #1d152b; border-radius: 50%; width: 35px; height: 35px; display: grid; place-items: center; color: #cbbce2; }
.help-button { background: transparent; border: 0; font-size: 11px; display: flex; gap: 8px; align-items: center; color: #d5c9e6; }
.help-button > span { width: 21px; height: 21px; border: 1px solid #66517f; border-radius: 50%; display: grid; place-items: center; }
.icon-button:hover, .help-button:hover { color: #fff; border-color: var(--accent); }
.layout { display: grid; grid-template-columns: minmax(230px, 270px) minmax(360px, 600px) minmax(180px, 220px); gap: 30px; justify-content: center; padding: 30px 0; align-items: start; }
.left-rail { padding-top: 5px; }
.eyebrow { font-size: 9px; font-weight: 600; letter-spacing: 1.1px; color: #b6a3ce; display: flex; align-items: center; gap: 7px; }
.eyebrow .tiny-cross { font-size: 17px; }
h1 { font: 800 clamp(29px, 2.3vw, 34px)/1.2 var(--display); margin: 20px 0 16px; letter-spacing: -1.1px; }
h1 > span { color: #c1a3ff; }
.intro { font-size: 12px; color: #b6a8c9; line-height: 1.9; margin: 0 0 25px; }
.panel { border: 1px solid var(--line); padding: 16px 13px; background: linear-gradient(140deg, #241a34, #191327); margin-bottom: 14px; border-radius: 10px; }
.section-heading { display: flex; align-items: center; gap: 9px; font-size: 10px; font-weight: 600; letter-spacing: 1px; color: #d2c4e5; margin-bottom: 14px; }
.section-heading > span:first-child { font-size: 11px; color: #9479b0; }
.mode-option { width: 100%; border: 1px solid transparent; background: none; border-radius: 7px; display: flex; align-items: center; text-align: left; padding: 12px 8px; gap: 10px; margin-bottom: 4px; }
.mode-option.active { background: #3b2857; border-color: #815ab2; box-shadow: inset 3px 0 #b699ff; }
.mode-option:hover { background: #30223f; }
.mode-symbol { font-size: 25px; color: #ab8bc9; width: 25px; text-align: center; line-height: 1; }
.mode-option.active .mode-symbol { color: #d9c3ff; }
.mode-option > span:nth-child(2) { flex: 1; }
.mode-option strong { font-size: 12px; font-weight: 600; display: block; }
.mode-option small { font-size: 10px; color: #b3a2c8; display: block; margin-top: 4px; }
.radio-dot { height: 12px; width: 12px; border: 1px solid #6a527f; border-radius: 50%; flex-shrink: 0; }
.active .radio-dot { border: 3px solid #3b2857; background: #c7a8ff; outline: 1px solid #b28ce8; }
.difficulty-row { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 10px; font-size: 11px; color: #b8a8cc; gap: 5px; }
.difficulty-row select { font-size: 10px; background: #21182f; border: 1px solid #49365b; border-radius: 5px; color: #ece0ff; padding: 7px; max-width: 150px; }
.map-count { margin-left: auto; color: #a58cbf; font-size: 10px; }
.random-map-heading { display: flex; gap: 10px; align-items: center; color: #d3bcff; font-size: 12px; }
.random-map-heading > span { font-size: 26px; line-height: 1; }
.random-map-heading strong { font-weight: 600; }
.random-map-panel p { font-size: 11px; line-height: 1.8; color: #ab9abc; margin: 12px 0; }
.random-map-panel #map-status { border-top: 1px solid var(--line); padding-top: 10px; color: #ccbbdf; font-size: 10px; line-height: 1.6; }
.primary-button { border: 1px solid #bb97ff; border-radius: 8px; background: linear-gradient(115deg, #b78cff, #9265ed); color: #fff; min-height: 47px; padding: 12px 17px; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 4px 16px #8650df22; }
.primary-button:hover { background: #b18af4; border-color: #dcc8ff; }
.start-button { width: 100%; margin-top: 18px; }
.button-arrow { font-size: 24px; line-height: .7; }
.match-note { text-align: center; font-size: 9px; letter-spacing: 1.1px; color: #a18bb9; margin-top: 13px; }
.arena-topline { display: flex; align-items: center; justify-content: space-between; font-size: 9px; font-weight: 600; letter-spacing: 1px; margin-bottom: 12px; color: #c5b3df; gap: 10px; }
.arena-topline > span:first-child { display: flex; align-items: center; gap: 7px; }
.arena-card { border: 1px solid #5b4278; border-radius: 12px; overflow: hidden; box-shadow: 0 18px 60px #05020d66, 0 0 0 4px #aa7bff05; background: #1b132a; }
.scoreboard { display: flex; align-items: center; justify-content: space-between; height: 78px; padding: 14px 19px; background: linear-gradient(100deg, #182136, #21172f 48%, #302030); border-bottom: 1px solid #5a4175; }
.fighter-card { display: flex; align-items: center; gap: 10px; width: 40%; color: #7bdfff; }
.fighter-card.orange { color: #ffb777; justify-content: flex-end; text-align: right; }
.fighter-icon { width: 35px; height: 41px; display: grid; place-items: center; background: #20364d; border: 1px solid #3c718b; border-radius: 7px; }
.fighter-icon svg { width: 27px; height: 33px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.orange .fighter-icon { background: #463044; border-color: #98604c; }
.fighter-name { font-size: 10px; font-weight: 700; letter-spacing: .4px; max-width: 125px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-pips { display: flex; gap: 4px; margin-top: 7px; }
.orange .health-pips { justify-content: flex-end; }
.health-pips i { display: block; width: 16px; height: 4px; background: #59d7ff; border-radius: 2px; }
.orange .health-pips i { background: #ffad61; }
.health-pips i.empty { opacity: .2; }
.ammo-mini { margin-top: 4px; font-size: 9px; color: #96d7ee; }
.orange .ammo-mini { color: #e6b48e; }
.ammo-mini:after { content: ' VIÊN'; font-size: 7px; letter-spacing: .5px; opacity: .8; }
.round-score { text-align: center; flex-shrink: 0; }
.round-score > div { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 26px; color: #f1e7ff; }
.round-score > div span { font-size: 19px; color: #8c70a9; }
.round-score small { display: block; font-size: 8px; letter-spacing: 1px; color: #b7a0d0; margin-top: 3px; }
.canvas-wrap { position: relative; background: #0c151f; overflow: hidden; aspect-ratio: 680/800; }
.canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; outline-offset: -4px; }
.arena-badge, .timer, .canvas-caption { position: absolute; border: 1px solid #6d509266; background: #160f27ed; border-radius: 5px; pointer-events: none; }
.arena-badge { top: 13px; left: 13px; padding: 7px 9px; font-size: 8px; font-weight: 600; letter-spacing: .6px; color: #d9c7f6; display: flex; align-items: center; gap: 6px; }
.arena-badge > span:first-child { width: 5px; height: 5px; border-radius: 50%; background: #c5a4ff; }
.timer { top: 12px; right: 13px; padding: 5px 9px; font-size: 16px; font-weight: 700; color: #eee0ff; font-variant-numeric: tabular-nums; }
.timer.urgent { color: #ff9c94; }
.canvas-caption { bottom: 13px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 7px; padding: 7px 10px; color: #d0b8ed; font-size: 8px; letter-spacing: 1px; white-space: nowrap; }
.canvas-caption b { padding: 0 4px; }
.caption-cross { font-size: 17px; line-height: 1; }
.arena-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 15px; height: 48px; border-top: 1px solid #3c2a53; }
.ammo-display { display: flex; align-items: center; gap: 7px; }
.ammo-icon { font-size: 18px; transform: rotate(-35deg); color: #c4a4ff; }
.ammo-display strong { font-size: 20px; color: #d6beff; }
.ammo-display > span:last-child { font-size: 8px; letter-spacing: .7px; color: #b49bcf; }
.arena-status { font-size: 8px; letter-spacing: .6px; color: #b8a0d4; text-align: center; }
.pause-button { font-size: 17px; background: #2b1e3c; border: 1px solid #61427f; border-radius: 4px; padding: 1px 7px; color: #d5baf4; }
.arena-under { display: flex; justify-content: space-between; gap: 10px; color: #ab96c2; font-size: 9px; margin-top: 12px; }
.arena-under > span { display: flex; gap: 5px; align-items: center; }
kbd { font: 8px var(--display); padding: 3px 4px; border: 1px solid #4a365f; border-radius: 3px; white-space: nowrap; color: #cab6e1; }
.aim-toast { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font: 800 32px var(--display); color: #ffe1c2; text-shadow: 0 2px #512945; pointer-events: none; opacity: 0; transition: opacity .15s; }
.aim-toast.visible { opacity: 1; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #0a061585; }
.game-overlay.welcome { background: linear-gradient(180deg, #100b1c00 10%, #130d2533); }
.overlay-inner { margin: 18px; max-width: 340px; text-align: center; background: linear-gradient(150deg, #2a1b3ff7, #171025f7); border: 1px solid #8963b8; border-radius: 14px; padding: 28px 26px; box-shadow: 0 18px 50px #07030f66, inset 0 1px #e0c5ff15; color: #f2eaff; }
.overlay-kicker { font-size: 9px; color: #c4a6eb; letter-spacing: 1.2px; }
.overlay-title { font: 800 35px/1.16 var(--display); margin: 16px 0 14px; color: #f4edff; letter-spacing: -1px; }
.overlay-description { font-size: 12px; line-height: 1.8; color: #c4b2d8; margin: 0 0 22px; }
.overlay-inner .primary-button { width: 100%; justify-content: center; min-height: 44px; font-size: 12px; }
.overlay-inner .secondary-button { width: 100%; margin-top: 9px; }
.overlay-symbol { font-size: 43px; line-height: 1; color: #c8a6ff; margin-bottom: 15px; }
.countdown-value { font-size: 38px; font-weight: 700; color: var(--accent); margin: 8px 0; }
.overlay-room-code { font-size: 35px; font-weight: 700; letter-spacing: 5px; color: #d4b8ff; margin: 14px 0; }
.overlay-players { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 12px; margin: 18px 0; color: #dbc9ee; }
.overlay-players span { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
.overlay-players b { font-size: 15px; color: #9e7cbd; }
.winner-announcement { color: #f3e9ff; }
.right-rail { padding-top: 2px; }
.field-label { display: flex; gap: 8px; align-items: center; font-size: 9px; color: #c5afdd; letter-spacing: .8px; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.field-label > span:last-child { margin-left: auto; color: #9574b5; }
.ricochet-illustration { padding: 15px 0 20px; border-bottom: 1px solid var(--line); text-align: center; }
.ricochet-illustration svg { display: block; width: 100%; max-width: 220px; margin: auto; }
.ricochet-illustration > span { font-size: 9px; letter-spacing: 1px; color: #ad92c7; }
h2 { font: 700 23px/1.3 var(--display); margin: 24px 0 12px; letter-spacing: -.4px; }
h2 span { color: #b99cd5; }
.field-copy { font-size: 12px; line-height: 1.8; color: #ac96c1; margin-bottom: 24px; }
.rule-item { display: flex; gap: 11px; margin: 21px 0; }
.rule-number { font-size: 11px; color: #b18ad5; padding-top: 2px; }
.rule-item strong { font-size: 11px; font-weight: 600; color: #e1d2ee; }
.rule-item p { font-size: 11px; line-height: 1.8; color: #ac96bf; margin: 6px 0 0; }
.assist-setting { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 20px; margin-top: 24px; cursor: pointer; }
.assist-setting > span:first-child { flex: 1; font-size: 11px; color: #dfceef; }
.assist-setting small { font-size: 9px; display: block; color: #ac94c2; margin-top: 6px; }
.assist-setting input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { display: block; background: #4b365e; width: 32px; height: 18px; border-radius: 20px; padding: 3px; flex-shrink: 0; }
.toggle-track:after { content: ''; display: block; height: 12px; width: 12px; background: #a38bb8; border-radius: 50%; transition: transform .15s; }
.assist-setting input:checked + .toggle-track { background: #7953b7; }
.assist-setting input:checked + .toggle-track:after { background: #e1ccff; transform: translateX(14px); }
.assist-setting input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 4px; }
.field-footer { display: flex; align-items: center; gap: 7px; font-size: 8px; color: #aa8cc3; letter-spacing: .6px; border-top: 1px solid var(--line); padding-top: 18px; margin-top: 28px; }
.field-footer .live-dot { width: 4px; height: 4px; }
.room-info { margin-top: 24px; border: 1px solid #6b4a8e; padding: 14px; border-radius: 8px; background: #2b1c3d; }
.room-info > strong { font-size: 29px; font-weight: 700; letter-spacing: 3px; color: #d3b4ff; display: block; margin: 10px 0; }
.room-info .secondary-button { font-size: 10px; width: 100%; padding: 9px 5px; min-height: 34px; }
.room-info .text-button { margin-top: 12px; }
.text-button { background: none; border: 0; color: #c5a5e6; font-size: 11px; padding: 3px 0; }
.site-footer { border-top: 1px solid var(--line); padding: 20px 0 25px; display: flex; justify-content: space-between; font-size: 8px; letter-spacing: 1.3px; color: #a388ba; }
.site-footer > span:first-child { color: #c4abd9; }
.site-footer .muted { margin: 0 9px; }
.site-footer .tiny-cross { margin-left: 15px; }
.modal { background: #20162e; color: #f1e6ff; border: 1px solid #8060a5; border-radius: 14px; width: min(470px, calc(100% - 32px)); padding: 32px; box-shadow: 0 25px 100px #0008; }
.modal::backdrop { background: #0a0615d9; }
.modal h2 { font-size: 29px; margin: 18px 0; }
.modal p, .modal li { font-size: 12px; line-height: 1.9; color: #c6b0d9; }
.modal li { padding: 5px 0; }
.modal ol { padding-left: 17px; }
.modal strong { color: #efdcff; font-weight: 600; }
.modal-close { position: absolute; right: 13px; top: 11px; border: 0; background: none; font-size: 25px; color: #cbb0e2; }
.modal .primary-button { width: 100%; margin-top: 20px; }
.modal .keyboard-help, .modal .network-note { font-size: 10px; color: #b69bc9; }
.input-label { display: block; font-size: 10px; letter-spacing: 1px; margin: 23px 0 9px; color: #ccb0e3; }
.text-input { width: 100%; background: #140d21; border: 1px solid #684780; border-radius: 7px; color: #f4e6ff; font-size: 13px; padding: 13px; }
.text-input::placeholder { color: #9a7aaf; }
.or-divider { border-top: 1px solid #503562; margin: 30px 0 0; position: relative; text-align: center; }
.or-divider > span { position: relative; top: -8px; background: #20162e; padding: 0 10px; font-size: 9px; letter-spacing: .5px; color: #b99bcf; }
.join-row { display: flex; gap: 10px; }
.code-input { letter-spacing: 4px; text-transform: uppercase; min-width: 0; }
.secondary-button { border: 1px solid #805a9e; background: #362245; border-radius: 7px; color: #e0c5ff; min-height: 43px; padding: 12px 17px; font-size: 12px; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px; }
.secondary-button:hover { background: #4a2e61; }
.form-message { color: #ffc18e !important; min-height: 20px; margin-bottom: 0; }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 12px); background: #e1ccff; color: #271538; border: 1px solid #f0e2ff; border-radius: 8px; padding: 13px 20px; font-size: 12px; max-width: calc(100% - 24px); box-shadow: 0 8px 30px #0005; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 10; }
.toast.visible { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1200px) {
  .app-shell { padding: 0 25px; }
  .layout { grid-template-columns: 240px minmax(360px, 600px); gap: 25px; }
  .right-rail { display: none; }
  .nav-label { font-size: 9px; }
  .left-rail h1 { font-size: 33px; }
}
@media (max-width: 760px) {
  .app-shell { padding: 0 14px; }
  .topbar { height: 70px; gap: 8px; }
  .brand { font-size: 20px; gap: 7px; }
  .brand-mark { width: 29px; height: 29px; font-size: 25px; border-radius: 8px; }
  .nav-label { display: none; }
  .header-actions { gap: 7px; }
  .quality-control select { font-size: 10px; padding: 6px; max-width: 101px; }
  .help-button { font-size: 0; padding: 0; gap: 0; }
  .help-button > span { font-size: 12px; }
  .icon-button { width: 29px; height: 29px; }
  .layout { display: flex; flex-direction: column; gap: 20px; padding-top: 20px; }
  .left-rail { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 0; }
  .left-rail .eyebrow { grid-column: 1/-1; font-size: 8px; letter-spacing: .5px; }
  .left-rail h1 { font-size: clamp(23px, 6.5vw, 31px); margin: 10px 0 16px; line-height: 1.2; grid-column: 1; letter-spacing: -.8px; }
  .intro { display: none; }
  .mode-panel { grid-column: 1/-1; padding: 7px; margin: 0 0 10px; display: flex; gap: 3px; flex-wrap: wrap; }
  .mode-panel .section-heading { display: none; }
  .mode-option { flex: 1; gap: 5px; min-width: 0; padding: 10px 4px; margin: 0; text-align: center; justify-content: center; }
  .mode-option.active { box-shadow: inset 0 -2px #b699ff; }
  .mode-option .mode-symbol, .mode-option small, .mode-option .radio-dot { display: none; }
  .mode-option strong { font-size: 10px; white-space: nowrap; }
  .mode-option > span:nth-child(2) { flex: 0 1 auto; }
  .difficulty-row { width: 100%; margin-top: 4px; padding-top: 7px; }
  .difficulty-row select { font-size: 10px; padding: 5px; }
  .random-map-panel { grid-column: 1/-1; padding: 10px 12px; margin: 0; }
  .random-map-panel .section-heading, .random-map-panel p { display: none; }
  .random-map-heading { font-size: 11px; }
  .random-map-panel #map-status { margin-top: 7px; padding-top: 7px; font-size: 10px; }
  .start-button { grid-column: 2; grid-row: 2; min-width: 96px; min-height: 41px; align-self: center; margin: 0 0 6px; font-size: 12px; padding: 10px 12px; gap: 10px; }
  .match-note { display: none; }
  .arena-section { width: 100%; }
  .arena-topline { font-size: 8px; letter-spacing: .5px; margin-bottom: 10px; }
  .scoreboard { height: 70px; padding: 11px 12px; }
  .fighter-card { gap: 6px; }
  .fighter-name { font-size: 9px; max-width: 78px; }
  .fighter-icon { width: 27px; height: 34px; }
  .fighter-icon svg { width: 21px; height: 27px; }
  .health-pips { gap: 3px; }
  .health-pips i { width: 12px; height: 4px; }
  .round-score > div { font-size: 23px; gap: 9px; }
  .round-score small { font-size: 7px; }
  .arena-bottom { padding: 9px 10px; }
  .arena-status { font-size: 7px; letter-spacing: .2px; }
  .ammo-display { gap: 4px; }
  .ammo-display > span:last-child { font-size: 7px; }
  .arena-under { font-size: 8px; gap: 6px; }
  .arena-under > span:nth-child(2) { display: none; }
  .canvas-caption { font-size: 7px; letter-spacing: .5px; }
  .arena-badge { font-size: 7px; top: 9px; left: 9px; }
  .timer { top: 9px; right: 9px; font-size: 14px; }
  .site-footer { font-size: 7px; letter-spacing: 1px; padding: 18px 0; }
  .site-footer > span:last-child { display: none; }
  .modal { padding: 29px 23px; }
  .overlay-inner { padding: 22px; max-width: 280px; }
  .overlay-title { font-size: 29px; }
  .overlay-kicker { font-size: 8px; }
  .overlay-description { font-size: 11px; }
}
@media (max-width: 360px) {
  .mode-option strong { font-size: 9px; }
  .brand { font-size: 18px; }
  .header-actions { gap: 5px; }
  .help-button { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { transition: none !important; scroll-behavior: auto !important; }
}
