.arcade { --play:#7357ec; --play-soft:#eeeafe; max-width:1080px; margin:auto; padding:28px 24px 40px; }
.game-mode-choice { display:flex; gap:6px; background:var(--bg); padding:5px; border-radius:12px; margin:16px 0 12px; }
.game-mode-choice button { flex:1; border:0; padding:11px 12px; border-radius:8px; background:transparent; color:var(--muted); font-weight:650; }
.game-mode-choice button[aria-pressed="true"] { background:var(--card); color:var(--text); box-shadow:0 1px 5px #00000015; }
.arcade button:focus-visible,.arcade a:focus-visible { outline:3px solid #f0ad45; outline-offset:3px; }
.arcade .btn:not(.secondary):not(.danger) { background:var(--play); color:white; }
.arcade-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:36px; }
.arcade-logo { display:flex; gap:10px; align-items:center; font-size:17px; font-weight:750; }
.arcade-logo svg { width:32px; height:32px; padding:6px; border-radius:10px; background:var(--play); color:#fff; }
.arcade-label { color:var(--play); font-size:11px; letter-spacing:.15em; text-transform:uppercase; font-weight:800; }
.arcade h1 { font-size:clamp(29px,5vw,46px); line-height:1.1; letter-spacing:-.045em; margin:12px 0; }
.arcade-intro { color:var(--muted); font-size:16px; max-width:560px; line-height:1.6; margin:0; }
.arcade-heading { display:flex; gap:24px; align-items:flex-end; justify-content:space-between; margin-bottom:30px; }
.arcade-online { display:inline-flex; align-items:center; gap:7px; font-size:12px; color:var(--muted); white-space:nowrap; }
.arcade-online::before { content:""; width:7px; height:7px; background:#30b58a; border-radius:50%; }
.arcade-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:16px; }
.game-card { grid-column:span 2; border:1px solid var(--line); border-radius:20px; background:var(--card); padding:0; overflow:hidden; text-align:left; transition:transform .18s,box-shadow .18s; }
.game-card:nth-child(-n+2) { grid-column:span 3; }
.game-card:hover { transform:translateY(-3px); box-shadow:0 12px 30px #24314b12; }
.game-art { height:135px; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; background:var(--art-bg); color:var(--art-ink); }
.game-art::before,.game-art::after { content:""; position:absolute; border:1px solid currentColor; border-radius:50%; width:160px; height:160px; opacity:.12; right:-35px; top:-70px; }
.game-art::after { width:220px; height:220px; top:40px; left:-100px; }
.game-art svg { width:100px; height:100px; z-index:1; filter:drop-shadow(0 6px 5px #0000000c); }
.game-card-content { padding:18px 20px 20px; }
.game-card h2 { font-size:19px; letter-spacing:-.02em; margin:0 0 7px; }
.game-card p { color:var(--muted); font-size:13px; line-height:1.5; margin:0 0 19px; min-height:39px; }
.game-card-bottom { display:flex; align-items:center; justify-content:space-between; font-size:12px; color:var(--muted); }
.game-card-bottom b { font-size:13px; color:var(--play); }
.arcade-join { display:flex; gap:16px; align-items:center; padding:20px; margin-top:24px; background:var(--card); border:1px solid var(--line); border-radius:16px; }
.arcade-join-copy { flex:1; min-width:0; }
.arcade-join-copy b { display:block; margin-bottom:4px; }
.arcade-join-copy p { font-size:13px; color:var(--muted); margin:0; }
.arcade-join form { display:flex; gap:8px; }
.arcade-join input { max-width:150px; text-transform:uppercase; letter-spacing:.12em; }
.arcade-footer { margin-top:24px; font-size:12px; color:var(--muted); line-height:1.7; }
.arcade-recent { display:flex; gap:8px; flex-wrap:wrap; margin-top:18px; align-items:center; font-size:12px; color:var(--muted); }
.arcade-recent button { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:7px 9px; font-size:12px; }
.games-entry { display:flex; align-items:center; gap:12px; padding:15px 17px; border:1px solid var(--line); border-radius:14px; background:var(--card); text-align:left; width:100%; margin:16px 0; }
.games-entry .ui-icon { color:#7357ec; width:28px; height:28px; }
.games-entry span { flex:1; }
.games-entry small { display:block; color:var(--muted); font-size:12px; margin-top:3px; }
.arcade-room .arcade-header { margin-bottom:20px; }
.room-title { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:22px; }
.room-title h1 { font-size:30px; margin:5px 0; }
.room-code { font-family:ui-monospace,monospace; letter-spacing:.12em; background:var(--card); padding:5px 8px; border-radius:7px; border:1px solid var(--line); }
.room-layout { display:grid; grid-template-columns:minmax(0,1fr) 290px; gap:20px; align-items:start; }
.room-panel { background:var(--card); border:1px solid var(--line); border-radius:18px; padding:22px; min-width:0; }
.room-panel h2 { font-size:17px; margin:0 0 14px; }
.room-panel + .room-panel { margin-top:16px; }
.room-panel .sub { line-height:1.6; }
.room-status { padding:12px 14px; background:var(--play-soft); color:#4e35b1; border-radius:11px; font-size:14px; font-weight:650; margin-bottom:18px; }
.room-status.finished { background:#e3f6eb; color:#246c46; }
.room-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.room-players { display:grid; gap:8px; }
.room-player { display:flex; align-items:center; gap:9px; padding:9px 0; min-width:0; font-size:13px; }
.room-player .avatar { flex:none; display:grid; place-items:center; width:32px; height:32px; border-radius:10px; background:var(--chip); font-weight:750; }
.room-player.active .avatar { background:var(--play); color:#fff; }
.room-player .player-name { flex:1; overflow-wrap:anywhere; }
.room-player small { color:var(--muted); font-size:11px; }
.room-player.dead { opacity:.55; }
.room-placeholder { padding:32px 12px; text-align:center; }
.room-placeholder svg { width:110px; height:110px; color:var(--play); }
.room-placeholder h2 { font-size:23px; margin:16px 0 8px; }
.room-placeholder p { max-width:340px; margin:0 auto; color:var(--muted); line-height:1.7; font-size:14px; }
.room-share { display:flex; gap:8px; margin:18px 0; align-items:center; flex-wrap:wrap; }
.room-share input { font-size:12px; min-width:100px; flex:1; }
.room-error { font-size:13px; color:var(--danger); padding:8px 0; }
.room-connection { font-size:12px; color:var(--muted); min-height:18px; margin-top:8px; }
.room-chat { max-height:240px; overflow:auto; display:grid; gap:10px; padding:4px 0 12px; font-size:13px; overflow-wrap:anywhere; }
.chat-message b { font-size:11px; color:var(--muted); display:block; margin-bottom:3px; }
.chat-message p { margin:0; line-height:1.5; white-space:pre-wrap; }
.room-chat-form { display:flex; gap:7px; }
.room-chat-form input { min-width:0; padding:9px; font-size:13px; }
.room-chat-form button { padding:8px 10px; }
.room-rules { margin-top:18px; color:var(--muted); font-size:12px; line-height:1.65; }
.room-rules summary { cursor:pointer; font-weight:650; }
.room-log { font-size:13px; color:var(--muted); line-height:1.6; padding:0 0 0 18px; }
.ttt-board { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; max-width:360px; margin:20px auto; }
.ttt-cell { aspect-ratio:1; border:0; border-radius:15px; background:var(--bg); font-size:clamp(35px,8vw,64px); font-weight:400; line-height:1; }
.ttt-cell.x { color:#7357ec; } .ttt-cell.o { color:#e38b3b; }
.ttt-cell.won { background:#e9e2ff; }
.chess-wrap { max-width:520px; margin:auto; }
.chess-board { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); border:4px solid #72618e; border-radius:8px; overflow:hidden; }
.chess-cell { aspect-ratio:1; border:0; border-radius:0; padding:0; position:relative; display:grid; place-items:center; background:#ece7f3; font-family:"Arial Unicode MS","Segoe UI Symbol",serif; line-height:1; font-size:clamp(23px,5vw,45px); color:#202331; }
.chess-cell.dark { background:#9885b2; }
.chess-cell.white-piece { color:#fff; text-shadow:0 1px 1px #262033,1px 0 #262033,-1px 0 #262033,0 -1px #262033; }
.chess-cell.selected { background:#c5adf5; box-shadow:inset 0 0 0 3px #7357ec; }
.chess-cell.legal::after { content:""; position:absolute; width:23%; height:23%; border-radius:50%; background:#49366d70; pointer-events:none; }
.chess-cell.legal.capture::after { width:85%; height:85%; border:3px solid #594081; background:transparent; }
.chess-cell small { position:absolute; font:9px/1 system-ui; left:3px; top:3px; color:#3c304f; text-shadow:none; }
.chess-history { max-height:95px; overflow:auto; font-size:12px; color:var(--muted); line-height:1.8; margin-top:14px; font-variant-numeric:tabular-nums; }
.battle-fields { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.battle-fields h3 { margin:0 0 8px; font-size:13px; }
.battle-grid { display:grid; grid-template-columns:repeat(10,minmax(0,1fr)); gap:2px; background:var(--line); border:2px solid var(--line); border-radius:6px; overflow:hidden; }
.battle-cell { aspect-ratio:1; min-width:0; padding:0; border:0; border-radius:1px; background:var(--card); display:grid; place-items:center; font-size:clamp(9px,1.8vw,17px); line-height:1; }
.battle-cell.ship { background:#a8c0e5; color:#233c61; }
.battle-cell.miss { background:var(--bg); color:var(--muted); }
.battle-cell.hit { background:#f9d1cc; color:#9b3930; }
.battle-cell.sunk { background:#d9756f; color:white; }
.battle-grid.target .battle-cell:not(:disabled):hover { background:#d9e6fb; }
.battle-setup { max-width:370px; margin:auto; }
.battle-setup .battle-cell { font-size:16px; }
.battle-ships { display:flex; flex-wrap:wrap; gap:6px; margin:12px 0; }
.battle-ship { background:var(--chip); padding:5px 8px; border:1px solid var(--line); border-radius:7px; font-size:12px; }
.battle-ship.placed { opacity:.4; text-decoration:line-through; }
.mafia-role { padding:20px; background:var(--bg); border-radius:13px; margin-bottom:20px; }
.mafia-role .role-name { font-size:24px; font-weight:750; margin:8px 0; }
.mafia-targets { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; margin:16px 0; }
.mafia-targets button { text-align:left; padding:12px; overflow-wrap:anywhere; white-space:normal; }
.mafia-report { padding:10px 12px; border:1px solid var(--line); border-radius:10px; font-size:13px; margin:8px 0; }
.durak-info { display:flex; gap:8px; flex-wrap:wrap; align-items:center; font-size:12px; color:var(--muted); margin-bottom:18px; }
.durak-table { min-height:160px; padding:20px 10px; border-radius:16px; background:#e7f1ed; display:flex; flex-wrap:wrap; gap:18px; align-items:center; justify-content:center; }
.durak-pair { display:flex; position:relative; padding-right:16px; padding-bottom:20px; }
.durak-pair .playing-card + .playing-card { position:absolute; left:18px; top:22px; transform:rotate(9deg); }
.playing-card { background:#fff; color:#243146; border:1px solid #d1d7de; border-radius:8px; width:58px; height:82px; padding:6px; display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; font-family:Georgia,serif; font-size:18px; font-weight:700; box-shadow:0 2px 3px #1a302510; flex-shrink:0; }
.playing-card.red { color:#c6404a; }
.playing-card .suit { font-size:25px; align-self:center; }
.playing-card.chosen { outline:3px solid #7357ec; outline-offset:2px; transform:translateY(-4px); }
.playing-card:disabled { cursor:default; }
.durak-hand { display:flex; flex-wrap:wrap; gap:7px; padding-top:10px; }
.durak-hand .playing-card { width:53px; height:76px; }
.durak-hand-title { margin:20px 0 4px; font-size:14px; }
@media (min-width:960px) { .arcade { padding-top:34px; } }
@media (max-width:650px) {
  .arcade { padding:18px 16px 28px; } .arcade-header { margin-bottom:28px; }
  .arcade-heading { display:block; } .arcade-heading .arcade-online { margin-top:14px; }
  .arcade-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
  .game-card,.game-card:nth-child(-n+2) { grid-column:span 1; }
  .game-card:first-child { grid-column:span 2; display:grid; grid-template-columns:42% 58%; }
  .game-card:first-child .game-art { height:100%; min-height:150px; }
  .game-card:first-child .game-card-content { align-self:center; }
  .game-art { height:100px; } .game-art svg { width:78px; height:78px; }
  .game-card-content { padding:14px; } .game-card h2 { font-size:16px; }
  .game-card p { font-size:12px; min-height:54px; margin-bottom:12px; }
  .game-card:first-child p { min-height:0; }
  .game-card-bottom { font-size:10px; gap:5px; } .game-card-bottom b { font-size:12px; }
  .arcade-join { display:block; padding:17px; } .arcade-join form { margin-top:14px; }
  .arcade-join input { max-width:none; min-width:0; }
  .room-layout { grid-template-columns:1fr; } .room-panel { padding:16px; }
  .room-sidebar { display:grid; grid-template-columns:1fr; gap:14px; } .room-panel + .room-panel { margin-top:0; }
  .room-sidebar .room-panel:first-child .room-players { grid-template-columns:1fr 1fr; }
  .room-title h1 { font-size:25px; } .room-title { flex-wrap:wrap; }
  .battle-fields { grid-template-columns:1fr; gap:20px; max-width:350px; margin:auto; }
  .battle-cell { font-size:16px; } .room-chat { max-height:180px; }
}
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) .arcade { --play:#a48bff; --play-soft:#302844; } :root:not([data-theme="light"]) .room-status { color:#d1c1ff; } }
:root[data-theme="dark"] .arcade { --play:#a48bff; --play-soft:#302844; }
:root[data-theme="dark"] .room-status { color:#d1c1ff; }
@media (prefers-color-scheme:dark) { :root:not([data-theme="light"]) .room-status.finished { background:#193d2e; color:#98e8bb; } }
:root[data-theme="dark"] .room-status.finished { background:#193d2e; color:#98e8bb; }
@media (max-width:400px) { .arcade-logo { font-size:14px; gap:7px; white-space:nowrap; } .arcade-logo svg { width:26px; height:26px; flex-shrink:0; } .arcade-header > .btn { font-size:11px; padding:8px; } }
