/* Dead Man's Hand — Texas Hold'em.

   All art in images/ is generated procedurally by
   tools/generate-dead-mans-hand-art.py (deck, card back, chips, felt, emblem,
   dealer button, social card). No third-party or scanned assets.

   Site rules honoured here:
   - the page background belongs to cryptic.css. This file only paints the
     game surface, never body/html.
   - the custom skull/skeleton-hand cursors come from cryptic.css, so every
     interactive rule repeats the full /images/cursors stack — a bare
     `cursor: pointer` outranks the site rule on specificity.
   - cyan #00cccc/#00ffff chrome; the felt may use its own palette. */

:root {
  --dmh-line: #00c7d1;
  --dmh-line-soft: rgba(0, 199, 209, 0.34);
  --dmh-text: #d8f7f9;
  --dmh-muted: #7fa8ae;
  --dmh-accent: #00dfe8;
  --dmh-gold: #d8b45a;
  --dmh-panel: rgba(8, 16, 21, 0.9);
  --dmh-panel-lift: rgba(14, 26, 33, 0.94);
  --dmh-danger: #ff7a7a;
}

[hidden] { display: none !important; }

.game-shell {
  position: relative;
  max-width: 1180px;
  margin: 0 auto;
}

.mobile-only-notice {
  display: none;
  max-width: 520px;
  margin: 20px auto;
  padding: 16px;
  text-align: center;
  background: rgba(15, 15, 15, 0.92);
  border: 1px solid var(--dmh-line);
  border-radius: 8px;
  color: #e6e6e6;
}

/* ---------------------------------------------------------------- controls
   Default UA buttons/inputs are white slabs that fight the whole site. Every
   control on this page is restyled to the cyan-on-near-black chrome. */

.dmh-btn,
.action-bar button,
.lobby-panel button,
.dmh-topbar button,
.table-header button,
.dmh-modal-body button,
.open-table-row button {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dmh-text);
  padding: 9px 18px;
  border: 1px solid var(--dmh-line);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(0, 199, 209, 0.20) 0%, rgba(0, 199, 209, 0.05) 48%, rgba(0, 0, 0, 0.36) 100%),
    #0a171d;
  box-shadow: inset 0 1px 0 rgba(0, 255, 255, 0.18), 0 2px 10px rgba(0, 0, 0, 0.5);
  transition: box-shadow 0.16s ease, border-color 0.16s ease, transform 0.08s ease, color 0.16s ease;
  cursor:
    url('/images/cursors/hover.cur') 11 0,
    url('/images/cursors/hover.png') 11 0,
    pointer;
}

.dmh-btn:hover,
.action-bar button:hover,
.lobby-panel button:hover,
.dmh-topbar button:hover,
.table-header button:hover,
.dmh-modal-body button:hover,
.open-table-row button:hover {
  color: #eafeff;
  border-color: var(--dmh-accent);
  box-shadow: inset 0 1px 0 rgba(0, 255, 255, 0.3), 0 0 16px rgba(0, 223, 232, 0.42);
}

.dmh-btn:active,
.action-bar button:active,
.lobby-panel button:active { transform: translateY(1px); }

.dmh-btn:disabled,
.action-bar button:disabled,
.lobby-panel button:disabled {
  opacity: 0.4;
  box-shadow: none;
  border-color: var(--dmh-line-soft);
  cursor: not-allowed;
}

/* primary / destructive accents */
.dmh-btn-primary {
  border-color: var(--dmh-accent);
  background:
    linear-gradient(180deg, rgba(0, 223, 232, 0.34) 0%, rgba(0, 199, 209, 0.12) 50%, rgba(0, 0, 0, 0.34) 100%),
    #08222a;
  box-shadow: inset 0 1px 0 rgba(140, 255, 255, 0.34), 0 0 14px rgba(0, 223, 232, 0.28);
}
.dmh-btn-danger { border-color: rgba(255, 122, 122, 0.7); color: #ffd9d9; }
.dmh-btn-danger:hover { border-color: var(--dmh-danger); box-shadow: 0 0 16px rgba(255, 122, 122, 0.4); }

input[type="text"],
input[type="number"],
select {
  font-family: Georgia, serif;
  color: var(--dmh-text);
  background: rgba(3, 11, 15, 0.9);
  border: 1px solid var(--dmh-line-soft);
  border-radius: 6px;
  padding: 8px 11px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--dmh-accent);
  box-shadow: 0 0 0 1px rgba(0, 223, 232, 0.3), 0 0 14px rgba(0, 223, 232, 0.22);
}
input::placeholder { color: rgba(127, 168, 174, 0.6); }
input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}
select {
  cursor:
    url('/images/cursors/hover.cur') 11 0,
    url('/images/cursors/hover.png') 11 0,
    pointer;
}

/* ------------------------------------------------------------------ header */

.dmh-tagline {
  margin: -4px 0 18px;
  text-align: center;
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.76rem;
  color: rgba(0, 199, 209, 0.72);
}

.game-info {
  max-width: 900px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border: 1px solid var(--dmh-line);
  border-radius: 10px;
  background: var(--dmh-panel);
  box-shadow: 0 0 16px rgba(0, 255, 255, 0.13);
}
.game-info h3 { margin: 0 0 8px; color: var(--dmh-accent); }
.game-info ul { margin: 0; padding-left: 20px; text-align: left; }

/* ---------------------------------------------------------- chips + name bar */

.dmh-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 16px;
  margin: 0 auto 18px;
  padding: 12px 18px;
  max-width: 900px;
  border: 1px solid var(--dmh-line-soft);
  border-radius: 12px;
  background: var(--dmh-panel);
}
.dmh-topbar label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dmh-muted);
}
.dmh-topbar input[type="text"] { width: 170px; }
.dmh-field { display: flex; align-items: center; gap: 8px; }

.chips-readout {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border: 1px solid rgba(216, 180, 90, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(216, 180, 90, 0.12), rgba(0, 0, 0, 0.3));
}
.chips-readout img { width: 30px; height: 30px; }
.chips-readout .amount {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--dmh-gold);
  text-shadow: 0 0 10px rgba(216, 180, 90, 0.4);
}
.chips-readout .tag {
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dmh-muted);
}

/* ------------------------------------------------------------------- lobby */

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 820px) { .lobby-grid { grid-template-columns: 1fr; } }

.lobby-panel {
  position: relative;
  padding: 18px 20px 20px;
  border: 1px solid var(--dmh-line-soft);
  border-radius: 12px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(0, 223, 232, 0.09), transparent 62%),
    var(--dmh-panel-lift);
  box-shadow: 0 6px 26px rgba(0, 0, 0, 0.5);
}
.lobby-panel h3 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.02rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--dmh-accent);
  border-bottom: 1px solid var(--dmh-line-soft);
}
.lobby-panel label {
  display: block;
  margin: 12px 0 5px;
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dmh-muted);
}
.lobby-panel select,
.lobby-panel input[type="number"],
.lobby-panel input[type="text"] { width: 100%; }
.lobby-panel .row { display: flex; gap: 10px; margin-top: 16px; }
.lobby-panel .row > * { flex: 1; }

.stakes-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 14px 0 4px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--dmh-line-soft);
}
.stakes-strip img { width: 40px; height: 40px; filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6)); }
.stakes-strip .stakes-meta { text-align: left; line-height: 1.35; }
.stakes-strip .stakes-blinds {
  font-family: 'Cinzel', Georgia, serif;
  color: var(--dmh-text);
  font-size: 0.96rem;
}
.stakes-strip .stakes-range { font-size: 0.74rem; color: var(--dmh-muted); }

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--dmh-muted);
  text-transform: none;
  letter-spacing: 0;
}
.checkline input { accent-color: var(--dmh-accent); }

.open-table-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 9px 4px;
  border-bottom: 1px solid rgba(0, 199, 209, 0.16);
  font-size: 0.88rem;
}
.open-table-row:last-child { border-bottom: 0; }
.open-table-row button { padding: 5px 14px; font-size: 0.74rem; }
.open-table-row .ot-name { color: var(--dmh-text); }
.open-table-row .ot-meta { color: var(--dmh-muted); font-size: 0.78rem; }

.message { min-height: 1.4em; margin-top: 12px; text-align: center; color: var(--dmh-muted); }
.message.error { color: var(--dmh-danger); }
.empty-note { padding: 10px 2px; font-style: italic; color: var(--dmh-muted); font-size: 0.85rem; }

/* -------------------------------------------------------------- table view */

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.table-code {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  color: var(--dmh-accent);
  text-shadow: 0 0 12px rgba(0, 223, 232, 0.45);
}
.table-title { color: var(--dmh-muted); font-size: 0.9rem; }

/* The felt: rail, cloth, vignette, emblem watermark. */
.felt-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 430px;
  padding: 18px;
  border-radius: 50% / 32%;
  background:
    linear-gradient(180deg, #2a1d10 0%, #150e07 100%);
  box-shadow:
    0 0 0 2px rgba(216, 180, 90, 0.22),
    0 18px 44px rgba(0, 0, 0, 0.72);
}

.felt {
  position: absolute;
  inset: 16px;
  border-radius: 50% / 34%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(0, 223, 232, 0.10), transparent 58%),
    radial-gradient(ellipse at 50% 50%, #12503a 0%, #0b3326 52%, #071d16 100%),
    url('/minigames/dead-mans-hand/images/felt.png');
  background-blend-mode: screen, normal, overlay;
  background-size: cover, cover, 320px 320px;
  box-shadow:
    inset 0 0 70px rgba(0, 0, 0, 0.66),
    inset 0 0 0 2px rgba(0, 199, 209, 0.16);
  overflow: visible;
}

.felt::after {  /* emblem watermark, centred and non-interactive */
  content: '';
  position: absolute;
  left: 50%;
  top: 46%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%);
  background: url('/minigames/dead-mans-hand/images/table-emblem.png') center / contain no-repeat;
  opacity: 0.5;
  pointer-events: none;
}

.felt-center {
  position: absolute;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 2;
}

.pot-readout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 4px 16px 4px 6px;
  border-radius: 999px;
  border: 1px solid rgba(216, 180, 90, 0.4);
  background: rgba(0, 0, 0, 0.5);
}
.pot-readout img { width: 26px; height: 26px; }
.pot-readout .label {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dmh-muted);
}
.pot-readout .value {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--dmh-gold);
}

.board-cards { display: flex; justify-content: center; gap: 7px; min-height: 96px; }
.board-card {
  position: relative;
  width: 68px;
  border-radius: 5px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.66);
  /* Backwards keeps the pre-deal pose during staggered delays, then releases
     transform so hover/focus magnification can take over. */
  animation: dmh-deal 0.32s ease-out backwards;
  cursor: zoom-in;
  transform-origin: bottom center;
  transition: transform 0.18s ease, filter 0.18s ease;
}
.board-card:hover,
.board-card:focus {
  z-index: 12;
  transform: translateY(-10px) scale(1.45);
  filter: drop-shadow(0 9px 12px rgba(0, 0, 0, 0.72));
  outline: none;
}
.board-card:focus-visible {
  outline: 2px solid var(--dmh-accent);
  outline-offset: 3px;
}
@keyframes dmh-deal {
  from { opacity: 0; transform: translateY(-16px) scale(0.9); }
  to   { opacity: 1; transform: none; }
}

/* Seats ring the felt; JS sets --x/--y per seat from an ellipse. */
.dmh-seat {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -50%);
  width: 158px;
  padding: 8px 10px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 199, 209, 0.34);
  background: linear-gradient(180deg, rgba(10, 24, 30, 0.95), rgba(4, 12, 16, 0.95));
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  text-align: center;
  z-index: 3;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.dmh-seat.is-you { border-color: rgba(216, 180, 90, 0.72); }
.dmh-seat.is-actor {
  border-color: var(--dmh-accent);
  box-shadow: 0 0 0 1px rgba(0, 223, 232, 0.5), 0 0 24px rgba(0, 223, 232, 0.5);
}
.dmh-seat.folded { opacity: 0.42; }

.seat-name {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  color: var(--dmh-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bot-badge {
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  background: rgba(0, 199, 209, 0.18);
  color: var(--dmh-accent);
  vertical-align: middle;
}

.seat-hole { display: flex; justify-content: center; gap: 4px; min-height: 62px; align-items: center; margin: 5px 0; }
.seat-hole img { width: 44px; border-radius: 4px; box-shadow: 0 3px 9px rgba(0, 0, 0, 0.6); }
.seat-hole .muck { width: 44px; height: 62px; border-radius: 4px; opacity: 0.25; }

/* The local hand is intentionally compact at rest so the table stays legible.
   Hovering (or keyboard/touch focus) brings it up to community-card size. */
.dmh-seat.is-you .seat-hole[tabindex] {
  position: relative;
  z-index: 6;
  cursor: zoom-in;
  transform-origin: bottom center;
  transition: transform 0.18s ease, filter 0.18s ease;
  outline: none;
}
.dmh-seat.is-you .seat-hole[tabindex]:hover,
.dmh-seat.is-you .seat-hole[tabindex]:focus {
  z-index: 12;
  transform: translateY(-8px) scale(1.55);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.72));
}
.dmh-seat.is-you .seat-hole[tabindex]:focus-visible {
  outline: 2px solid var(--dmh-accent);
  outline-offset: 4px;
  border-radius: 5px;
}
.dmh-seat.is-you:has(.seat-hole[tabindex]:hover),
.dmh-seat.is-you:has(.seat-hole[tabindex]:focus) {
  z-index: 10;
}
@media (prefers-reduced-motion: reduce) {
  .dmh-seat.is-you .seat-hole[tabindex],
  .board-card { transition: none; }
}

.seat-stack {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.86rem;
  color: var(--dmh-gold);
  font-family: 'Cinzel', Georgia, serif;
}
.seat-stack img { width: 20px; height: 20px; }
.seat-tag { margin-top: 3px; font-size: 0.72rem; color: var(--dmh-muted); }
.seat-tag.folded-tag { color: var(--dmh-danger); }
.seat-hand-label { margin-top: 2px; font-size: 0.74rem; font-style: italic; color: var(--dmh-accent); }

/* countdown under the acting seat */
.seat-timer { height: 3px; margin-top: 6px; border-radius: 2px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.seat-timer span { display: block; height: 100%; background: var(--dmh-accent); transition: width 0.9s linear; }
.seat-turn-label {
  margin-top: 4px;
  color: #eafeff;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
}

/* a seat's live bet, pushed toward the middle of the felt */
.dmh-bet {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(216, 180, 90, 0.36);
  font-size: 0.78rem;
  color: var(--dmh-gold);
  z-index: 2;
  white-space: nowrap;
}
.dmh-bet img { width: 18px; height: 18px; }

.dealer-button {
  position: absolute;
  left: var(--dx);
  top: var(--dy);
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  z-index: 4;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.7));
}

/* ------------------------------------------------------------- action zone */

.turn-status {
  min-height: 1.4em;
  margin: 14px auto 0;
  text-align: center;
  color: var(--dmh-gold);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}
.table-message { margin-top: 4px; }

.hand-hint {
  margin: 14px 0 6px;
  text-align: center;
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.08em;
  color: var(--dmh-accent);
  min-height: 1.3em;
}

.result-banner {
  max-width: 420px;
  margin: 10px auto;
  padding: 10px 16px;
  text-align: center;
  border-radius: 10px;
  border: 1px solid var(--dmh-gold);
  background: linear-gradient(180deg, rgba(216, 180, 90, 0.18), rgba(0, 0, 0, 0.45));
  color: #f4e6c2;
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.06em;
  box-shadow: 0 0 22px rgba(216, 180, 90, 0.24);
  animation: dmh-rise 0.3s ease-out both;
}
@keyframes dmh-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  margin: 14px auto 4px;
  padding: 12px 16px;
  max-width: 760px;
  border: 1px solid var(--dmh-line-soft);
  border-radius: 12px;
  background: var(--dmh-panel);
}
.action-bar input[type="number"] { width: 116px; text-align: center; }
.raise-group { display: flex; align-items: center; gap: 8px; }
.raise-group input[type="range"] { width: 150px; accent-color: var(--dmh-accent); }

.waiting-note {
  margin: 16px auto 4px;
  text-align: center;
  font-style: italic;
  color: var(--dmh-muted);
}

/* -------------------------------------------------------------- modal + lb */

.dmh-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  z-index: 100;
}
.dmh-modal-body {
  max-width: 440px;
  padding: 24px 26px;
  border: 1px solid var(--dmh-accent);
  border-radius: 12px;
  background: linear-gradient(180deg, #0d1b21, #060d11);
  box-shadow: 0 0 40px rgba(0, 223, 232, 0.25);
  text-align: center;
}
.dmh-modal-body h3 {
  margin-top: 0;
  font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dmh-accent);
}
.recovery-code {
  display: block;
  margin: 16px 0;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 1.22rem;
  letter-spacing: 0.14em;
  color: var(--dmh-gold);
  border: 1px dashed rgba(216, 180, 90, 0.6);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.42);
  word-break: break-all;
}

.dmh-divider {
  max-width: 860px;
  height: 1px;
  margin: 34px auto 0;
  border: 0;
  background: linear-gradient(90deg,
    transparent 0%, rgba(0, 204, 204, 0.55) 18%,
    rgba(0, 204, 204, 0.55) 82%, transparent 100%);
}

#lbTable {
  width: 100%;
  border-collapse: collapse;
  background: rgba(5, 17, 22, 0.86);
  border: 1px solid #008b8b;
}
#lbTable th,
#lbTable td {
  border: 1px solid rgba(0, 139, 139, 0.75);
  padding: 8px 6px;
  font-size: 0.92rem;
}
#lbTable th { background: rgba(0, 204, 204, 0.14); color: #aefefe; }
.empty-cell { font-style: italic; color: var(--dmh-muted); }

@media (max-width: 780px) {
  .mobile-only-notice { display: block; }
  .dmh-topbar,
  #lobby,
  #tableView,
  .dmh-divider,
  .leaderboard { display: none !important; }
}

@media (max-width: 1100px) {
  .dmh-topbar { max-width: 760px; }
  .dmh-topbar .dmh-field { flex: 1 1 280px; justify-content: center; }
  .dmh-topbar .dmh-field input[type="text"] { min-width: 0; flex: 1; }
}
