﻿@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800;900&display=swap');

:root{
  --black:#050505;
  --panel:rgba(10,8,7,.86);
  --panel2:rgba(20,13,10,.92);
  --gold:#f9c74f;
  --gold2:#ff9300;
  --red:#8e0b09;
  --red2:#d52a17;
  --green:#37f36c;
  --muted:#c6bdb1;
  --text:#fff8e7;
  --line:rgba(249,199,79,.78);
  --shadow:0 0 30px rgba(255,143,0,.25), inset 0 0 22px rgba(255,255,255,.04);
  --font-display:'Inter', system-ui, sans-serif;
  --font-body:'Inter', system-ui, sans-serif;
  --app-height:100dvh;
  --card-back-skin:
    radial-gradient(circle at 50% 50%, rgba(255,213,90,.20), transparent 7%),
    repeating-linear-gradient(55deg, rgba(255,202,82,.22) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(125deg, rgba(255,202,82,.12) 0 1px, transparent 1px 18px),
    linear-gradient(145deg,#b11b12,#520300);
}

*{box-sizing:border-box;margin:0;padding:0}
html{
  min-height:100%;
  scroll-behavior:smooth;
  background:#050505;
  -webkit-text-size-adjust:100%;
}
body{
  min-height:var(--app-height);
  color:var(--text);
  font-family:var(--font-body);
  overflow-x:hidden;
  overscroll-behavior-y:none;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  background-color:#050505;
  background-image:
    linear-gradient(90deg, rgba(0,0,0,.86), rgba(0,0,0,.40) 38%, rgba(0,0,0,.72)),
    linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.78)),
    url("assets/casino-background.png");
  background-size:cover, cover, cover;
  background-position:center, center, center;
  background-attachment:fixed, fixed, fixed;
  background-repeat:no-repeat;
}
button,input{
  font:inherit;
}
button,.card-wrap{
  touch-action:manipulation;
}
input{
  font-size:16px;
}
img{
  -webkit-user-drag:none;
  user-select:none;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:0;
  pointer-events:none;
  background:
    linear-gradient(180deg, rgba(255,199,79,.08), transparent 24%),
    radial-gradient(ellipse at 54% 42%, rgba(0,0,0,.08), rgba(0,0,0,.46) 72%);
}

.casino-shell{
  position:relative;
  z-index:1;
  display:grid;
  grid-template-columns:260px minmax(0,1fr);
  gap:26px;
  width:min(1480px,100%);
  margin:0 auto;
  min-height:var(--app-height);
}
.game-round-active .casino-shell{
  display:block;
  width:100%;
}
.game-round-active .casino-sidebar{
  display:none;
}
.game-round-active .game-stage{
  min-height:100vh;
  padding:8px 16px 12px;
  overflow:hidden;
}
.game-round-active .game-view{
  min-height:calc(100vh - 20px);
}
.game-round-active .game-toolbar{
  width:min(720px,86vw);
  margin-bottom:6px;
}
.game-round-active .game-toolbar .player-strip{
  padding:5px 10px;
}
.game-round-active .game-toolbar .player-avatar{
  width:42px;
  height:42px;
}
.game-round-active .player-strip h2{
  font-size:15px;
  margin-bottom:2px;
}
.game-round-active .player-strip p{
  font-size:16px;
}
.game-round-active .balance-chip{
  min-height:42px;
  padding:7px 11px;
  font-size:16px;
}

.casino-sidebar{
  min-height:var(--app-height);
  padding:20px 16px 24px;
  background:linear-gradient(180deg, rgba(2,2,2,.98), rgba(7,7,7,.94));
  border-right:1px solid rgba(255,255,255,.06);
  box-shadow:12px 0 40px rgba(0,0,0,.55);
  display:flex;
  flex-direction:column;
  gap:16px;
}
.player-strip{
  display:flex;
  align-items:center;
  gap:14px;
  padding:0 8px 18px;
  border-bottom:0;
}
.player-avatar{
  width:66px;
  height:66px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background-color:#111;
  background-size:cover;
  background-position:center;
  border:0;
  box-shadow:0 0 0 2px rgba(255,210,92,.86);
}
.player-strip h2{font-size:18px;color:white;margin-bottom:6px;font-weight:900}
.player-strip p{display:flex;align-items:center;color:var(--gold);font-size:20px;font-weight:900}
.player-awards{
  gap:11px;
  flex-wrap:wrap;
  line-height:1;
}
.player-award{
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-width:max-content;
}
.player-award-medals{
  color:#d8e4ef;
}
.trophy-icon,
.medal-icon{
  display:inline-grid;
  place-items:center;
  width:22px;
  height:22px;
  font-size:16px;
}
.trophy-icon{
  filter:drop-shadow(0 0 7px rgba(255,190,40,.45));
}
.medal-icon{
  filter:drop-shadow(0 0 7px rgba(216,228,239,.38));
}
.coin-icon{
  display:inline-grid;
  place-items:center;
  width:22px;height:22px;
  margin-right:7px;
  border-radius:50%;
  background:linear-gradient(180deg,#ffd44b,#c87400);
  color:#5a2b00;
  font-size:14px;
  font-weight:900;
  box-shadow:0 0 12px rgba(255,181,0,.45);
}
.casino-menu{display:flex;flex-direction:column;gap:8px;margin-top:0}
.casino-menu{
  gap:14px;
  padding:0 0 0;
  margin-top:6px;
}
.menu-item{
  width:100%;
  min-height:54px;
  border:1px solid transparent;
  border-radius:10px;
  padding:13px 18px;
  text-align:left;
  color:#c8c8c8;
  background:transparent;
  font-size:17px;
  font-weight:700;
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:14px;
  font-family:var(--font-body);
  transition:background .15s ease,border-color .15s ease,transform .15s ease;
}
.menu-item span{min-width:0}
.menu-emoji{
  flex:0 0 26px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:21px;
  line-height:1;
}
.menu-item[aria-current="page"]{cursor:default}
.menu-item:hover,.menu-item.active{
  color:white;
  background:linear-gradient(180deg,#b11112,#850707);
  border-color:#e33a2f;
  box-shadow:inset 0 0 12px rgba(255,255,255,.08),0 0 16px rgba(220,43,34,.16);
}
.sound-controls{
  margin-top:auto;
  display:inline-flex;
  width:max-content;
  border:1px solid rgba(255,255,255,.18);
  border-radius:8px;
  overflow:hidden;
  background:rgba(255,255,255,.04);
}
.sound-controls button{
  width:43px;
  height:40px;
  border:0;
  border-right:1px solid rgba(255,255,255,.16);
  background:transparent;
  color:#d8d8d8;
  font-size:20px;
  cursor:pointer;
}
.sound-controls button:last-child{border-right:0}
.sound-controls button:hover{background:rgba(255,255,255,.08);color:white}
.sound-controls button.active{background:rgba(249,199,79,.12);color:var(--gold)}
.ranking-list,.live-list{max-height:60vh;overflow-y:auto;padding:8px 10px}.empty{color:var(--muted);padding:22px;text-align:center}
.ranking-switcher{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin:0 0 16px;
  padding:6px;
  border:1px solid rgba(249,199,79,.22);
  border-radius:12px;
  background:rgba(0,0,0,.38);
}
.ranking-switch{
  min-height:42px;
  border:1px solid rgba(249,199,79,.24);
  border-radius:9px;
  color:#d8d8d8;
  background:rgba(255,255,255,.05);
  font-weight:900;
  cursor:pointer;
}
.ranking-switch:hover,
.ranking-switch.active{
  color:#120b02;
  background:linear-gradient(180deg,#ffd96a,#d68a10);
  border-color:#ffe09b;
  box-shadow:0 0 16px rgba(249,199,79,.24);
}
.ranking-section{
  margin:0 0 18px;
  padding:0 0 12px;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.ranking-section:last-child{
  margin-bottom:0;
  border-bottom:0;
}
.ranking-section h2{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0 0 8px;
  padding:4px 0 8px;
  color:var(--gold);
  font-size:20px;
  font-weight:900;
}
.ranking-section h2 span{
  color:var(--muted);
  font-size:13px;
  text-transform:uppercase;
}
.ranking-item,.live-item{display:grid;grid-template-columns:58px 1fr auto;align-items:center;gap:16px;padding:16px 8px;border-top:1px solid rgba(255,255,255,.08)}
.entry-avatar{width:46px;height:46px;border-radius:50%;display:grid;place-items:center;overflow:hidden;background:rgba(255,255,255,.08);box-shadow:0 0 0 2px rgba(249,199,79,.72)}
.entry-avatar img{width:100%;height:100%;object-fit:cover;display:block}
.entry-avatar span{font-size:23px;line-height:1}
.live-score{font-weight:900;color:var(--green);font-size:20px}.ranking-name,.live-name{font-weight:900;color:white;font-size:18px}.ranking-meta,.live-time{font-size:13px;color:var(--muted);margin-top:4px}.ranking-prize{color:var(--green);font-weight:900}
.ranking-cups{
  display:flex;
  align-items:center;
  gap:7px;
  font-size:22px;
  font-weight:900;
}
.ranking-cups span{
  font-size:20px;
  filter:drop-shadow(0 0 8px currentColor);
}
.ranking-cups-silver{
  color:#d8e4ef;
  text-shadow:0 0 12px rgba(216,228,239,.32);
}
.ranking-cups-gold{
  color:#ffd35a;
  text-shadow:0 0 14px rgba(255,196,65,.42);
}
.profile-history{display:grid;grid-template-columns:1fr auto;gap:14px;padding:8px 4px;font-size:22px}.profile-history span{color:var(--muted);font-weight:800}.profile-history strong{color:var(--green);font-size:28px}
.profile-card{display:flex;align-items:center;gap:16px;margin:4px 0 22px;padding-bottom:20px;border-bottom:1px solid rgba(255,255,255,.1)}
.profile-avatar-large{width:86px;height:86px;border-radius:50%;display:grid;place-items:center;background-color:#111;background-size:cover;background-position:center;box-shadow:0 0 0 3px rgba(255,210,92,.86),0 0 24px rgba(255,181,0,.22)}
.profile-card h2{font-size:28px;color:white;margin-bottom:6px}
.profile-card p{display:flex;align-items:center;color:var(--gold);font-size:22px;font-weight:900}
.avatar-section{margin:0 0 22px;padding-bottom:20px;border-bottom:1px solid rgba(255,255,255,.1)}
.avatar-section h2{font-size:18px;color:var(--gold);margin-bottom:12px}
.avatar-picker{display:grid;grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:12px;max-height:330px;overflow-y:auto;padding:2px 4px 4px 2px}
.avatar-option{aspect-ratio:1;border-radius:50%;border:2px solid rgba(249,199,79,.38);background:#050505;padding:0;overflow:hidden;cursor:pointer;box-shadow:0 0 0 1px rgba(0,0,0,.8);transition:transform .15s ease,border-color .15s ease,box-shadow .15s ease}
.avatar-option img{width:100%;height:100%;object-fit:cover;display:block}
.avatar-option:hover{transform:translateY(-2px);border-color:var(--gold)}
.avatar-option.selected{border-color:#34f46f;box-shadow:0 0 0 2px rgba(52,244,111,.38),0 0 20px rgba(52,244,111,.18)}
.store-status{display:none;margin:0 0 14px;padding:10px 12px;border:1px solid rgba(249,199,79,.22);border-radius:8px;background:rgba(0,0,0,.34);font-weight:800}
.store-status.visible{display:block}.store-status.success{color:var(--green)}.store-status.warning{color:var(--gold)}.store-status.danger{color:#ff8c8c}
.store-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;max-height:66vh;overflow-y:auto;padding:2px 4px 4px 2px}
.shop-item{padding:12px;border:1px solid rgba(249,199,79,.25);border-radius:8px;background:rgba(255,255,255,.04);display:flex;flex-direction:column;gap:10px}
.skin-card.equipped{border-color:#34f46f;box-shadow:0 0 0 2px rgba(52,244,111,.26),0 0 22px rgba(52,244,111,.16)}
.skin-preview{height:178px;display:grid;place-items:center;border-radius:7px;background:rgba(0,0,0,.42);overflow:hidden;padding:10px}
.skin-art{
  height:100%;
  width:149px;
  max-width:100%;
  aspect-ratio:166/176;
  border-radius:7px;
  border:2px solid #ffd36a;
  display:grid;
  place-items:center;
  overflow:hidden;
  background-size:cover;
  background-position:center;
  box-shadow:0 0 16px rgba(249,199,79,.28), inset 0 0 18px rgba(0,0,0,.32);
}
.default-skin-preview{
  background:
    radial-gradient(circle at 50% 50%, rgba(255,213,90,.20), transparent 7%),
    repeating-linear-gradient(55deg, rgba(255,202,82,.22) 0 1px, transparent 1px 18px),
    repeating-linear-gradient(125deg, rgba(255,202,82,.12) 0 1px, transparent 1px 18px),
    linear-gradient(145deg,#b11b12,#520300);
}
.default-skin-preview span{font-size:54px;color:var(--gold);text-shadow:0 0 18px rgba(255,201,75,.9)}
.skin-info{display:flex;align-items:center;justify-content:space-between;gap:8px}
.shop-item strong{font-size:16px;color:white}
.shop-item span{color:var(--gold);font-weight:900;font-size:14px;white-space:nowrap}
.skin-action{width:100%;border:1px solid #88ff95;border-radius:8px;padding:10px 12px;background:linear-gradient(180deg,#28d748,#047019);color:white;font-weight:900;cursor:pointer}
.skin-action:disabled{opacity:.65;cursor:default;filter:grayscale(.2)}

.game-stage{
  position:relative;
  min-height:100vh;
  padding:18px 18px 24px;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.screen-view{display:none;width:100%}
.screen-view.active{display:flex}
.game-view{flex-direction:column;align-items:center}
.game-toolbar{
  width:min(820px,92vw);
  margin:0 auto 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.game-toolbar .player-strip{
  min-width:0;
  padding:8px 12px;
  border:1px solid rgba(249,199,79,.18);
  border-radius:14px;
  background:rgba(0,0,0,.46);
  box-shadow:0 0 22px rgba(0,0,0,.28);
}
.game-toolbar .player-avatar{
  width:52px;
  height:52px;
}
.game-toolbar-actions{
  display:flex;
  align-items:center;
  gap:8px;
  flex:0 0 auto;
}
.balance-chip{
  min-height:52px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:9px 14px;
  border:1px solid rgba(249,199,79,.28);
  border-radius:14px;
  background:rgba(0,0,0,.54);
  box-shadow:0 0 22px rgba(0,0,0,.28);
  color:var(--gold);
  font-size:20px;
  font-weight:900;
  white-space:nowrap;
}
.toolbar-icon-button{
  width:42px;
  height:42px;
  border:1px solid rgba(249,199,79,.58);
  border-radius:10px;
  background:rgba(0,0,0,.58);
  color:white;
  font-size:20px;
  cursor:pointer;
  display:grid;
  place-items:center;
}
.game-toolbar .sound-controls{
  margin-top:0;
}
.page-view{
  min-height:calc(100vh - 48px);
  align-items:flex-start;
  justify-content:center;
}
.view-panel{
  width:min(760px,92vw);
  margin:0 auto;
  padding:28px;
  border:1px solid var(--line);
  border-radius:14px;
  background:linear-gradient(180deg, rgba(10,10,10,.92), rgba(0,0,0,.76));
  box-shadow:var(--shadow);
}
#ranking-view .view-panel{
  background:
    linear-gradient(180deg, rgba(68,23,13,.88), rgba(10,6,5,.72)),
    radial-gradient(circle at 50% 0%, rgba(249,199,79,.22), transparent 46%),
    url("assets/casino-background.png");
  background-size:cover, cover, cover;
  background-position:center, center, center;
}
#ranking-view .ranking-list{
  border-radius:12px;
  background:rgba(0,0,0,.28);
  border:1px solid rgba(249,199,79,.18);
}
.view-heading{
  display:flex;
  align-items:center;
  gap:12px;
  padding-bottom:16px;
  margin-bottom:10px;
  border-bottom:1px solid rgba(255,255,255,.12);
}
.view-heading span{
  width:38px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:32px;
  line-height:1;
}
.view-heading h1{font-family:var(--font-display);font-size:40px;color:var(--gold);line-height:1;font-weight:900}
.top-hud{
  width:min(720px, 92vw);
  display:flex;
  align-items:stretch;
  border:1px solid var(--line);
  border-radius:12px;
  background:linear-gradient(180deg, rgba(10,10,10,.92), rgba(0,0,0,.74));
  box-shadow:var(--shadow);
  overflow:hidden;
  margin:0 auto 26px;
}
.game-round-active .top-hud{
  width:min(720px,86vw);
  margin:0 auto 8px;
}
.game-round-active .hud-cell{
  padding:9px 12px;
}
.game-round-active .hud-cell strong{
  font-size:27px;
}
.hud-cell{
  flex:1 1 0;
  min-width:0;
  padding:18px 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  text-align:center;
  white-space:nowrap;
  border-right:1px solid rgba(255,255,255,.14);
}
.hud-cell:last-child{border-right:0}
.hud-cell span{font-size:13px;text-transform:uppercase;font-weight:900;color:white}
.hud-cell strong{display:inline-flex;align-items:center;font-size:32px;line-height:1;color:var(--green)}
.hud-cell:first-child strong{color:var(--gold)}
.local-duel-active .game-toolbar{display:none}
.local-duel-active .top-hud{margin-top:0}
.message{width:min(720px,90%);margin:-10px auto 18px;padding:11px 18px;border-radius:14px;text-align:center;border:1px solid rgba(249,199,79,.2);background:rgba(0,0,0,.52);display:none;color:#9cd4ff}.message.visible{display:block}.local-duel-active .message{display:none!important;margin:0;padding:0;border:0}.message.success{color:var(--green)}.message.warning{color:var(--gold)}.message.danger{color:#ff8c8c}
.game-round-active .message{
  width:min(720px,86vw);
  margin:0 auto 8px;
  padding:8px 14px;
  border-radius:10px;
}
.local-duel-panel{
  width:min(720px,90%);
  margin:-4px auto 16px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  gap:10px;
  align-items:center;
}
.local-duel-panel[hidden]{display:none!important}
.duel-turn[hidden]{display:none!important}
.duel-player,.duel-turn{
  min-height:58px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:12px;
  background:rgba(0,0,0,.58);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  text-align:center;
  font-weight:900;
}
.duel-player{
  flex-direction:column;
  gap:2px;
  color:#d9d9d9;
  position:relative;
  overflow:hidden;
  opacity:.82;
  transition:border-color .18s ease, box-shadow .18s ease, opacity .18s ease, background .18s ease;
}
.duel-avatar{
  width:34px;
  height:34px;
  border-radius:50%;
  background:#111 center/cover no-repeat;
  border:2px solid rgba(249,199,79,.76);
  box-shadow:0 0 12px rgba(249,199,79,.18);
}
.duel-player::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  opacity:.14;
}
#duel-player-1{
  border-color:rgba(255,64,64,.44);
}
#duel-player-1::before{
  background:linear-gradient(180deg,rgba(255,36,36,.34),transparent);
}
#duel-player-2{
  border-color:rgba(56,135,255,.48);
}
#duel-player-2::before{
  background:linear-gradient(180deg,rgba(31,119,255,.35),transparent);
}
#duel-player-1 strong{color:#ff4b4b}
#duel-player-2 strong{color:#4da3ff}
.duel-player.active{
  color:white;
  opacity:1;
}
#duel-player-1.active{
  border-color:#ff5b5b;
  box-shadow:0 0 22px rgba(255,61,61,.48), inset 0 0 18px rgba(255,35,35,.12);
}
#duel-player-2.active{
  border-color:#5aa7ff;
  box-shadow:0 0 22px rgba(57,134,255,.5), inset 0 0 18px rgba(42,126,255,.13);
}
.duel-player span{font-size:12px;text-transform:uppercase;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.duel-player strong{font-size:28px;line-height:1}
.duel-turn{
  min-width:190px;
  padding:0 14px;
  color:var(--gold);
  text-transform:uppercase;
  font-size:13px;
}
.board-wrapper{
  width:min(790px, 92vw);
  margin:0 auto;
  padding:0;
  background:transparent;
  border:0;
  box-shadow:none;
  perspective:1000px;
  position:relative;
  min-height:690px;
  display:grid;
  place-items:center;
}
.game-round-active .board-wrapper{
  width:min(690px, 86vw);
  min-height:auto;
}
.start-game-panel{
  position:absolute;
  inset:0;
  z-index:5;
  display:grid;
  place-items:center;
  pointer-events:none;
}
.start-game-panel.hidden{display:none}
.start-actions{
  pointer-events:auto;
  width:min(500px,86vw);
  display:grid;
  gap:18px;
  justify-items:center;
}
.start-game-panel.online-searching .start-actions{
  display:none;
}
body.online-duel-active .local-duel-panel{
  width:min(720px,86vw);
  margin:0 auto 10px;
  grid-template-columns:minmax(190px,1fr) minmax(210px,.9fr) minmax(190px,1fr);
  gap:12px;
}
body.online-duel-active .duel-player,
body.online-duel-active .duel-turn{
  min-height:64px;
}
body.online-duel-active .board-wrapper{
  width:min(720px,86vw);
  min-height:clamp(300px, 42vh, 400px);
}
body.online-duel-active .start-game-panel.online-searching{
  position:relative;
  inset:auto;
  width:100%;
  min-height:clamp(280px, 39vh, 370px);
  display:grid;
  align-content:center;
  justify-items:center;
}
.online-waiting{
  width:min(430px,86vw);
  display:grid;
  place-items:center;
  gap:16px;
  text-align:center;
  pointer-events:none;
}
.online-waiting[hidden]{display:none!important}
.online-waiting-logo{
  width:min(300px,72vw);
  max-height:300px;
  object-fit:contain;
  filter:drop-shadow(0 0 24px rgba(249,199,79,.55));
  animation:online-logo-spin 1.55s linear infinite;
  transform-origin:center center;
}
body.online-duel-active .online-waiting{
  width:min(340px,78vw);
  gap:10px;
}
body.online-duel-active .online-waiting-logo{
  width:clamp(170px, 22vh, 230px);
  max-height:230px;
}
.online-waiting strong{
  color:var(--gold);
  font-size:18px;
  font-weight:900;
  text-transform:uppercase;
  text-shadow:0 0 14px rgba(249,199,79,.45);
}
@keyframes online-logo-spin{
  from{transform:rotate(0deg) scale(1)}
  50%{transform:rotate(180deg) scale(1.04)}
  to{transform:rotate(360deg) scale(1)}
}
.start-game-button{
  width:100%;
  min-width:min(500px,78vw);
  min-height:104px;
  border:2px solid #8cff9d;
  border-radius:18px;
  padding:26px 38px;
  color:white;
  font-family:var(--font-body);
  font-size:34px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:0;
  cursor:pointer;
  background:linear-gradient(180deg,#2ce84f,#05831e);
  box-shadow:0 0 36px rgba(53,244,107,.34), inset 0 0 18px rgba(255,255,255,.2);
  transition:transform .16s ease,filter .16s ease,box-shadow .16s ease;
}
.start-game-button:hover{transform:translateY(-3px);filter:brightness(1.08);box-shadow:0 0 48px rgba(53,244,107,.46), inset 0 0 18px rgba(255,255,255,.24)}
.start-game-button:active{transform:scale(.98)}
.mode-picker-button{
  width:min(430px,100%);
  min-height:62px;
  border:2px solid #48c5ff;
  border-radius:16px;
  padding:14px 22px;
  color:white;
  font-family:var(--font-body);
  font-size:17px;
  font-weight:900;
  text-transform:uppercase;
  background:linear-gradient(180deg,#1d8ed7,#0a3d72);
  cursor:pointer;
  box-shadow:0 0 24px rgba(72,197,255,.18), inset 0 0 12px rgba(255,255,255,.14);
}
.game-mode-panel{
  position:fixed;
  inset:0;
  z-index:100000;
  display:grid;
  place-items:center;
  width:100vw;
  height:100vh;
  padding:18px;
  background:rgba(0,0,0,.76);
  backdrop-filter:blur(4px);
}
.game-mode-panel[hidden]{display:none!important}
.game-mode-dialog{
  position:relative;
  width:min(760px,100%);
  max-height:min(680px,calc(100vh - 32px));
  overflow-y:auto;
  padding:24px;
  border:2px solid rgba(249,199,79,.85);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(14,20,31,.98),rgba(4,5,8,.98));
  box-shadow:0 0 44px rgba(249,199,79,.24), inset 0 0 20px rgba(255,255,255,.04);
}
.game-mode-dialog h2{
  font-family:var(--font-display);
  color:var(--gold);
  font-size:34px;
  font-weight:900;
  margin:0 42px 18px 0;
}
.mode-close-button{
  position:absolute;
  top:10px;
  right:10px;
  width:38px;
  height:38px;
  border-radius:50%;
  border:1px solid rgba(249,199,79,.78);
  background:rgba(255,255,255,.06);
  color:white;
  font-size:25px;
  font-weight:900;
  cursor:pointer;
}
.mode-options{
  display:grid;
  gap:18px;
}
.mode-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin:0 0 18px;
  padding:6px;
  border:1px solid rgba(249,199,79,.24);
  border-radius:14px;
  background:rgba(0,0,0,.36);
}
.mode-tab{
  min-height:48px;
  border:1px solid rgba(249,199,79,.3);
  border-radius:10px;
  color:#d8d8d8;
  background:rgba(255,255,255,.06);
  font-weight:900;
  text-transform:uppercase;
  cursor:pointer;
}
.mode-tab:hover,
.mode-tab.active{
  color:#0b0802;
  background:linear-gradient(180deg,#ffd96a,#d88a0a);
  border-color:#ffe398;
  box-shadow:0 0 18px rgba(249,199,79,.24);
}
.mode-group{
  display:grid;
  gap:12px;
}
.mode-group[hidden]{
  display:none!important;
}
.mode-group h3{
  margin:0;
  padding:0 2px 2px;
  color:var(--gold);
  font-family:var(--font-display);
  font-size:24px;
  font-weight:900;
  line-height:1;
}
.mode-group-online{
  padding-top:16px;
  border-top:1px solid rgba(249,199,79,.26);
}
.online-wager-panel{
  display:grid;
  gap:10px;
  padding:14px;
  border:1px solid rgba(249,199,79,.32);
  border-radius:12px;
  background:rgba(0,0,0,.36);
}
.online-wager-panel h3{
  font-size:18px;
  margin:0;
}
.online-wager-options{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
}
.online-wager-option{
  min-height:42px;
  border:1px solid rgba(249,199,79,.34);
  border-radius:10px;
  color:var(--gold);
  background:rgba(255,255,255,.05);
  font-weight:900;
  cursor:pointer;
}
.online-wager-option:hover,
.online-wager-option.active{
  color:#0b0802;
  background:linear-gradient(180deg,#ffd96a,#d88a0a);
  border-color:#ffe398;
  box-shadow:0 0 16px rgba(249,199,79,.26);
}
.online-wager-panel p{
  color:var(--muted);
  font-size:13px;
  line-height:1.35;
  margin:0;
}
.mode-option{
  min-height:150px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:12px;
  background:rgba(255,255,255,.06);
  color:white;
  display:grid;
  grid-template-columns:150px 1fr;
  align-items:center;
  gap:16px;
  padding:12px 14px;
  text-align:left;
  cursor:pointer;
  font-family:var(--font-body);
  font-weight:900;
  transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.mode-option:hover{
  transform:translateY(-5px);
  border-color:rgba(136,255,149,.72);
  background:rgba(255,255,255,.09);
  box-shadow:0 16px 28px rgba(0,0,0,.34), 0 0 22px rgba(53,244,107,.14);
}
.mode-option:active{
  transform:translateY(-1px) scale(.99);
}
.mode-art-wrap{
  width:150px;
  height:126px;
  display:grid;
  place-items:center;
}
.mode-art-wrap img{
  max-width:100%;
  max-height:150px;
  object-fit:contain;
  display:block;
  filter:drop-shadow(0 12px 18px rgba(0,0,0,.42));
}
.mode-copy{
  display:grid;
  gap:8px;
  min-width:0;
}
.mode-option strong{
  font-size:20px;
  text-transform:uppercase;
}
.mode-option small{
  color:#d8d8d8;
  font-size:14px;
  line-height:1.35;
  font-weight:800;
}
.mode-option.active{
  border-color:#88ff95;
  background:rgba(255,255,255,.06);
  box-shadow:inset 0 0 0 1px rgba(136,255,149,.38), 0 0 18px rgba(53,244,107,.16);
}
.selected-mode-label{
  display:none;
}
.board{display:grid;grid-template-columns:repeat(4, minmax(112px, 150px));gap:16px;justify-content:center;position:relative;align-content:start;min-height:690px}
.game-round-active .board{
  --active-card-size:clamp(80px, 13.4vh, 116px);
  grid-template-columns:repeat(4, var(--active-card-size));
  gap:clamp(7px, 1.35vh, 12px);
  min-height:auto;
}
.card-wrap{width:100%;aspect-ratio:166/176;perspective:950px;cursor:pointer;transition:transform .55s cubic-bezier(.2,.8,.2,1);will-change:transform;z-index:1;transform-style:preserve-3d;isolation:isolate}
.card-inner{position:relative;width:100%;height:100%;transform-style:preserve-3d;-webkit-transform-style:preserve-3d;transition:transform .50s cubic-bezier(.22,1,.36,1);will-change:transform}
.card-wrap.flipped .card-inner,.card-wrap.matched .card-inner{transform:rotateY(180deg) translateZ(0)}
.card-face{position:absolute;inset:0;border-radius:12px;backface-visibility:hidden;-webkit-backface-visibility:hidden;display:grid;place-items:center;border:3px solid #ffd36a;box-shadow:0 0 18px rgba(249,199,79,.55), inset 0 0 20px rgba(0,0,0,.32);user-select:none;transform-style:preserve-3d}
.card-back{
  transform:rotateY(0deg) translateZ(1px);
  background:var(--card-back-skin);
  background-size:cover;
  background-position:center;
}
.card-back::before{content:''}
.card-front{transform:rotateY(180deg) translateZ(1px);background:#050201;overflow:hidden;padding:0}
.animal-card-img{width:100%;height:100%;object-fit:contain;display:block;border-radius:8px;background:#050201}
.card-wrap.matched .card-front{background:linear-gradient(145deg,#09aa38,#1cff6d);color:white;border-color:#b8ffc8;box-shadow:0 0 24px rgba(53,244,107,.9)}
.card-wrap.matched .animal-card-img{filter:saturate(1.08) brightness(1.08)}
.card-wrap.matched{pointer-events:none;cursor:default}.card-wrap.wrong .card-front{background:linear-gradient(145deg,#6a0d13,#ff3838);border-color:#ff9b9b;animation:shake .30s ease}.card-wrap.wrong .animal-card-img{filter:saturate(.85) brightness(.82)}.board.shuffling .card-wrap{pointer-events:none;z-index:20}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-7px)}50%{transform:translateX(7px)}75%{transform:translateX(-4px)}}
.bottom-hud{
  width:min(790px,92vw);
  margin:28px auto 0;
  padding:12px;
  display:grid;
  grid-template-columns:110px 110px minmax(138px,160px) minmax(138px,160px) minmax(120px,140px);
  gap:12px;
  justify-content:center;
  align-items:center;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(0,0,0,.72);
  box-shadow:var(--shadow);
}
.game-round-active .bottom-hud{
  margin-top:8px;
  padding:8px;
}
.game-round-active .bottom-stat{
  padding:6px 10px;
}
.game-round-active .bottom-stat strong{
  font-size:26px;
}
.game-round-active .btn{
  min-height:42px;
  padding:9px 12px;
  font-size:12px;
}
body:not(.game-controls-active) .bottom-hud{display:none!important}
body.online-duel-active .bottom-hud{
  grid-template-columns:1fr 1fr;
  width:min(440px,92vw);
}
body.online-duel-active #btn-new,
body.online-duel-active #btn-reset{
  display:none!important;
}
body.online-duel-active .bottom-stat{
  border-right:0;
}
body.online-duel-active #btn-exit{
  grid-column:1/-1;
  width:100%;
}
.bottom-stat{text-align:center;padding:8px 14px;border-right:1px solid rgba(255,255,255,.18)}.bottom-stat span{display:block;text-transform:uppercase;color:#ddd;font-size:14px;font-weight:800}.bottom-stat strong{display:block;font-size:32px;color:white}
.btn{border:0;cursor:pointer;font-family:var(--font-body);font-weight:900;color:white;border-radius:14px;padding:14px 18px;text-transform:uppercase;letter-spacing:.02em;box-shadow:inset 0 0 12px rgba(255,255,255,.18),0 0 18px rgba(255,255,255,.09);transition:transform .15s ease,filter .15s ease,box-shadow .15s ease}.btn:hover{transform:translateY(-2px);filter:brightness(1.12)}.btn:active{transform:scale(.97)}.btn-green{background:linear-gradient(180deg,#28d748,#047019);border:2px solid #88ff95}.btn-orange{background:linear-gradient(180deg,#171717,#0a0a0a);border:2px solid #ff6b00;color:#ff8c22}.btn-blue{background:linear-gradient(180deg,#1d8ed7,#0a3d72);border:2px solid #48c5ff;padding:10px 12px;font-size:13px;margin-top:12px;width:100%}.play-btn{display:block}.btn:disabled,.btn-disabled{opacity:.55;cursor:not-allowed!important;filter:grayscale(.25);transform:none!important;pointer-events:none}
.btn-red{background:linear-gradient(180deg,#2b1111,#0b0505);border:2px solid #ff4040;color:#ff8c8c}
.btn-duel{background:linear-gradient(180deg,#1d8ed7,#0a3d72);border:2px solid #48c5ff}
.online-exit-confirm{
  position:fixed;
  inset:0;
  z-index:100001;
  display:grid;
  place-items:center;
  padding:20px;
  background:rgba(0,0,0,.72);
  backdrop-filter:blur(4px);
}
.online-exit-box{
  width:min(420px,100%);
  display:grid;
  gap:12px;
  padding:24px;
  text-align:center;
  border:2px solid rgba(249,199,79,.85);
  border-radius:18px;
  background:linear-gradient(180deg,rgba(14,20,31,.98),rgba(4,5,8,.98));
  box-shadow:0 0 44px rgba(249,199,79,.24), inset 0 0 20px rgba(255,255,255,.04);
}
.online-exit-box h2{
  color:var(--gold);
  font-size:28px;
  font-weight:900;
}
.online-exit-box p{
  color:var(--muted);
  font-size:15px;
  line-height:1.35;
}
.nickname-box .btn-duel{width:100%;margin-top:10px}
.btn-guest{position:fixed;top:24px;right:24px;z-index:100000;width:auto;min-height:44px;margin:0;padding:11px 18px;border-radius:999px;background:rgba(255,255,255,.07);border:1px solid rgba(249,199,79,.58);color:var(--gold);box-shadow:0 0 22px rgba(0,0,0,.28);backdrop-filter:blur(10px)}
.btn-guest:hover{background:rgba(249,199,79,.12)}
.btn-google{width:100%;margin-bottom:10px;background:white;border:1px solid white;color:#1f1f1f;box-shadow:0 0 20px rgba(255,255,255,.08)}
.btn-google:hover{background:#f2f2f2}
.auth-box #auth-submit{display:flex;align-items:center;justify-content:center;min-width:160px;margin:10px auto 0}
.auth-box:has(#tab-register.active) #auth-google{display:none!important}
.nickname-modal{position:fixed;inset:0;width:100vw;height:100vh;background:rgba(0,0,0,.88);display:flex;align-items:center;justify-content:center;z-index:99999;padding:20px;overflow:auto}.nickname-box{width:min(430px,calc(100vw - 36px));max-width:430px;padding:28px;text-align:center;background:linear-gradient(180deg,#0c1421,#05070d);border:2px solid var(--gold);border-radius:24px;box-shadow:0 0 40px rgba(255,198,90,.35);margin:auto}.modal-logo{width:280px;max-width:95%;filter:drop-shadow(0 0 16px rgba(255,198,90,.4));margin:0 auto 6px;display:block}.nickname-box h2{font-family:var(--font-display);font-size:32px;color:var(--gold)}.nickname-box p{color:var(--muted);font-size:14px;margin:10px 0 16px}#nickname-error{min-height:18px;margin-top:10px;color:#ff4747;font-size:13px;font-weight:800}.auth-tabs{display:flex;gap:8px;margin:12px 0 14px}.auth-tab{flex:1;border:1px solid var(--line);background:rgba(255,255,255,.06);color:var(--muted);border-radius:12px;padding:10px;cursor:pointer;font-weight:900}.auth-tab.active{background:linear-gradient(180deg,#1d8ed7,#0a3d72);color:white;border-color:#48c5ff}#auth-email,#auth-password,#auth-nickname{width:100%;padding:14px;border-radius:14px;border:1px solid var(--line);background:#090d15;color:white;text-align:center;font-size:17px;margin-bottom:12px}#auth-nickname{display:none}
.rules-modal{position:fixed;inset:0;width:100vw;height:100vh;display:none;align-items:center;justify-content:center;padding:20px;background:rgba(0,0,0,.50);z-index:99997;backdrop-filter:blur(3px)}.rules-modal.visible{display:flex}.rules-box{position:relative;width:min(640px,calc(100vw - 30px));max-height:92vh;overflow-y:auto;padding:28px 38px 28px;background:linear-gradient(180deg,rgba(28,20,15,.97),rgba(7,6,6,.97));border:3px solid var(--gold);border-radius:26px;box-shadow:0 0 50px rgba(249,199,79,.34),inset 0 0 22px rgba(255,255,255,.05);text-align:left}.rules-close{position:absolute;right:-18px;top:-18px;width:54px;height:54px;border-radius:50%;border:3px solid var(--gold);background:linear-gradient(180deg,#a51d12,#5a0704);color:white;font-size:34px;font-weight:900;cursor:pointer}.rules-title-wrap{display:flex;align-items:center;justify-content:center;gap:14px;margin:0 auto 18px;text-align:center}.rules-title-wrap span{color:var(--gold);font-size:26px}.rules-title-wrap h2{font-family:var(--font-display);font-size:34px;text-transform:uppercase;color:var(--gold);padding:10px 30px;border:2px solid #cf3e22;border-radius:12px;box-shadow:0 0 18px rgba(255,57,0,.32)}.rules-list-modal{display:flex;flex-direction:column;gap:10px;padding:16px 16px;background:rgba(255,255,255,.035);border:1px solid rgba(255,255,255,.1);border-radius:12px}.rule-row{display:grid;grid-template-columns:46px 1fr;gap:14px;align-items:center;padding:6px 0}.rule-row span{font-size:32px;text-align:center;filter:drop-shadow(0 0 8px rgba(249,199,79,.35))}.rule-row p{font-size:18px;line-height:1.42;color:white}.rule-row strong{color:var(--gold)}.dont-show-row{display:flex;align-items:center;gap:10px;margin:18px 0 16px;font-weight:700}.dont-show-row input{width:22px;height:22px;accent-color:#1c78ff}.rules-accept{width:100%;font-size:20px;padding:16px 20px}
.settings-modal{position:fixed;inset:0;width:100vw;height:100vh;display:none;align-items:center;justify-content:center;padding:18px;background:rgba(0,0,0,.58);z-index:99996;backdrop-filter:blur(4px)}.settings-modal.visible{display:flex}.settings-box{position:relative;width:min(460px,calc(100vw - 28px));max-height:92vh;overflow-y:auto;padding:22px;background:linear-gradient(180deg,rgba(14,20,31,.98),rgba(4,5,8,.98));border:2px solid rgba(249,199,79,.85);border-radius:18px;box-shadow:0 0 44px rgba(249,199,79,.24),inset 0 0 20px rgba(255,255,255,.04)}.settings-close{position:absolute;top:10px;right:10px;width:38px;height:38px;border-radius:50%;border:1px solid rgba(249,199,79,.78);background:rgba(255,255,255,.06);color:white;font-size:25px;font-weight:900;cursor:pointer}.settings-box h2{font-family:var(--font-display);font-size:34px;color:var(--gold);margin:0 42px 16px 0}.settings-section{padding:14px 0;border-top:1px solid rgba(255,255,255,.12)}.settings-section:first-of-type{border-top:0}.settings-section h3{font-size:15px;text-transform:uppercase;color:var(--gold);letter-spacing:0;margin-bottom:8px}.settings-section p{color:var(--muted);font-size:14px;line-height:1.35;margin-bottom:12px}.settings-actions{display:grid;gap:9px}.settings-action{width:100%;min-height:44px;border:1px solid rgba(249,199,79,.58);border-radius:10px;background:rgba(255,255,255,.06);color:white;font-weight:900;cursor:pointer}.settings-action:hover{background:rgba(249,199,79,.12)}.google-action{background:white;color:#1f1f1f;border-color:white}.danger-action{color:#ff9b9b;border-color:rgba(255,125,125,.45)}.settings-status{min-height:18px;margin-top:10px;color:var(--gold);font-size:13px;font-weight:800}.volume-row{display:grid;gap:8px;margin-top:12px;color:white;font-weight:800}.volume-row span{display:flex;align-items:center;justify-content:space-between;gap:10px}.volume-row strong{color:var(--gold)}.volume-row input{width:100%;accent-color:var(--gold)}
.victory-overlay{position:fixed;inset:0;background:rgba(0,0,0,.72);z-index:99998;display:grid;place-items:center;opacity:0;transition:opacity .25s ease;overflow:hidden;padding:18px}.victory-overlay.show{opacity:1}.victory-box{position:relative;z-index:2;width:min(520px,100%);padding:32px 26px;text-align:center;background:linear-gradient(180deg,#172236,#060912);border:3px solid var(--gold);border-radius:28px;box-shadow:0 0 55px rgba(246,199,90,.42);animation:victory-pop .55s cubic-bezier(.18,.89,.32,1.28)}.victory-trophy{font-size:82px}.victory-box h2{font-family:var(--font-display);font-size:46px;color:var(--gold)}.victory-prize{font-size:28px;font-weight:900;color:var(--green);margin:14px 0;padding:12px;border-radius:18px;background:rgba(53,244,107,.08);border:1px solid rgba(53,244,107,.25)}.victory-details{display:flex;justify-content:center;gap:16px;flex-wrap:wrap;margin:14px 0 20px;color:white}.victory-details strong{color:var(--gold)}.confetti-layer{position:absolute;inset:0;pointer-events:none;z-index:1}.confetti-layer span{position:absolute;top:-10%;font-size:22px;color:var(--gold);animation:confetti-fall 3s linear infinite}.confetti-layer span:nth-child(odd){left:15%}.confetti-layer span:nth-child(even){left:75%}@keyframes victory-pop{from{transform:scale(.78);opacity:.4}to{transform:scale(1);opacity:1}}@keyframes confetti-fall{to{transform:translateY(115vh) rotate(720deg)}}

@media(max-width:1180px){
  body{background-attachment:scroll,scroll,scroll}
  .casino-shell{width:100%;grid-template-columns:1fr;gap:0}
  .casino-sidebar{min-height:auto;border-right:0;border-bottom:1px solid rgba(249,199,79,.35)}
  .casino-menu{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;margin-top:0}
  .menu-item{min-height:40px;padding:10px 12px;border-radius:8px;font-size:15px;gap:12px}
  .menu-emoji{flex-basis:22px;font-size:18px}
  .game-stage{padding:20px}
  .page-view{min-height:auto}
  .board-wrapper{min-height:560px}
  .board{min-height:auto}
}

@media(max-width:720px){
  .game-round-active .game-stage{
    min-height:auto;
    overflow-y:auto;
    padding:12px 10px 0;
  }
  .game-round-active .game-view{
    min-height:auto;
  }
  .game-round-active .game-toolbar,
  .game-round-active .top-hud,
  .game-round-active .message,
  .game-round-active .bottom-hud{
    width:100%;
  }
  .game-round-active .board-wrapper{
    width:100%;
    max-width:440px;
    min-height:clamp(304px, 95vw, 428px);
  }
  .game-round-active .board{
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:clamp(6px, 2vw, 10px);
  }
  .casino-shell{width:100%}
  .casino-sidebar{
    position:relative;
    padding:10px 10px 12px;
    gap:8px;
    box-shadow:0 12px 28px rgba(0,0,0,.45);
  }
  .player-strip{
    min-height:58px;
    gap:10px;
    padding:0 98px 8px 2px;
  }
  .game-toolbar{
    width:100%;
    margin-bottom:10px;
    align-items:stretch;
  }
  .game-toolbar .player-strip{
    padding:8px 10px;
    flex:1 1 auto;
  }
  .game-toolbar-actions{
    align-items:stretch;
  }
  .balance-chip{
    min-height:44px;
    padding:7px 10px;
    border-radius:10px;
    font-size:16px;
  }
  .toolbar-icon-button{
    width:44px;
    height:44px;
  }
  .player-avatar{width:52px;height:52px}
  .player-strip h2{font-size:16px;margin-bottom:3px}
  .player-strip p{font-size:17px}
  .player-awards{gap:8px}
  .trophy-icon,.medal-icon{width:19px;height:19px;font-size:14px}
  .coin-icon{width:19px;height:19px;font-size:12px;margin-right:5px}
  .casino-menu{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
  }
  .menu-item{
    min-height:38px;
    justify-content:center;
    gap:6px;
    padding:8px 6px;
    border-radius:8px;
    font-size:12px;
    white-space:nowrap;
  }
  .sound-controls{
    position:static;
    margin-top:0;
  }
  .game-toolbar .sound-controls{position:static}
  .sound-controls button{width:38px;height:36px;font-size:17px}
  .game-stage{padding:12px 10px 18px}
  .top-hud{
    width:100%;
    margin:0 auto 10px;
    border-radius:10px;
  }
  .hud-cell{
    padding:10px 8px;
    gap:6px;
  }
  .hud-cell span{font-size:10px}
  .hud-cell strong{font-size:25px}
  .message{
    width:100%;
    margin:0 auto 12px;
    padding:9px 11px;
    border-radius:10px;
    font-size:13px;
    line-height:1.35;
  }
  .local-duel-panel{
    width:100%;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin:0 auto 12px;
  }
  body.online-duel-active .local-duel-panel{
    width:100%;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin:0 auto 12px;
  }
  .duel-turn{
    grid-column:1/-1;
    grid-row:1;
    min-width:0;
    min-height:38px;
    font-size:12px;
  }
  .duel-player{
    grid-row:2;
    min-height:54px;
  }
  body.online-duel-active .duel-player,
  body.online-duel-active .duel-turn{
    min-height:54px;
  }
  .duel-player strong{font-size:24px}
  .board-wrapper{
    width:100%;
    min-height:330px;
  }
  body.online-duel-active .board-wrapper{
    width:100%;
    min-height:330px;
  }
  body.online-duel-active .start-game-panel.online-searching{
    min-height:300px;
  }
  body.online-duel-active .online-waiting-logo{
    width:min(220px,62vw);
    max-height:220px;
  }
  .start-game-button{
    min-width:0;
    min-height:74px;
    padding:18px 20px;
    border-radius:14px;
    font-size:22px;
  }
  .mode-picker-button{
    min-height:48px;
    font-size:13px;
  }
  .game-mode-panel{
    align-items:center;
    padding:18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .game-mode-dialog{
    width:min(430px,100%);
    padding:22px 18px 20px;
  }
  .game-mode-dialog h2{
    font-size:31px;
    line-height:1;
  }
  .mode-options{
    gap:16px;
  }
  .mode-tabs{
    gap:7px;
    margin-bottom:14px;
    padding:5px;
  }
  .mode-tab{
    min-height:42px;
    font-size:13px;
  }
  .mode-group{
    gap:10px;
  }
  .mode-group h3{
    font-size:21px;
  }
  .mode-group-online{
    padding-top:14px;
  }
  .mode-option{
    grid-template-columns:108px 1fr;
    gap:10px;
    min-height:130px;
    padding:10px;
  }
  .mode-art-wrap{
    width:108px;
    height:106px;
  }
  .mode-art-wrap img{
    max-height:126px;
  }
  .mode-option strong{
    font-size:15px;
  }
  .mode-option small{
    font-size:12px;
    line-height:1.28;
  }
  .online-wager-options{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .online-wager-option{
    min-height:40px;
  }
  .board{
    width:100%;
    grid-template-columns:repeat(4,minmax(72px,1fr));
    gap:8px;
    min-height:auto;
  }
  .card-face{border-width:2px;border-radius:10px}
  .animal-card-img{border-radius:7px}
  .bottom-hud{
    width:100%;
    grid-template-columns:1fr 1fr;
    gap:8px;
    margin:14px auto 0;
    padding:9px;
    border-radius:12px;
  }
  .bottom-stat{
    min-height:62px;
    padding:6px 8px;
  }
  .bottom-stat span{font-size:11px}
  .bottom-stat strong{font-size:26px}
  .btn{
    min-height:46px;
    padding:10px 8px;
    border-radius:11px;
    font-size:12px;
  }
  .bottom-hud .btn{
    grid-column:1/-1;
  }
  .view-panel{
    width:100%;
    padding:18px;
    border-radius:12px;
  }
  .view-heading{padding-bottom:12px}
  .view-heading span{font-size:28px}
  .view-heading h1{font-size:30px}
  .store-grid{
    display:flex;
    grid-template-columns:none;
    gap:14px;
    max-height:none;
    overflow-x:auto;
    overflow-y:hidden;
    scroll-snap-type:x mandatory;
    overscroll-behavior-x:contain;
    padding:2px 8px 16px;
    scrollbar-width:none;
  }
  .store-grid::-webkit-scrollbar{display:none}
  .store-grid .shop-item{
    flex:0 0 min(336px, calc(100vw - 112px));
    scroll-snap-align:center;
  }
  .skin-preview{height:210px}
  .skin-art{width:179px}
  .profile-card{gap:12px}
  .profile-avatar-large{width:72px;height:72px}
  .profile-card h2{font-size:23px}
  .profile-card p{font-size:19px}
  .avatar-picker{grid-template-columns:repeat(auto-fill,minmax(58px,1fr));gap:9px}
  .profile-history{font-size:18px}
  .profile-history strong{font-size:24px}
  .ranking-item,.live-item{
    grid-template-columns:48px 1fr auto;
    gap:9px;
    padding:12px 4px;
  }
  .ranking-switcher{
    gap:6px;
    padding:5px;
  }
  .ranking-switch{
    min-height:38px;
    font-size:12px;
  }
  .entry-avatar{width:42px;height:42px}
  .ranking-name,.live-name{font-size:15px}
  .ranking-meta,.live-time{font-size:12px}
  .ranking-prize,.live-score,.ranking-cups{grid-column:auto;font-size:16px}
  .rules-box{padding:24px 18px}
  .rules-title-wrap h2{font-size:25px;padding:8px 14px}
  .rule-row p{font-size:15px}
}

@media(max-width:380px){
  .casino-menu{grid-template-columns:repeat(2,minmax(0,1fr))}
  .board{grid-template-columns:repeat(4,minmax(62px,1fr));gap:7px}
  .start-game-button{min-width:min(280px,86vw);font-size:20px}
  .hud-cell{flex-direction:column;gap:3px}
  .bottom-hud{gap:7px}
}

.touch-device .btn:hover,
.touch-device .menu-item:hover,
.touch-device .avatar-option:hover,
.touch-device .start-game-button:hover,
.touch-device .mode-option:hover{
  transform:none;
  filter:none;
}

@media(max-width:720px){
  body{
    min-height:var(--app-height);
    background-position:center top, center top, center top;
  }

  .casino-shell{
    display:block;
    min-height:var(--app-height);
    padding-bottom:calc(12px + env(safe-area-inset-bottom));
  }

  .game-round-active .casino-shell{
    padding-bottom:calc(12px + env(safe-area-inset-bottom));
  }

  .casino-sidebar{
    position:static;
    z-index:30;
    min-height:0;
    height:0;
    padding:0;
    border:0;
    background:transparent;
    box-shadow:none;
  }

  .player-strip{
    padding:0 94px 0 2px;
    border-bottom:0;
  }
  .game-toolbar .player-strip{
    padding:8px 10px;
    border-bottom:1px solid rgba(249,199,79,.18);
  }

  .casino-menu{
    position:fixed;
    top:auto;
    left:0;
    right:0;
    bottom:0;
    z-index:50;
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:6px;
    margin:0;
    padding:8px max(8px, env(safe-area-inset-left)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-right));
    background:linear-gradient(180deg, rgba(12,8,7,.94), rgba(0,0,0,.98));
    border-top:1px solid rgba(249,199,79,.35);
    box-shadow:0 -12px 30px rgba(0,0,0,.6);
  }

  .menu-item{
    min-height:42px;
    padding:7px 6px;
    font-size:12px;
    line-height:1.05;
    white-space:normal;
    text-align:center;
  }

  .menu-item span{
    overflow:hidden;
    text-overflow:ellipsis;
  }

  .menu-emoji{
    flex-basis:auto;
    font-size:16px;
  }

  .sound-controls{
    top:auto;
  }

  .game-stage{
    min-height:auto;
    padding:12px 10px 0;
  }

  .game-view{
    width:100%;
    max-width:440px;
  }

  .top-hud,
  .message,
  .game-toolbar,
  .bottom-hud{
    max-width:440px;
  }

  .board-wrapper{
    width:100%;
    max-width:440px;
    min-height:clamp(304px, 95vw, 428px);
  }

  .board{
    width:100%;
    max-width:440px;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:clamp(6px, 2vw, 10px);
  }

  .card-wrap{
    min-width:0;
  }

  .bottom-stat{
    border-right:0;
    border-bottom:1px solid rgba(255,255,255,.14);
  }

  .bottom-stat:nth-child(2){
    border-bottom:1px solid rgba(255,255,255,.14);
  }

  .bottom-hud .btn{
    width:100%;
  }

  .btn-duel{
    grid-column:1/-1;
  }

  .page-view{
    justify-content:flex-start;
    padding:0 0 calc(96px + env(safe-area-inset-bottom));
  }

  .view-panel{
    max-width:440px;
    max-height:none;
  }

  .ranking-list,
  .live-list,
  .avatar-picker{
    max-height:calc(var(--app-height) - 210px);
    overflow-y:auto;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    padding-bottom:calc(18px + env(safe-area-inset-bottom));
  }

  .store-grid{
    max-height:none;
    -webkit-overflow-scrolling:touch;
  }

  .nickname-modal{
    align-items:flex-start;
    padding:calc(18px + env(safe-area-inset-top)) 18px calc(18px + env(safe-area-inset-bottom));
  }

  .nickname-box{
    margin:0 auto;
    border-radius:18px;
  }

  .rules-modal{
    align-items:flex-start;
    padding:calc(18px + env(safe-area-inset-top)) 15px calc(18px + env(safe-area-inset-bottom));
  }

  .rules-box{
    border-radius:18px;
  }
}

@media(max-width:380px){
  .casino-menu{
    grid-template-columns:repeat(3,minmax(0,1fr));
  }

  .menu-item{
    font-size:11px;
    gap:4px;
  }

  .board{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}

@media(max-width:720px) and (max-height:700px){
  .modal-logo{
    width:200px;
  }

  .nickname-box{
    padding:18px;
  }

  .nickname-box h2{
    font-size:26px;
  }

  .nickname-box p{
    margin:6px 0 10px;
  }

  #auth-email,
  #auth-password,
  #auth-nickname{
    padding:11px;
    margin-bottom:9px;
  }
}

@media(max-width:720px){
  .nickname-modal{
    inset:0;
    align-items:stretch;
    justify-content:stretch;
    width:100vw;
    height:var(--app-height);
    min-height:var(--app-height);
    padding:0;
    overflow-y:auto;
    background:
      linear-gradient(180deg, rgba(6,10,17,.97), rgba(0,0,0,.99)),
      url("assets/casino-background.png");
    background-size:cover, cover;
    background-position:center, center;
  }

  .nickname-box{
    width:100%;
    flex:1 0 auto;
    max-width:none;
    min-height:var(--app-height);
    margin:0;
    padding:calc(22px + env(safe-area-inset-top)) 26px calc(28px + env(safe-area-inset-bottom));
    border:0;
    border-radius:0;
    box-shadow:none;
    display:flex;
    flex-direction:column;
    justify-content:center;
    position:relative;
    background:
      linear-gradient(180deg, rgba(8,14,24,.94), rgba(2,3,6,.97)),
      radial-gradient(circle at 50% 18%, rgba(249,199,79,.16), transparent 38%);
  }

  .btn-guest{
    position:absolute;
    top:calc(14px + env(safe-area-inset-top));
    right:16px;
    width:auto;
    min-height:38px;
    margin:0;
    padding:9px 13px;
    border-radius:999px;
    font-size:11px;
    line-height:1;
    background:rgba(255,255,255,.07);
    backdrop-filter:blur(10px);
  }

  .modal-logo{
    width:min(280px,74vw);
    margin-bottom:18px;
  }

  .nickname-box h2{
    font-size:34px;
  }
}

.auth-tabs{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.auth-box{
  display:grid;
  justify-items:center;
}
.auth-box .auth-tabs,
.auth-box input,
.auth-box #nickname-error{
  width:100%;
}
.auth-box .btn{
  justify-content:center;
  align-items:center;
}
.auth-tab{
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  line-height:1.15;
}

.auth-tabs.choice-mode{
  grid-template-columns:1fr;
  margin-top:18px;
}

.auth-tabs.choice-mode .auth-tab{
  min-height:54px;
  font-size:15px;
  border-radius:14px;
}

.auth-tabs.choice-mode .auth-google-choice{
  background:white;
  border-color:white;
  color:#202124;
}

