/* ==========================================================================
   DECKHAND · Interactive 9-Max Table Demo Layout
   ========================================================================== */

@layer components {
  .demo-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
  }

  .demo-stage {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px max(24px, env(safe-area-inset-right, 0px)) max(224px, calc(204px + env(safe-area-inset-bottom, 0px))) max(24px, env(safe-area-inset-left, 0px));
    overflow: hidden;
  }

  .demo-ambient-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
  }

  .demo-ambient-glow::before {
    content: "";
    position: absolute;
    top: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: 860px;
    height: 320px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.06);
    filter: blur(110px);
  }

  .table-canvas {
    position: relative;
    width: 100%;
    max-width: 1260px;
    margin-inline: auto;
    padding: 18px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    user-select: none;
  }

  .poker-table-oval {
    position: relative;
    width: 100%;
    max-width: 1180px;
    aspect-ratio: 2.15 / 1;
    min-height: 540px;
    border-radius: 260px;
    padding: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .table-inlay-outer {
    position: absolute;
    inset: 20px;
    border-radius: 238px;
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: inset 0 0 60px rgba(8, 14, 24, 0.92);
    pointer-events: none;
  }

  .table-inlay-inner {
    position: absolute;
    inset: 60px;
    border-radius: 192px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    pointer-events: none;
  }

  .table-corner-hud {
    position: absolute;
    top: 14px;
    left: max(20px, env(safe-area-inset-left, 0px));
    z-index: 25;
  }

  @media (max-width: 1480px) {
    .table-corner-hud {
      position: static;
      align-self: flex-start;
      margin-bottom: 10px;
    }
  }

  .center-sanctuary {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
  }

  .split-pots-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  /* 9-Max Elliptical Seat Orbit */
  .seat-slot {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 12;
  }

  .seat-slot--1 { top: 12px; left: 28%; transform: translateX(-50%); }
  .seat-slot--2 { top: 10px; left: 50%; transform: translateX(-50%); z-index: 15; }
  .seat-slot--3 { top: 12px; left: 72%; transform: translateX(-50%); }
  .seat-slot--4 { top: 27%; right: 20px; }
  .seat-slot--5 { bottom: 24%; right: 20px; }
  .seat-slot--6 { bottom: 10px; left: 68%; transform: translateX(-50%); z-index: 20; }
  .seat-slot--7 { bottom: 12px; left: 32%; transform: translateX(-50%); }
  .seat-slot--8 { bottom: 24%; left: 20px; }
  .seat-slot--9 { top: 27%; left: 20px; }

  .seat-holecards {
    display: flex;
    gap: 4px;
    margin-block-end: 6px;
  }

  /* Inline Seat Audit Popover */
  .seat-audit-panel {
    width: 236px;
    padding: 12px;
    border-radius: 12px;
    background: #0b0f17;
    border: 1.5px solid var(--dh-gold);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.9), 0 0 22px rgba(212, 175, 55, 0.22);
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-family: var(--dh-font-mono);
  }

  .seat-audit-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--dh-gold-bright);
  }

  .seat-audit-close {
    min-inline-size: var(--dh-touch-min);
    min-block-size: var(--dh-touch-min);
    margin: -10px -8px -10px 0;
    padding-inline: 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--dh-text-muted);
    font-family: var(--dh-font-mono);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .seat-audit-close:active:not(:disabled) {
    color: var(--dh-text-strong);
    background: rgba(255, 255, 255, 0.08);
  }

  .seat-audit-input {
    width: 100%;
    min-block-size: var(--dh-touch-min);
    padding-inline: 10px;
    border-radius: 8px;
    background: var(--dh-surface-trough);
    border: 1px solid var(--dh-border-trough);
    color: var(--dh-text-strong);
    font-family: var(--dh-font-mono);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
  }

  .seat-audit-actions {
    display: flex;
    gap: var(--dh-touch-gap);
  }

  .seat-audit-btn {
    flex: 1;
    min-inline-size: var(--dh-touch-min);
    min-block-size: var(--dh-touch-min);
    border-radius: 8px;
    border: 1px solid var(--dh-border-trough);
    background: #141c29;
    color: var(--dh-text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--dh-dur-fast) var(--dh-ease), background var(--dh-dur-fast) var(--dh-ease);
  }

  .seat-audit-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.97);
  }

  .seat-audit-btn--ok {
    background: var(--dh-gold);
    border-color: var(--dh-gold);
    color: var(--dh-text-on-gold);
  }

  /* Fixed Bottom Dock Host */
  .demo-dock-footer {
    position: fixed;
    inset-inline: 0;
    bottom: var(--dh-safe-bottom-lift);
    z-index: 40;
    padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
  }

  .demo-dock-footer > * {
    pointer-events: auto;
  }

  .demo-toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    padding: 8px 16px;
    border-radius: 999px;
    background: rgba(11, 14, 20, 0.96);
    border: 1px solid rgba(212, 175, 55, 0.55);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.85), 0 0 18px rgba(212, 175, 55, 0.2);
    font-family: var(--dh-font-mono);
    font-size: 12px;
    color: var(--dh-gold-bright);
    pointer-events: none;
    transition: opacity 200ms var(--dh-ease), transform 200ms var(--dh-ease);
  }

  .demo-toast.is-hidden-toast {
    opacity: 0;
    transform: translate(-50%, -8px);
  }

  .showdown-pots-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .showdown-pot-box {
    height: var(--dh-key-height);
    padding: 4px 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
  }

  .showdown-pot-sub {
    font-family: var(--dh-font-mono);
    font-size: 10px;
    color: var(--dh-text-subtle);
  }

  .showdown-pot-win {
    font-family: var(--dh-font-mono);
    font-size: 11px;
    font-weight: 700;
    color: var(--dh-text-primary);
  }
}

@layer components {
  .hand-number { font-size: 12px; font-weight: 700; }
  .undo-button { border: 1px solid #1b2538; }
  .card-tilt-left { transform: rotate(-1deg); }
  .card-tilt-right { transform: rotate(1deg); }
  .river-plus { font-size: 18px; line-height: 1; }
  .river-label { font-size: 9px; letter-spacing: 0.08em; }
  .seat-card--folded .seat-name { text-decoration: line-through; color: var(--dh-text-subtle); }
  :is(.seat-card--hero, .seat-card--winner) .seat-name { color: #fff; }
  .empty-plus { font-size: 15px; font-weight: 700; }
  .empty-label { font-size: 9px; letter-spacing: 0.1em; font-weight: 700; }
  .empty-caption { font-size: 8px; color: var(--dh-text-dim); }
  .seat-card--interactive { text-align: inherit; }
  .demo-dock-footer .triton-dock-shell--wide > button { min-width: 184px; }
  .dock-icon { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .dock-icon--confirm { stroke-width: 2.2; }
}
