/* Shared material finish; game geometry and interaction remain game-owned. */
:root {
  --royale-gold: #d8b66b;
  --royale-ink: #06120f;
  --royale-cream: #fff0cb;
  --royale-focus: #a1f3cc;
  --royale-leather: repeating-linear-gradient(35deg, #ffffff05 0 1px, transparent 1px 18px), repeating-linear-gradient(-35deg, #0005 0 1px, transparent 1px 18px), linear-gradient(150deg,#1c1c1e,#080b0a 55%,#161918);
  --royale-velvet: repeating-linear-gradient(92deg,#ffffff01 0 1px,transparent 1px 3px), radial-gradient(ellipse at 45% 25%,#10543c,#053525 55%,#01271d);
}
:is(.lobby-panel, .casino-panel, .reference-side-card, .setup-card, .squishy-panel, .players-section) {
  border-color: #96753f;
  background-color: #071e17;
  background-image: linear-gradient(135deg, #ffffff05, transparent 42%), radial-gradient(ellipse at top, #174c363b, transparent 75%);
  box-shadow: inset 0 1px 0 #ffe5a52b, inset 0 -2px 8px #0008, 0 12px 32px #0004;
}
:is(.login-card:not(.casino-mode):not(.lobby-mode), .help-dialog, .recovery-dialog, .shared-modal, .winner-popup, .table-result-card, .rules-dialog) {
  border-color:#aa8445;
  color:var(--royale-cream);
  background-image:radial-gradient(ellipse at top,#174535,#071a14 70%);
  box-shadow:inset 0 0 0 3px #0005,inset 0 0 0 4px #e7bd612e,0 18px 60px #000a;
}
:is(.roulette-betting-area,.pok-table-surface,.baccarat-table-surface,.dice-rack,.wheel-frame) {
  border-color:#bc9551;
  box-shadow:inset 0 1px 0 #ffe4a54f,inset 0 0 18px #0005,0 5px 18px #0007;
}

/* Keep the supplied lobby illustration, characters, game art and gold pot. */
#games.casino-panel { background-color:#02130f; }
:is(.fun-lobby-header, .topbar, .blackjack-topbar, .cup-header, .party-header) {
  border-color:#ae884a;
  background-image:var(--royale-leather);
  box-shadow:inset 0 1px 0 #fbe5a75c,0 5px 22px #0006;
}
:is(.fun-scoreboard-section, .blackjack-lobby-card, .lobby-panel, .casino-table-shell, .poker-participants, .poker-chat-panel, .reference-side-card, .setup-card, .players-section, .squishy-panel) {
  border:1px solid #9f7b43;
  border-radius:20px;
  box-shadow:inset 0 0 0 3px #0005,inset 0 0 0 4px #d8b66b25,inset 0 1px 1px #ffe4a15c,0 12px 32px #0005;
}
:is(.fun-lobby-hero, .fun-scoreboard-section, .lobby-header, .blackjack-lobby-header, .poker-chat-head, .panel-heading) {
  border-color:#a98950;
}
.fun-lobby-hero { border-radius:28px; box-shadow:inset 0 0 0 1px #e9c67c55,0 15px 45px #0006; }
.fun-scoreboard-grid > * { min-width:0; }
.fun-current-player-card strong { min-width:0;overflow-wrap:anywhere; }
@media (max-width:900px) {
  .fun-scoreboard-grid { grid-template-columns:minmax(0,1fr); }
}
:is(.lobby-table-card, .casino-room-card, .fun-utility-card, .lucky-shop-demo, .lucky-shop-product, .lucky-charms-card) {
  border-color:#9a7740;
  background-image:linear-gradient(135deg,#ffffff08,transparent 40%),linear-gradient(#0c3527,#061e17);
  box-shadow:inset 0 1px #ffedb32b,inset 0 -3px 10px #0006,0 5px 16px #0003;
}
:is(.poker-chat-head, .blackjack-leaderboard-title, .lobby-section-title, .players-heading) {
  color:var(--royale-cream);
  text-shadow:0 2px 2px #000,0 0 16px #dab77022;
}
:is(.controls, .casino-play-controls, .room-toolbar) {
  border-color:#96743e;
  background-image:linear-gradient(140deg,#ffffff07,transparent 40%),linear-gradient(#0b211a,#03110e);
  box-shadow:inset 0 1px #f3d59035,0 8px 24px #0005;
}
:is(.lobby-action,.blackjack-lobby-action,.fun-utility-card,.topbar button,.blackjack-topbar button,.room-toolbar button) {
  min-height:44px;
  border-color:#bd9754;
  box-shadow:inset 0 1px #ffe7ae45,inset 0 -3px 6px #0005;
}
@media (min-width:1024px) {
  :is(.topbar button,.blackjack-topbar button,.fun-lobby-header button,.lobby-action,.blackjack-lobby-action) { font-size:clamp(14px,1vw,17px); }
  #pokerScreen.poker-reference .topbar button { font-size:14px !important;line-height:1.2;min-height:44px; }
}

/* Rectangular, material-based rails; all themed character frames remain intact. */
body.poker-theme-active #pokerScreen.poker-reference .poker-table,
#pokerScreen.poker-reference .poker-table,
#blackjackScreen.blackjack-reference .blackjack-table.card-game-stage {
  isolation:isolate;
  background:var(--royale-leather) !important;
  border-radius:22px !important;
  box-shadow:inset 0 0 0 2px #e9c778,inset 0 0 0 5px #694b27,inset 0 0 0 6px #e9c77899,0 10px 25px #0009 !important;
}
#pokerScreen.poker-reference .poker-table::before,
#blackjackScreen.blackjack-reference .blackjack-table.card-game-stage::before {
  content:"";
  display:block !important;
  position:absolute;
  inset:5.5%;
  z-index:0;
  border:1px solid #d7ad59;
  border-radius:16px;
  background:var(--royale-velvet);
  box-shadow:0 0 0 4px #0009,0 0 0 5px #c998454d,inset 0 0 25px #0008;
  pointer-events:none;
}
#pokerScreen.poker-reference .poker-table::after,
#blackjackScreen.blackjack-reference .blackjack-table.card-game-stage::after {
  content:"";
  position:absolute;
  inset:1% 18%;
  z-index:2;
  background:url('/assets/royale/filigree.svg') center top / min(90%,220px) auto no-repeat,
             url('/assets/royale/filigree.svg') center bottom / min(90%,220px) auto no-repeat;
  pointer-events:none;
}
#pokerScreen.poker-reference .mobile-poker-content { z-index:3; }
#pokerScreen.poker-reference .table-center { z-index:4; }
#pokerScreen.poker-reference .poker-table > .table-inner { display:none !important; }
#pokerScreen.poker-reference .player-seat { z-index:5 !important; }
#pokerScreen.poker-reference .player-seat .player-box {
  background:radial-gradient(ellipse,#02120ff0,#02120fa8 65%,transparent 75%) !important;
  border:0 !important;
  box-shadow:none !important;
  border-radius:16px !important;
}
#pokerScreen.poker-reference .player-seat .player-box.is-turn .player-name { color:#fff4c9 !important; text-shadow:0 0 8px #62e5a7,0 1px 3px #000 !important; }
#pokerScreen.poker-reference .player-status { color:#9be1bb; text-shadow:0 1px 2px #000; }
#pokerScreen.poker-reference .player-seat .player-name {
  font-family:system-ui,sans-serif !important;
  font-weight:750 !important;
  white-space:normal !important;
  overflow-wrap:anywhere;
  text-shadow:0 1px 3px #000,0 0 6px #82e6ae66 !important;
}

@media (min-width:861px) {
  #pokerScreen.poker-reference .player-seat {
    left:var(--mobile-seat-left,50%) !important;
    top:var(--mobile-seat-top,50%) !important;
    transform:translate(-50%,-50%) !important;
    width:clamp(80px,8vw,120px) !important;
  }
  #pokerScreen.poker-reference .player-seat .player-box { min-height:0 !important;padding:3px !important; }
  #pokerScreen.poker-reference .player-name { font-size:14px !important;line-height:1.15 !important; }
  #pokerScreen.poker-reference .player-chips { font-size:13px !important; }
  #pokerScreen.poker-reference .player-cards:not(.showdown-cards) { display:none !important; }
  #pokerScreen.poker-reference .player-status { font-size:10px !important; }
  #pokerScreen.poker-reference .community-cards { justify-content:center;gap:5px !important; }
  #pokerScreen.poker-reference .community-cards .card,
  #pokerScreen.poker-reference .community-cards .card-slot { width:clamp(38px,4vw,64px) !important;height:auto !important;aspect-ratio:5/7; }
  #pokerScreen.poker-reference .your-hand .card,
  #pokerScreen.poker-reference .your-hand .card-slot { width:clamp(44px,4vw,60px) !important;height:auto !important;aspect-ratio:5/7; }
  #pokerScreen.poker-reference .your-hand { min-height:0 !important; }
}

/* Charms share reserved badge space, never the pot or action dock. */
#pokerScreen.poker-reference .player-seat .lucky-charm-attachment {
  --lucky-charm-size:32px !important;
  --lucky-charm-top:-7px !important;
  --lucky-charm-right:-16px !important;
}
#pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] .lucky-charm-attachment,
#pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"] .lucky-charm-attachment { --lucky-charm-right:0px !important; }
#pokerScreen.poker-reference .player-seat .lucky-charm-host .player-name { padding-right:34px; }
#pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="bottom"] .lucky-charm-attachment { --lucky-charm-top:-5px !important; }

@media (max-width:860px) {
  #pokerScreen.poker-reference .poker-table::after { background-size:130px auto,130px auto; }
  #pokerScreen.poker-reference .player-seat .player-name { font-size:12px !important;line-height:1.2 !important; }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"],
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] { width:112px !important; }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="left"] { left:11% !important; }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="right"] { left:89% !important; }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot="top"],
  #pokerScreen.poker-reference .player-seat.is-local-seat { width:154px !important; }
  #pokerScreen.poker-reference .player-seat[data-mobile-rail-slot] .player-box .player-name {
    font:750 12px/1.2 system-ui,sans-serif !important;
  }
  #pokerScreen.poker-reference .your-hand .card,
  #pokerScreen.poker-reference .your-hand .card-slot { width:54px !important; }
  #pokerScreen.poker-reference .poker-chat-head::before { content:"";width:24px;height:3px;border-radius:3px;background:#b49a61; }
}
@media (max-width:700px) {
  #casinoTableGameScreen .casino-play-controls {
    grid-template-columns:minmax(0,1fr) minmax(0,1fr) 44px;
    min-width:0;
    gap:6px;
  }
  #casinoTableGameScreen .casino-play-controls > * { min-width:0; }
  #casinoTableGameScreen .casino-play-controls .control-mascot-button { width:44px;height:44px; }
  #casinoTableGameScreen .casino-play-controls .control-mascot-button img { width:100%;height:100%;object-fit:contain; }
}
:is(.action-button, .primary-action, .secondary-action, .casino-play-button, .shake-button, .reveal-dice-button) {
  border: 1px solid var(--royale-gold);
  border-radius: 14px;
  box-shadow: inset 0 2px 0 #fff4, inset 0 -4px 8px #0005, 0 4px 0 #0005;
  font-weight: 750;
  text-shadow: 0 1px 2px #0009;
  transition: box-shadow 160ms ease, filter 160ms ease;
  touch-action: manipulation;
}
:is(.action-button, .primary-action, .secondary-action, .casino-play-button, .shake-button, .reveal-dice-button):enabled:active {
  box-shadow: inset 0 3px 8px #0008, 0 1px 0 #ffe5a533;
}
:is(.action-button, .primary-action, .secondary-action, .casino-play-button, .shake-button, .reveal-dice-button):focus-visible {
  outline: 3px solid var(--royale-focus);
  outline-offset: 3px;
}
:is(.action-button, .primary-action, .secondary-action, .casino-play-button):disabled {
  box-shadow: inset 0 1px 0 #ffffff12;
}
@media (hover: hover) {
  :is(.action-button, .primary-action, .secondary-action, .casino-play-button):enabled:hover { filter: brightness(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  :is(.action-button, .primary-action, .secondary-action, .casino-play-button, .shake-button, .reveal-dice-button) { transition: none; }
}
