@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=DM+Mono:wght@400;500&display=swap');

:root {
  --bg: #0b0a08;
  --panel: #131009;
  --panel-2: #1b170e;
  --ink: #f4f0e6;
  --muted: #8b8472;
  --gold: #f0b90b;
  --gold-deep: #c99a0a;
  --orange: #e49a46;
  --red: #dc4034;
  --line: rgba(246, 240, 230, .1);
  --mono: "DM Mono", monospace;
  --sans: "Archivo", Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; }
button { color: inherit; font: inherit; }
img { display: block; }
.game-shell { height: 100svh; display: grid; grid-template: 64px 1fr / 58px 1fr 286px; }
.game-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: rgba(11,10,8,.96);
  border-bottom: 1px solid var(--line);
  z-index: 20;
}
.game-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-size: 11px; font-weight: 900; letter-spacing: .02em; }
.game-brand b { color: var(--gold); }
.mini-mark { width: 30px; height: 30px; }
.network-status { margin-left: auto; margin-right: 30px; display: flex; align-items: center; gap: 8px; color: var(--muted); font: 9px var(--mono); text-transform: uppercase; }
.network-status i { width: 6px; height: 6px; background: var(--gold); border-radius: 50%; box-shadow: 0 0 9px var(--gold); }
.network-status span { border-left: 1px solid var(--line); padding-left: 8px; color: var(--ink); }
.header-actions { display: flex; gap: 8px; }
.icon-button, .wallet-button { height: 36px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.icon-button { width: 36px; }
.wallet-button { padding: 0 15px; background: var(--gold); color: #0b0a08; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.wallet-button:hover { background: var(--gold-deep); }
.wallet-button span { color: #0b0a08; font-size: 15px; margin-right: 7px; }

.left-rail { grid-row: 2; padding: 12px 8px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; z-index: 10; }
.rail-button { width: 41px; height: 41px; border: 0; background: transparent; color: #756e5c; cursor: pointer; font-size: 16px; border-left: 2px solid transparent; }
.rail-button:hover, .rail-button.active { color: var(--gold); background: rgba(240,185,11,.08); border-left-color: var(--gold); }
.rail-spacer { flex: 1; }

.table-stage {
  grid-row: 2;
  grid-column: 2;
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: radial-gradient(ellipse at 50% 26%, #2c2612 0, #16130c 40%, #0b0a08 74%);
}
.room-meta { position: absolute; top: 18px; left: 22px; right: 22px; display: flex; justify-content: space-between; z-index: 5; }
.room-meta div { display: grid; gap: 3px; }
.room-meta small { color: var(--muted); font: 8px var(--mono); }
.room-meta strong { font-size: 12px; letter-spacing: .03em; }
.room-meta .blinds { text-align: right; }
.ambient-light { position: absolute; top: -170px; width: 280px; height: 460px; filter: blur(40px); opacity: .12; transform: rotate(18deg); }
.light-left { left: 5%; background: var(--gold); }
.light-right { right: 5%; background: var(--orange); transform: rotate(-18deg); }
.world-grid {
  position: absolute; inset: 0; opacity: .07;
  background-image: linear-gradient(rgba(240,185,11,.35) 1px, transparent 1px), linear-gradient(90deg, rgba(240,185,11,.35) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, black, transparent 75%);
}

.poker-world { position: absolute; inset: 22px 0 138px; perspective: 900px; }
.dealer-light {
  position: absolute; left: 50%; top: -15%; width: 42%; height: 68%;
  transform: translateX(-50%); background: linear-gradient(to bottom, rgba(255,224,150,.22), transparent);
  clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%); filter: blur(15px);
}
.table-base {
  position: absolute; left: 50%; top: 49%; width: min(70vw, 790px); height: min(42vw, 470px);
  border-radius: 50%; transform: translate(-50%, -50%) rotateX(58deg) translateY(45px);
  background: #050403; box-shadow: 0 80px 70px rgba(0,0,0,.7);
}
.poker-table {
  position: absolute; left: 50%; top: 43%; width: min(67vw, 760px); height: min(39vw, 440px);
  transform-style: preserve-3d; transform: translate(-50%, -50%) rotateX(58deg);
}
.table-rail {
  position: absolute; inset: 0; border-radius: 50%; background: #17140d;
  border: 6px solid #342d18; box-shadow: inset 0 0 0 7px #0a0906, 0 18px 0 #050403, 0 25px 34px rgba(0,0,0,.6);
}
.felt {
  position: absolute; inset: 23px; border-radius: 50%;
  background: radial-gradient(circle, #22301f, #10160e 72%);
  border: 1px solid rgba(240,185,11,.18); overflow: hidden;
}
.felt::after {
  content: ""; position: absolute; inset: 6%; border: 1px solid rgba(240,185,11,.14); border-radius: 50%;
}
.felt-logo { position: absolute; left: 50%; top: 52%; transform: translate(-50%,-50%); font-family: var(--sans); font-weight: 900; font-size: 48px; color: rgba(246,240,230,.05); }
.felt-logo span { color: rgba(240,185,11,.16); }
.pot-display { position: absolute; left: 50%; top: 22%; transform: translateX(-50%) rotateX(-5deg); text-align: center; display: grid; z-index: 2; }
.pot-display small { font: 7px var(--mono); color: rgba(246,240,230,.5); }
.pot-display strong { font-size: 14px; }
.pot-display span { font: 7px var(--mono); color: var(--gold); }
.community-cards { position: absolute; display: flex; gap: 6px; left: 50%; top: 48%; transform: translate(-50%, -50%); z-index: 3; }
.playing-card {
  width: 55px; height: 76px; padding: 6px; background: #f2eee3; color: #14120d; border-radius: 4px;
  box-shadow: 0 5px 10px rgba(0,0,0,.3); display: flex; flex-direction: column; font-size: 13px; font-weight: 900;
}
.playing-card b { align-self: center; font-size: 25px; line-height: 1; margin-top: 7px; }
.playing-card.red { color: #d63b33; }
.playing-card.hidden-card { background: repeating-linear-gradient(45deg,#2a2415,#2a2415 4px,#3d3520 4px,#3d3520 8px); border: 2px solid var(--gold-deep); color: transparent; }
.pot-chips { position: absolute; left: 61%; top: 62%; z-index: 3; }
.pot-chips i { display: block; width: 35px; height: 12px; margin-top: -7px; border-radius: 50%; background: var(--gold); border: 3px dashed #0b0a08; }

.seat { position: absolute; z-index: 7; display: flex; align-items: center; gap: 7px; }
.seat-top { left: 50%; top: 3%; transform: translateX(-50%); flex-direction: column; }
.seat-left { left: 7%; top: 46%; }
.seat-right { right: 7%; top: 46%; flex-direction: row-reverse; }
.seat-bottom { left: 50%; bottom: 2%; transform: translateX(-50%); flex-direction: column-reverse; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; border: 2px solid #555; background: #1b1810;
  display: grid; place-items: center; font: 8px var(--mono); box-shadow: 0 0 0 4px rgba(0,0,0,.45);
}
.avatar-purple { border-color: var(--gold); background: radial-gradient(circle at 50% 25%, #ffd85e, #4a3a0a); color: #1a1405; }
.avatar-red { border-color: var(--red); background: radial-gradient(circle at 50% 25%, #f4746b, #461916); }
.avatar-green { border-color: var(--orange); background: radial-gradient(circle at 50% 25%, #f3bd83, #4a2f14); }
.avatar-user { width: 62px; height: 62px; border-color: var(--ink); background: radial-gradient(circle at 50% 25%, #efe9db, #43392a); color: black; font-weight: 700; }
.player-label { padding: 7px 10px; background: rgba(8,7,5,.86); border: 1px solid var(--line); min-width: 105px; display: grid; text-align: center; }
.player-label strong { font-size: 9px; }
.player-label small { margin-top: 2px; color: var(--gold); font: 8px var(--mono); }
.bet-chip { position: absolute; font: 7px var(--mono); color: #0b0a08; border: 2px dashed #0b0a08; background: var(--gold); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-weight: 700; }
.seat-top .bet-chip { top: 118px; }
.seat-left .bet-chip { left: 165px; top: 47px; }
.seat-right .bet-chip { right: 165px; top: 47px; }
.card-backs { display: flex; position: absolute; }
.card-backs i { width: 26px; height: 37px; background: repeating-linear-gradient(45deg,#1a160d,#1a160d 3px,#6b5220 3px,#6b5220 6px); border: 2px solid #d8cba0; border-radius: 3px; }
.card-backs i + i { margin-left: -17px; transform: rotate(8deg); }
.seat-top .card-backs { top: 85px; left: 56px; }
.seat-left .card-backs { top: 53px; left: 61px; }
.seat-right .card-backs { top: 53px; right: 61px; }
.hole-cards { display: flex; gap: 4px; position: absolute; bottom: 39px; left: 69px; transform: scale(.82) rotate(4deg); }
.hole-cards .playing-card:first-child { transform: rotate(-7deg); }
.dealer-button { position: absolute; right: -31px; top: 3px; background: var(--gold); color: #0b0a08; border-radius: 50%; width: 23px; height: 23px; display: grid; place-items: center; font-size: 9px; font-weight: 900; }

.action-panel {
  position: absolute; z-index: 15; left: 18px; right: 18px; bottom: 14px; height: 112px;
  display: grid; grid-template-columns: 170px 1fr 265px; gap: 20px; align-items: center;
  padding: 13px 16px; background: rgba(19,16,9,.94); border: 1px solid var(--line); backdrop-filter: blur(14px);
}
.hand-info { display: grid; gap: 4px; }
.hand-info small, .raise-control small { font: 7px var(--mono); color: var(--muted); }
.hand-info strong { font-size: 11px; }
.hand-info span { color: var(--gold); font: 8px var(--mono); }
.action-buttons { display: flex; justify-content: center; gap: 7px; }
.action { min-width: 108px; height: 48px; border: 1px solid var(--line); background: #1e1a10; cursor: pointer; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.action:hover { border-color: rgba(246,240,230,.35); transform: translateY(-2px); }
.action.primary { background: var(--gold); border-color: var(--gold); color: #0b0a08; }
.action.primary:hover { background: var(--gold-deep); }
kbd { margin-left: 7px; padding: 2px 4px; font: 7px var(--mono); color: rgba(246,240,230,.5); border: 1px solid rgba(246,240,230,.15); }
.action.primary kbd { color: rgba(11,10,8,.55); border-color: rgba(11,10,8,.3); }
.raise-control { display: grid; grid-template-columns: 75px 1fr; gap: 6px 9px; align-items: center; }
.raise-control > div:first-child { display: grid; }
.raise-control strong { font-size: 11px; }
input[type="range"] { width: 100%; accent-color: var(--gold); }
.quick-bets { display: flex; gap: 3px; }
.quick-bets button { border: 1px solid var(--line); background: transparent; font: 7px var(--mono); padding: 5px; cursor: pointer; }
.quick-bets button:hover { background: rgba(240,185,11,.12); border-color: var(--gold-deep); }
.raise-button { grid-column: 2; border: 0; background: var(--gold); color: #0b0a08; height: 27px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; cursor: pointer; }
.raise-button:hover { background: var(--gold-deep); }

.right-panel { grid-row: 2; grid-column: 3; background: var(--panel); border-left: 1px solid var(--line); z-index: 10; min-width: 0; }
.panel-tabs { height: 48px; display: flex; border-bottom: 1px solid var(--line); }
.panel-tabs button { flex: 1; border: 0; background: none; color: var(--muted); font: 8px var(--mono); text-transform: uppercase; cursor: pointer; border-bottom: 2px solid transparent; }
.panel-tabs button.active { color: var(--gold); border-bottom-color: var(--gold); }
.panel-content { display: none; padding: 16px; height: calc(100% - 48px); }
.panel-content.active { display: flex; flex-direction: column; }
.hand-number { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 13px; }
.hand-number span { font: 9px var(--mono); }
.hand-number small { color: var(--gold); font: 7px var(--mono); }
.activity-feed { margin-top: 7px; }
.activity-feed > div { display: grid; grid-template-columns: 8px 1fr auto; gap: 7px; align-items: start; padding: 12px 0; border-bottom: 1px solid rgba(246,240,230,.06); }
.activity-feed i { width: 5px; height: 5px; background: var(--orange); border-radius: 50%; margin-top: 5px; }
.activity-feed i.green { background: var(--gold); }
.activity-feed p { margin: 0; font-size: 9px; line-height: 1.5; color: var(--muted); }
.activity-feed p strong { color: var(--ink); }
.activity-feed p b { color: var(--gold); }
.activity-feed time { color: #605949; font: 7px var(--mono); }
.activity-feed .system-entry p { font-family: var(--mono); font-size: 8px; }
.chain-proof { margin-top: auto; border: 1px solid rgba(240,185,11,.28); background: rgba(240,185,11,.06); padding: 13px; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; }
.chain-proof div { display: grid; gap: 3px; }
.chain-proof small { font: 7px var(--mono); color: var(--muted); }
.chain-proof strong { color: var(--gold); font-size: 9px; }
.proof-hash { font: 8px var(--mono); }
.chain-proof button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.chain-proof button:hover { color: var(--gold); }
.player-row { display: grid; grid-template-columns: 10px 1fr auto; gap: 8px; padding: 15px 0; border-bottom: 1px solid var(--line); align-items: center; }
.player-row .dot { width: 7px; height: 7px; border-radius: 50%; }
.dot.purple { background: var(--gold); }.dot.red { background: var(--red); }.dot.green { background: var(--orange); }.dot.white { background: var(--ink); }
.player-row strong { font-size: 9px; }.player-row small { font: 8px var(--mono); color: var(--muted); }

.toast { position: absolute; z-index: 30; top: 22px; left: 50%; transform: translate(-50%,-120px); padding: 12px 18px; background: #f4f0e6; color: #0b0a08; display: flex; gap: 10px; align-items: center; box-shadow: 0 15px 40px rgba(0,0,0,.4); transition: transform .35s ease; }
.toast.show { transform: translate(-50%,0); }
.toast i { width: 25px; height: 25px; display: grid; place-items: center; background: var(--gold); border-radius: 50%; font-style: normal; color: #0b0a08; }
.toast div { display: grid; gap: 2px; }.toast strong { font-size: 9px; text-transform: uppercase; }.toast span { font: 7px var(--mono); color: #5f5849; }

.wallet-modal { display: none; position: fixed; inset: 0; z-index: 100; place-items: center; }
.wallet-modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.76); backdrop-filter: blur(8px); }
.modal-dialog { position: relative; width: min(410px, calc(100vw - 30px)); padding: 32px; background: #15120b; border: 1px solid rgba(240,185,11,.22); }
.modal-close { position: absolute; right: 15px; top: 12px; border: 0; background: none; font-size: 23px; cursor: pointer; color: var(--muted); }
.modal-dialog > small { color: var(--gold); font: 8px var(--mono); }
.modal-dialog h2 { margin: 12px 0; font-size: 34px; font-family: var(--sans); font-weight: 900; }
.modal-dialog p { color: var(--muted); line-height: 1.6; font-size: 12px; }
.wallet-option { width: 100%; height: 62px; margin-top: 8px; padding: 0 15px; display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--line); background: #1d1810; text-align: left; cursor: pointer; }
.wallet-option:hover { border-color: var(--gold); }
.wallet-option span { color: var(--gold); font-size: 18px; }
.wallet-option div { display: grid; }.wallet-option strong { font-size: 11px; }.wallet-option small { font: 8px var(--mono); color: var(--muted); }
.demo-option { width: 100%; border: 0; background: none; color: var(--muted); padding: 17px; font: 8px var(--mono); cursor: pointer; text-decoration: underline; }
.demo-option:hover { color: var(--ink); }

@media (max-width: 1050px) {
  .game-shell { grid-template-columns: 52px 1fr; }
  .right-panel { display: none; }
  .table-stage { grid-column: 2; }
  .action-panel { grid-template-columns: 130px 1fr; }
  .raise-control { display: none; }
  .poker-table { width: min(78vw, 760px); height: min(45vw, 440px); }
}
@media (max-width: 700px) {
  body { overflow: auto; }
  .game-shell { height: 100svh; grid-template: 55px 1fr / 1fr; }
  .game-header { grid-column: 1; padding: 0 10px; }
  .left-rail, .network-status { display: none; }
  .table-stage { grid-column: 1; grid-row: 2; }
  .wallet-button { padding: 0 10px; font-size: 8px; }
  .icon-button { display: none; }
  .poker-world { inset: 50px 0 177px; }
  .poker-table { width: 95vw; height: 61vw; top: 45%; }
  .table-base { width: 98vw; height: 63vw; }
  .community-cards { gap: 3px; }
  .playing-card { width: 39px; height: 56px; font-size: 9px; padding: 4px; }
  .playing-card b { font-size: 18px; margin-top: 5px; }
  .seat-top { top: 4%; }
  .seat-left { left: 2%; top: 48%; flex-direction: column; }
  .seat-right { right: 2%; top: 48%; flex-direction: column; }
  .seat-bottom { bottom: -1%; }
  .avatar { width: 40px; height: 40px; }
  .avatar-user { width: 49px; height: 49px; }
  .player-label { min-width: 83px; padding: 5px; }
  .seat .bet-chip, .card-backs { display: none; }
  .hole-cards { left: 58px; bottom: 31px; }
  .action-panel { height: 164px; left: 8px; right: 8px; bottom: 8px; grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .hand-info { grid-template-columns: auto 1fr auto; align-items: center; }
  .action-buttons { width: 100%; }
  .action { min-width: 0; flex: 1; height: 52px; }
  kbd { display: none; }
}
