/* Guandan theme — single source for Web (and mirrored to Guandan.UI/wwwroot) */

/* PWA / standalone: kill white letterboxing around safe areas & splash */
html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  min-height: 100dvh;
  background-color: #163828;
  background:
    radial-gradient(ellipse at 20% 0%, #2a6b4e 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, #0f2a1c 0%, transparent 45%),
    linear-gradient(160deg, #1e4d3a 0%, #163828 100%);
  color: #f3efe6;
  overscroll-behavior: none;
}

.gd-page {
  --ink: #1a2332;
  --felt: #1e4d3a;
  --felt-deep: #163828;
  --cream: #f3efe6;
  --accent: #c4a35a;
  --danger: #b33b3b;
  --team-a: #3d9ecd;
  --team-b: #e08a4c;
  --success: #7dcea0;
  --felt-glow: rgba(61, 158, 205, 0.12);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--cream);
  background: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0.75rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  box-sizing: border-box;
  position: relative;
  overflow-x: hidden;
}

.gd-page.table-page {
  display: flex;
  flex-direction: column;
  max-width: 56rem;
  margin: 0 auto;
}

.gd-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  letter-spacing: 0.04em;
  font-weight: 700;
}

.gd-sub {
  margin: 0.35rem 0 0.85rem;
  opacity: 0.85;
  font-size: 0.9rem;
}

.gd-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.85rem;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  font-size: 0.85rem;
}

/* Always-visible level cards for both partnerships */
.gd-level-hud {
  display: flex;
  align-items: stretch;
  gap: 0.3rem;
}

.gd-level-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.3rem 0.2rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.gd-level-chip-label {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.8;
  white-space: nowrap;
}

.gd-level-chip-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.6rem;
  padding: 0 0.25rem;
  border-radius: 5px;
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  color: #fff;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.gd-level-chip.mine .gd-level-chip-rank { background: #2f6fd0; }
.gd-level-chip.theirs .gd-level-chip-rank { background: #b3452f; }
.gd-level-chip.mine { border-color: rgba(47, 111, 208, 0.45); }
.gd-level-chip.theirs { border-color: rgba(179, 69, 47, 0.45); }

.gd-status-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  opacity: 0.85;
  min-height: 1.25rem;
}

.gd-level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.45rem;
  border-radius: 8px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  font-size: 1.05rem;
}

.gd-team {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-weight: 600;
}
.gd-team.a { background: rgba(61, 158, 205, 0.25); border-left: 3px solid var(--team-a); }
.gd-team.b { background: rgba(224, 138, 76, 0.25); border-left: 3px solid var(--team-b); }

.gd-countdown {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--accent);
}

/* —— Playing cards —— */
.gd-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: flex-end;
}

.gd-cards.fan {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: visible;
  padding: 0.65rem 0.25rem 0.35rem;
  gap: 0;
  -webkit-overflow-scrolling: touch;
}

.gd-cards.fan .gd-pcard {
  margin-left: -1.15rem;
  flex-shrink: 0;
  /* Keep DOM order stacking — never lift selected cards above neighbors */
  z-index: auto;
}
.gd-cards.fan .gd-pcard:first-child { margin-left: 0; }

/* Rank columns: same-rank cards stack upward so counts read at a glance */
.gd-cards.columns {
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  /* overflow-x alone would force overflow-y to auto and scroll on focus when a card lifts */
  overflow-x: auto;
  overflow-y: hidden;
  overflow-anchor: none;
  /* Compact peek — rank+suit share one row, so tall stack offset is unnecessary */
  padding: 1.85rem 0.35rem 0.3rem;
  -webkit-overflow-scrolling: touch;
}

.gd-rank-col {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  isolation: isolate;
  --card-h: 4.1rem;
  /* Peek ≈ one corner row (K♥). Floor so tall stacks still show suit; no extra height. */
  --stack: max(1.15rem, min(1.3rem, calc(5.5rem / var(--n, 1))));
  margin-left: -0.95rem;
}
.gd-cards.columns > .gd-rank-col:first-child {
  margin-left: 0;
}

.gd-rank-col .gd-pcard:not(:last-child) {
  margin-bottom: calc(var(--stack) - var(--card-h));
}
/* Same box for interactive buttons and disabled (readonly) buttons — avoid min-height:auto expanding the column */
.gd-rank-col .gd-pcard {
  flex: 0 0 auto;
  min-height: 0;
  box-sizing: border-box;
}

.gd-cards.columns .gd-pcard:not(.mini) {
  width: 2.95rem;
  height: var(--card-h);
}

.gd-cards.columns.mini-hand .gd-rank-col {
  --card-h: 2.55rem;
  --stack: max(0.95rem, min(1.1rem, calc(4rem / var(--n, 1))));
  margin-left: -0.7rem;
}

/* Selected: modest lift only — do not change stacking order (z-index) */
.gd-cards.columns .gd-pcard.sel,
.gd-cards.columns .gd-pcard.sel:hover,
.gd-cards.columns .gd-pcard.interactive.sel:hover {
  transform: translateY(-0.75rem);
}

.gd-cards.columns .gd-pcard.interactive:hover:not(.sel) {
  transform: translateY(-0.25rem);
}

/* 级/配 tag sits under the horizontal rank+suit pair (大掼蛋) */
.gd-cards.columns .gd-pcard:not(.mini) .gd-pcard-tag {
  top: 1.2rem;
  left: 0.14rem;
  right: auto;
}

.gd-rank-col-count {
  position: absolute;
  top: -1.05rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  padding: 0.05rem 0.32rem;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.gd-rank-col-count:hover,
.gd-rank-col-count:focus-visible {
  background: var(--accent);
  color: #10251b;
}

.gd-pcard {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 2.65rem;
  height: 3.7rem;
  padding: 0.28rem 0.2rem;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: linear-gradient(165deg, #fffcf7 0%, #f0ebe3 100%);
  color: #1a1a1a;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  line-height: 1.1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  transition: transform 0.05s ease-out, box-shadow 0.05s ease-out, outline-color 0.05s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button.gd-pcard {
  cursor: pointer;
  appearance: none;
  margin: 0;
  font: inherit;
}
button.gd-pcard:not(.interactive) {
  cursor: default;
  pointer-events: none;
}

/* Hover must not override selected raise (same specificity otherwise) */
.gd-pcard.interactive:hover:not(.sel) { transform: translateY(-4px); }
.gd-pcard.sel,
.gd-pcard.sel:hover,
.gd-pcard.interactive.sel:hover {
  transform: translateY(-12px);
  outline: 2px solid var(--accent);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  /* Stay in natural stack — do not raise z-index */
  z-index: auto;
}
.gd-pcard.hint:not(.sel) {
  outline: 2px solid rgba(125, 206, 160, 0.85);
  outline-offset: 1px;
  box-shadow: 0 0 10px rgba(125, 206, 160, 0.35);
}

.gd-share-dialog {
  max-width: 26rem;
}
.gd-share-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  margin-top: 0.65rem;
}
.gd-share-qr {
  border-radius: 10px;
  background: #fff;
  padding: 0.35rem;
}
.gd-share-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 10rem;
}
.gd-share-pw {
  letter-spacing: 0.12em;
  color: var(--accent);
}
.gd-share-url {
  font-size: 0.75rem;
  word-break: break-all;
}

.gd-match-end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.85rem;
}
.gd-highlight-sub {
  margin: 0.25rem 0 0;
  opacity: 0.9;
  font-size: 0.95rem;
}
.gd-moment-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(196, 163, 90, 0.55);
  color: #fff8e7;
  font-weight: 700;
  letter-spacing: 0.04em;
  pointer-events: none;
  animation: gd-moment-banner-in 0.35s ease;
  white-space: normal;
  max-width: min(90vw, 28rem);
  text-align: center;
  line-height: 1.35;
}
@keyframes gd-moment-banner-in {
  from { opacity: 0; transform: translate(-50%, calc(-50% - 10px)) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.gd-emote-bar {
  display: inline-flex;
  gap: 0.15rem;
  align-items: center;
}
.gd-emote-bar-inline {
  margin-left: 0.25rem;
}
.gd-emote-btn {
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.gd-emote-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}
.gd-emote-bubble {
  position: absolute;
  right: -0.35rem;
  top: -0.45rem;
  z-index: 3;
  font-size: 1.15rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  animation: gd-badge-pop 0.35s ease;
  pointer-events: none;
}
.gd-seat-slot.bottom {
  position: relative;
}
.gd-emote-bubble.gd-emote-bubble-self {
  right: auto;
  left: 50%;
  top: auto;
  bottom: calc(100% - 0.15rem);
  transform: translateX(-50%);
  font-size: 1.85rem;
  z-index: 12;
  animation: gd-emote-self-pop 0.4s ease;
}
@keyframes gd-emote-self-pop {
  from { opacity: 0; transform: translateX(-50%) translateY(8px) scale(0.7); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.gd-float-coach {
  margin: 0;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff8f5;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.gd-float-coach.on {
  border-color: rgba(125, 206, 160, 0.65);
  color: #c8f0d8;
}
.gd-pcard.interactive.sel:hover {
  transform: translateY(-12px);
  outline: 2px solid var(--accent);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.28);
  /* Stay in natural stack — do not raise z-index */
  z-index: auto;
}

.gd-pcard.mini {
  width: 1.85rem;
  height: 2.55rem;
  font-size: 0.7rem;
  padding: 0.15rem;
}

.gd-pcard.red { color: #c01830; }
.gd-pcard.black { color: #1a1a1a; }
.gd-pcard.joker { color: #1a1a1a; }
.gd-pcard.joker.big-joker { color: #c01830; }

.gd-pcard.wild {
  box-shadow: inset 0 0 0 2px #e85d4c;
}
.gd-pcard.level {
  box-shadow: inset 0 0 0 1.5px rgba(47, 158, 95, 0.75), 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Corner index: rank over a small suit, top-left */
.gd-pcard-rank { font-size: 1.02rem; }
.gd-pcard-rank.wide {
  font-size: 0.78rem;
  letter-spacing: -0.12em;
  transform: scaleX(0.92);
  transform-origin: center top;
}
.gd-pcard.mini .gd-pcard-rank { font-size: 0.76rem; }
.gd-pcard.mini .gd-pcard-rank.wide { font-size: 0.58rem; letter-spacing: -0.14em; }
.gd-pcard-suit { font-size: 0.72rem; margin: 0; line-height: 1; }
.gd-pcard.mini .gd-pcard-suit { font-size: 0.55rem; }

/* Large suit pip anchored to the lower half of the face */
.gd-pcard-pip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06rem;
  text-align: center;
  font-size: 1.62rem;
  line-height: 1;
  opacity: 0.95;
  pointer-events: none;
}
.gd-pcard.mini .gd-pcard-pip { font-size: 1rem; bottom: 0.02rem; }
.gd-cards.columns .gd-pcard:not(.mini) .gd-pcard-pip { font-size: 1.78rem; }

/* 级牌 / 逢人配 corner tag */
.gd-pcard-tag {
  position: absolute;
  top: 0.1rem;
  right: 0.1rem;
  min-width: 0.82rem;
  padding: 0 0.1rem;
  border-radius: 3px;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  color: #fff;
  letter-spacing: 0;
}
.gd-pcard-tag.level { background: #2f9e5f; }
.gd-pcard-tag.wild { background: #d8422f; }
.gd-pcard.mini .gd-pcard-tag { font-size: 0.44rem; min-width: 0.66rem; }

/* Jokers: vertical JOKER lettering — sized to fit all 5 letters on the card face */
.gd-pcard-joker-text {
  position: absolute;
  top: 0.12rem;
  left: 0.14rem;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 0.42rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  max-height: calc(100% - 0.35rem);
}
.gd-pcard.mini .gd-pcard-joker-text { font-size: 0.32rem; top: 0.08rem; left: 0.1rem; }
.gd-pcard-pip.joker { font-size: 1.15rem; }
.gd-pcard.mini .gd-pcard-pip.joker { font-size: 0.8rem; }

.gd-pcard.back {
  background: linear-gradient(135deg, #2a5080 0%, #1a3355 50%, #2a5080 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.gd-pcard-back-pattern {
  display: block;
  width: 70%;
  height: 70%;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 4px;
  background:
    repeating-linear-gradient(-45deg, transparent, transparent 3px, rgba(255,255,255,0.08) 3px, rgba(255,255,255,0.08) 6px);
}

/* legacy chip fallback */
.gd-card {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: #f7f4ee;
  color: #222;
  cursor: pointer;
}
.gd-card.red { color: #b01030; }
.gd-card.joker { color: #6b3fa0; font-weight: 700; }
.gd-card.sel { outline: 2px solid var(--accent); transform: translateY(-3px); }

/* —— Compass table —— */
.gd-table-stage {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: minmax(4.5rem, 1fr) minmax(10rem, 2.4fr) minmax(4.5rem, 1fr);
  grid-template-rows: auto minmax(10rem, 1fr) auto;
  grid-template-areas:
    ".    top  ."
    "left mid  right"
    "bot  bot  bot";
  gap: 0.4rem 0.5rem;
  min-height: 22rem;
  margin-bottom: 0.5rem;
}

.gd-seat-slot { min-width: 0; }
.gd-seat-slot.top {
  grid-area: top;
  justify-self: center;
  width: 100%;
  max-width: 16rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gd-seat-slot.left,
.gd-seat-slot.right {
  align-self: center;
  justify-self: center;
  width: 100%;
  max-width: 9rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.gd-seat-slot.left { grid-area: left; }
.gd-seat-slot.right { grid-area: right; }
/* Reserved under chip — toward table center so sides stay stable */
.gd-seat-timer-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.05rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.gd-seat-slot.left .gd-seat-timer-slot { align-self: flex-end; padding-right: 0.1rem; }
.gd-seat-slot.right .gd-seat-timer-slot { align-self: flex-start; padding-left: 0.1rem; }
.gd-seat-slot.bottom {
  grid-area: bot;
  position: relative;
  /* Reserve action-bar height so showing/hiding play controls does not shove the felt */
  min-height: 5.5rem;
}

.gd-center-play {
  grid-area: mid;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 9rem;
  padding: 0.75rem;
  border-radius: 50% / 42%;
  /* Felt weave over the cloth, wood grain painted into the border box */
  border: 0.45rem solid transparent;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.016) 0 2px, transparent 2px 4px) padding-box,
    radial-gradient(ellipse at 50% 42%, #2f6b4f 0%, #17402f 72%) padding-box,
    linear-gradient(155deg, #7d5626 0%, #472f16 45%, #8b6231 100%) border-box;
  isolation: isolate;
  box-shadow:
    inset 0 0 46px rgba(0, 0, 0, 0.34),
    0 6px 22px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* My-turn timer sits left of the hand (same band), not in the center felt */
.gd-hand-band {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
}
/* Keep left timer slot so appearing/disappearing countdown does not reflow the hand */
.gd-hand-band::before {
  content: "";
  flex: 0 0 2.2rem;
  width: 2.2rem;
  height: 2.2rem;
  visibility: hidden;
  pointer-events: none;
}
.gd-hand-band:has(.gd-hand-timer)::before {
  display: none;
}
.gd-hand-band .gd-my-hand {
  flex: 1 1 auto;
  min-width: 0;
}
.gd-partner-hand-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.15rem);
  transform: translateX(-50%);
  z-index: 3;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff8e7;
  background: rgba(12, 40, 28, 0.82);
  border: 1px solid rgba(196, 163, 90, 0.4);
  pointer-events: none;
  white-space: nowrap;
}
.gd-countdown-ring.gd-hand-timer {
  flex-shrink: 0;
  align-self: center;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.78rem;
  margin: 0 0 0 0.1rem;
}
.gd-countdown-ring.gd-hand-timer::before {
  width: 1.7rem;
  height: 1.7rem;
}

/* Brand wordmark watermark under the trick (elliptical soft mark) */
.gd-center-play::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(88%, 18rem);
  height: min(58%, 8.5rem);
  transform: translate(-50%, -50%);
  z-index: -1;
  background: url("brand/shiguang-wordmark.png") center / 78% auto no-repeat;
  opacity: 0.16;
  pointer-events: none;
  filter: brightness(1.12) saturate(0.9);
  border-radius: 50%;
  clip-path: ellipse(50% 50% at 50% 50%);
  -webkit-mask-image: radial-gradient(ellipse 72% 62% at 50% 50%, #000 42%, transparent 78%);
  mask-image: radial-gradient(ellipse 72% 62% at 50% 50%, #000 42%, transparent 78%);
}

/* Played cards overlap and sit at slight angles, like cards tossed on cloth */
.gd-center-play .gd-cards {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 0;
}
/* Bigger than a thumbnail so the trick reads from across the table */
.gd-center-play .gd-cards .gd-pcard.mini {
  width: 2.15rem;
  height: 3rem;
}
.gd-center-play .gd-cards .gd-pcard.mini .gd-pcard-pip { font-size: 1.15rem; }
.gd-center-play .gd-cards .gd-pcard { margin-left: -0.28rem; }
.gd-center-play .gd-cards .gd-pcard:first-child { margin-left: 0; }
.gd-center-play .gd-cards .gd-pcard:nth-child(odd) { rotate: -1.6deg; }
.gd-center-play .gd-cards .gd-pcard:nth-child(even) { rotate: 1.6deg; translate: 0 2px; }

.gd-seat-chip {
  position: relative;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.45rem 0.55rem;
  text-align: center;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.gd-seat-chip.turn {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.4);
}

/* Trick owner (= who played the cards on the felt) — cream glow, distinct from gold "turn" */
.gd-seat-chip.trick-owner {
  border-color: rgba(243, 239, 230, 0.75);
  box-shadow:
    0 0 0 2px rgba(243, 239, 230, 0.35),
    0 0 14px rgba(243, 239, 230, 0.28);
}
.gd-seat-chip.trick-owner.turn {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px rgba(196, 163, 90, 0.45),
    0 0 12px rgba(243, 239, 230, 0.22);
}
.gd-seat-chip.trick-owner-pulse,
.gd-seat-slot.bottom.trick-owner-pulse .gd-my-hand {
  animation: gd-trick-owner-pulse 0.55s ease-out;
}
.gd-seat-slot.bottom.trick-owner .gd-my-hand {
  box-shadow:
    0 0 0 2px rgba(243, 239, 230, 0.4),
    0 0 16px rgba(243, 239, 230, 0.22);
  border-radius: 12px;
}
@keyframes gd-trick-owner-pulse {
  0% { box-shadow: 0 0 0 0 rgba(243, 239, 230, 0.7), 0 0 0 rgba(243, 239, 230, 0); }
  70% { box-shadow: 0 0 0 6px rgba(243, 239, 230, 0.15), 0 0 22px rgba(243, 239, 230, 0.4); }
  100% { box-shadow: 0 0 0 2px rgba(243, 239, 230, 0.35), 0 0 14px rgba(243, 239, 230, 0.28); }
}

.gd-seat-chip.team-a { border-top: 3px solid var(--team-a); }
.gd-seat-chip.team-b { border-top: 3px solid var(--team-b); }
.gd-seat-chip.partner .gd-seat-role { color: var(--accent); }
.gd-seat-chip.sit-open {
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(196, 163, 90, 0.45);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.gd-seat-chip.sit-open:hover {
  background: rgba(196, 163, 90, 0.12);
  border-color: var(--accent);
}
.gd-seat-chip.mine {
  border-color: var(--accent);
}
.gd-sit-btn {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
}
.gd-seat-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  margin: 0.45rem 0 0.25rem;
}
.gd-seat-pick-btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
  min-width: 0;
}
.gd-seat-pick-btn.team-a { border-top: 2px solid var(--team-a); }
.gd-seat-pick-btn.team-b { border-top: 2px solid var(--team-b); }

.gd-seat-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 0.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
}

.gd-seat-role {
  font-size: 0.7rem;
  opacity: 0.75;
  font-weight: 500;
}

.gd-place-badge {
  background: rgba(255, 255, 255, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-size: 0.7rem;
  animation: gd-badge-pop 0.4s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.gd-badge {
  background: var(--accent);
  color: var(--ink);
  font-size: 0.68rem;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  font-weight: 700;
}

.gd-card-backs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.gd-card-backs-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  padding: 0.05rem 0.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.7rem;
  font-weight: 700;
}

/* Portrait with an overlaid relation badge and lead marker */
.gd-seat-portrait {
  position: relative;
  display: inline-flex;
}

.gd-seat-relation {
  position: absolute;
  left: 50%;
  bottom: -0.42rem;
  transform: translateX(-50%);
  padding: 0.02rem 0.3rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.gd-seat-relation.partner { background: #2f8f5b; }
.gd-seat-relation.opponent { background: #a8452f; }

.gd-seat-first {
  position: absolute;
  top: -0.3rem;
  right: -0.35rem;
  min-width: 1rem;
  padding: 0 0.18rem;
  border-radius: 4px;
  background: linear-gradient(160deg, #f0c14b, #d19a1c);
  color: #3a2606;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.gd-seat-tier {
  margin-top: 0.5rem;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f0c982;
  opacity: 0.92;
}

.gd-profile-tier {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.55rem 0.85rem;
  margin: 0.35rem 0 0.85rem;
}

.gd-profile-tier-badge {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #f0c982;
  padding: 0.2rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(240, 201, 130, 0.4);
  background: rgba(240, 201, 130, 0.12);
}

.gd-profile-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.65rem;
}

.gd-profile-head .gd-avatar {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.25rem;
}

.gd-avatar-catalog {
  background: linear-gradient(145deg, hsl(var(--av-h), var(--av-s), calc(var(--av-l) + 8%)), hsl(var(--av-h), var(--av-s), var(--av-l)));
  color: #fff8e7;
  font-size: 1rem;
}

.gd-avatar-cartoon {
  background: transparent !important;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
}

.gd-avatar-cartoon.team-a,
.gd-avatar-cartoon.team-b {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 1px 4px rgba(0, 0, 0, 0.3);
}

.gd-cartoon-avatar {
  width: 100%;
  height: 100%;
  display: block;
}

.gd-avatar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(3.1rem, 1fr));
  gap: 0.55rem;
  margin-top: 0.45rem;
}

/* Register: only the active gender pool is visible (15 avatars). */
.gd-avatar-grid[data-avatar-group]:not(.is-active) {
  display: none !important;
}

.gd-avatar-pick {
  appearance: none;
  border: 2px solid transparent;
  background: transparent;
  border-radius: 12px;
  padding: 0.12rem;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
  display: inline-grid;
  place-items: center;
  position: relative;
}

.gd-avatar-pick .gd-avatar-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.gd-avatar-pick:hover {
  transform: translateY(-2px);
}

.gd-avatar-pick.sel,
.gd-avatar-pick:has(.gd-avatar-radio:checked) {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.45);
}

.gd-avatar-pick .gd-avatar {
  width: 2.9rem;
  height: 2.9rem;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
}

.gd-avatar-photo {
  background: #2a3a32 !important;
  padding: 0;
  overflow: hidden;
}

.gd-avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gd-register-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-top: 0.4rem;
}

.gd-register-avatar-row .gd-avatar {
  width: 3.2rem;
  height: 3.2rem;
}

.gd-avatar-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gd-avatar-pending {
  width: 2.9rem;
  height: 2.9rem;
}

.gd-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.gd-crop-dialog {
  background: #1e2a24;
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 14px;
  padding: 1rem;
  max-width: 22rem;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.gd-crop-stage {
  display: grid;
  place-items: center;
  touch-action: none;
}

.gd-crop-canvas {
  border-radius: 12px;
  cursor: grab;
  max-width: 100%;
  touch-action: none;
}

.gd-crop-canvas:active {
  cursor: grabbing;
}

.gd-crop-hint {
  margin: 0.55rem 0 0.75rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
}

.gd-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.gd-gender-field {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}

.gd-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
}

.gd-my-hand {
  position: relative;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 12px 12px 0 0;
  padding: 0.35rem 0.5rem 0.15rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gd-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom, 0px));
  background: rgba(0, 0, 0, 0.35);
  border-radius: 0 0 12px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.gd-action-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Play and pass carry the weight; tools stay quiet on the left */
.gd-action-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.gd-tool-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-width: 3rem;
  min-height: 44px;
  padding: 0.25rem 0.4rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.gd-tool-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
}
.gd-tool-btn:disabled { opacity: 0.4; cursor: default; }
.gd-tool-glyph { font-size: 1.05rem; line-height: 1; }
.gd-tool-text { font-size: 0.62rem; opacity: 0.85; white-space: nowrap; }
/* Fixed slot so toggle on/off never reflows the hand / play bar (desktop). */
.gd-tool-btn-trusteeship {
  width: 3.25rem;
  min-width: 3.25rem;
  flex: 0 0 3.25rem;
  box-sizing: border-box;
}

.gd-trusteeship-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.3rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.42);
  color: #fbbf24;
  font-size: 0.58rem;
  white-space: nowrap;
}

.gd-suit-tools {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 8.75rem;
}

.gd-suit-btn {
  width: 2rem;
  height: 2rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  font-size: 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.gd-suit-btn.red { color: #fb7185; }
.gd-suit-btn.black { color: #e5e7eb; }
.gd-suit-btn:hover:not(:disabled) { transform: translateY(-2px); }
.gd-suit-btn.active {
  background: rgba(245, 158, 11, 0.22);
  border-color: rgba(245, 158, 11, 0.75);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.12);
}
.gd-suit-btn:disabled {
  opacity: 0.22;
  cursor: default;
}

.gd-play-btn {
  min-height: 46px;
  min-width: 6.5rem;
  padding: 0.6rem 1.5rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.gd-play-btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Recognized hand type, centered above the hand */
/* Overlay above the hand — must not take layout height (selecting a card must not shove the table up) */
.gd-hand-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 0.12rem);
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0.2rem 0.9rem;
  width: fit-content;
  max-width: min(92%, 18rem);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.14);
  pointer-events: none;
  white-space: nowrap;
}
.gd-hand-label-type { font-size: 0.95rem; font-weight: 700; }
.gd-hand-label-rank { font-size: 0.95rem; font-weight: 800; color: var(--accent); }
.gd-hand-label-suits { font-size: 0.85rem; letter-spacing: 0.08em; opacity: 0.85; }

.gd-hand-label.ok { border-color: rgba(47, 158, 95, 0.6); }
.gd-hand-label.weak { border-color: rgba(216, 66, 47, 0.6); }
.gd-hand-label.weak .gd-hand-label-rank { color: #ef8975; }
.gd-hand-label.invalid {
  border-color: rgba(216, 66, 47, 0.6);
  color: #ef8975;
}

.gd-hand-hint {
  width: 100%;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.85;
  margin: 0 0 0.15rem;
}

/* Card counter: unseen cards per rank */
.gd-counter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
  margin: 0 auto 0.35rem;
  padding: 0.35rem 0.5rem;
  width: fit-content;
  max-width: 100%;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.gd-counter-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 1.7rem;
  padding: 0.1rem 0.2rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  line-height: 1.25;
}
.gd-counter-cell.gone { opacity: 0.32; }

.gd-counter-rank { font-size: 0.66rem; font-weight: 600; opacity: 0.8; }
.gd-counter-left { font-size: 0.92rem; font-weight: 800; color: var(--accent); }
.gd-counter-cell.gone .gd-counter-left { color: inherit; }

.gd-tool-btn.on {
  background: rgba(196, 163, 90, 0.24);
  border-color: var(--accent);
}

.gd-overlay-panel {
  position: absolute;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  z-index: 40;
  width: min(22rem, 78%);
  max-height: min(46%, calc(100% - 6.8rem));
  height: fit-content;
  background: rgba(12, 28, 20, 0.86);
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 14px;
  padding: 0.65rem 0.9rem 0.75rem;
  overflow: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}
.gd-overlay-panel h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.25;
}
.gd-overlay-panel p {
  margin: 0.25rem 0 0.45rem;
  font-size: 0.9rem;
}
.gd-overlay-panel .gd-btn {
  margin-top: 0.15rem;
}

/* Return-tribute: wider panel + wrapping grid (avoid Fan scrollbar / one-tap submit) */
.gd-overlay-panel.gd-tribute-return {
  width: min(36rem, 92%);
  max-height: min(58%, calc(100% - 5.5rem));
}
.gd-overlay-panel.gd-tribute-return .gd-cards {
  flex-wrap: wrap;
  overflow: visible;
  max-height: none;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.35rem 0.1rem 0.15rem;
}
.gd-overlay-panel.gd-tribute-return .gd-btn {
  margin-top: 0.45rem;
}

/* —— Lobby —— */
.gd-lobby-hero {
  position: relative;
  text-align: center;
  padding: 2rem 0.75rem 1.5rem;
}

.gd-lobby-hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.2rem);
  margin: 0 0 0.4rem;
  letter-spacing: 0.06em;
}

.gd-lobby-hero .gd-lead {
  opacity: 0.85;
  margin: 0 0 1.25rem;
  font-size: 1.05rem;
}

.gd-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.gd-btn.cta {
  min-height: 48px;
  padding: 0.7rem 1.6rem;
  font-size: 1.1rem;
  border-radius: 10px;
}

.gd-room-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
  gap: 0.75rem;
}

.gd-room-card {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.gd-room-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.gd-room-card .gd-actions { margin-top: 0.25rem; }

.gd-room-card.locked {
  border-color: rgba(196, 163, 90, 0.35);
}

.gd-lock-badge {
  display: inline-block;
  margin-left: 0.3rem;
  font-size: 0.85rem;
  vertical-align: middle;
  line-height: 1;
}

.gd-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.62);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.gd-modal-dialog {
  background: #1e2a24;
  border: 1px solid rgba(196, 163, 90, 0.35);
  border-radius: 14px;
  padding: 1.1rem 1.2rem 1.2rem;
  max-width: 22rem;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.gd-modal-title {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
}

.gd-friend-pw {
  color: var(--accent, #c4a35a);
}

/* —— Shared chrome —— */
.gd-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.gd-btn {
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
}

.gd-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.16); }
.gd-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.gd-btn.primary {
  background: var(--accent);
  color: var(--ink);
  border-color: transparent;
  font-weight: 600;
}

.gd-error { color: #ffb4b4; margin-top: 0.75rem; }
.gd-footer { margin-top: 1rem; display: flex; gap: 0.75rem; justify-content: center; }

.gd-panel {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  max-width: 48rem;
}

.gd-label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
  opacity: 0.9;
}

.gd-input {
  width: min(20rem, 100%);
  padding: 0.5rem 0.65rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font-size: 1rem;
}

.gd-table-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.gd-table-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0.9rem;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 8px;
}

.gd-muted { opacity: 0.7; font-size: 0.85rem; }
.gd-link {
  color: var(--accent);
  margin-left: 0.5rem;
  text-decoration: none;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.gd-tribute {
  margin: 0.2rem 0 0.45rem;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.35;
}
.gd-lang a.active {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
}

.gd-topnav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  /* Above .gd-page > * siblings (brand/logo) so the hamburger panel is not covered. */
  position: relative;
  z-index: 40;
}
.gd-topnav .gd-spacer { flex: 1; }

.gd-topnav-name {
  max-width: 7.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gd-nav-menu {
  position: relative;
  display: inline-flex;
  align-items: center;
  z-index: 1;
}
.gd-nav-menu.open {
  z-index: 2;
}
.gd-nav-menu-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  padding: 0;
  border-radius: 0.45rem;
  border: 1px solid rgba(196, 163, 90, 0.4);
  background: rgba(0, 0, 0, 0.18);
  color: var(--cream, #f3e6c8);
  cursor: pointer;
}
.gd-nav-menu-btn:hover {
  border-color: rgba(196, 163, 90, 0.7);
  background: rgba(0, 0, 0, 0.28);
}
.gd-nav-menu-icon,
.gd-nav-menu-icon::before,
.gd-nav-menu-icon::after {
  display: block;
  width: 1.05rem;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
}
.gd-nav-menu-icon {
  position: relative;
}
.gd-nav-menu-icon::before,
.gd-nav-menu-icon::after {
  content: "";
  position: absolute;
  left: 0;
}
.gd-nav-menu-icon::before { top: -5px; }
.gd-nav-menu-icon::after { top: 5px; }
.gd-nav-menu-badge {
  position: absolute;
  top: -0.2rem;
  right: -0.2rem;
}
.gd-nav-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: transparent;
}
.gd-nav-menu-panel {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 3;
  /* Fit CN/EN/NO labels (~30% tighter than the old 10.5rem fixed min). */
  width: max-content;
  min-width: 7.25rem;
  max-width: min(12rem, calc(100vw - 1.5rem));
  padding: 0.3rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(212, 175, 106, 0.42);
  background:
    linear-gradient(180deg, rgba(54, 44, 30, 0.97) 0%, rgba(34, 28, 20, 0.98) 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 220, 150, 0.08);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.gd-nav-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  width: 100%;
  padding: 0.48rem 0.62rem;
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--cream, #f3e6c8);
  font: inherit;
  font-size: 0.92rem;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.gd-nav-menu-item:hover {
  background: rgba(212, 175, 106, 0.14);
  color: #ffe6a8;
}
.gd-profile-logout {
  display: flex;
  justify-content: center;
  padding: 1rem 1rem 1.25rem;
}
.gd-btn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 12rem;
  padding: 0.65rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 141, 122, 0.45);
  background: transparent;
  color: #ffb0a0;
  text-decoration: none;
  font-weight: 600;
}
.gd-btn-logout:hover {
  background: rgba(255, 141, 122, 0.12);
  color: #ffd0c6;
}

/* Toast — fixed overlay; never bottom-anchored (avoids iOS table scroll jump). */
.gd-toast-host {
  position: fixed;
  left: 50%;
  top: min(28vh, 12rem);
  bottom: auto;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  pointer-events: none;
  width: min(22rem, calc(100% - 2rem));
}
.gd-toast-host[hidden] {
  display: none !important;
}

.gd-toast {
  background: rgba(12, 22, 18, 0.55);
  border: 1px solid rgba(196, 163, 90, 0.35);
  color: var(--cream);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  text-align: center;
  font-size: 0.9rem;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: gd-toast-in 0.22s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

/* Table pages: keep tips over the felt mid-band */
.gd-page.table-page .gd-toast-host {
  top: 38%;
  bottom: auto;
}

.gd-page.table-page .gd-toast {
  background: rgba(8, 18, 14, 0.48);
  border-color: rgba(255, 220, 120, 0.4);
}

@keyframes gd-toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.gd-play-anim .gd-pcard {
  animation: gd-play-pop 0.28s ease;
}

@keyframes gd-play-pop {
  from { transform: translateY(16px) scale(0.9); opacity: 0.4; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 640px) {
  .gd-table-stage {
    grid-template-columns: 3.8rem 1fr 3.8rem;
    min-height: 18rem;
  }
  .gd-pcard {
    width: 2.35rem;
    height: 3.3rem;
  }
  .gd-cards.fan .gd-pcard { margin-left: -0.95rem; }
  .gd-center-play { min-height: 7.5rem; border-radius: 24px; }
  .gd-cards.columns { padding: 1.6rem 0.15rem 0.25rem; }
  .gd-rank-col {
    --card-h: 3.5rem;
    --stack: max(1.1rem, min(1.25rem, calc(5rem / var(--n, 1))));
    margin-left: -0.8rem;
  }
  .gd-cards.columns .gd-pcard:not(.mini) { width: 2.5rem; }
  .gd-cards.columns .gd-pcard:not(.mini) .gd-pcard-pip { font-size: 1.5rem; }
  .gd-cards.columns .gd-pcard.sel,
  .gd-cards.columns .gd-pcard.sel:hover,
  .gd-cards.columns .gd-pcard.interactive.sel:hover {
    transform: translateY(-0.7rem);
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .gd-table-stage { min-height: 14rem; }
  .gd-header h1 { font-size: 1.25rem; }
  .gd-cards.columns { padding-top: 1.4rem; }
  .gd-rank-col {
    --card-h: 3.3rem;
    --stack: max(1.05rem, min(1.2rem, calc(4.6rem / var(--n, 1))));
    margin-left: -0.75rem;
  }
  .gd-cards.columns .gd-pcard:not(.mini) { width: 2.35rem; }
  .gd-cards.columns .gd-pcard:not(.mini) .gd-pcard-pip { font-size: 1.35rem; }
  .gd-cards.columns .gd-pcard.sel,
  .gd-cards.columns .gd-pcard.sel:hover,
  .gd-cards.columns .gd-pcard.interactive.sel:hover {
    transform: translateY(-0.6rem);
  }
}
/* —— UX overhaul additions —— */

.gd-page::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(196, 163, 90, 0.08), transparent 55%),
    radial-gradient(ellipse at 10% 80%, var(--felt-glow), transparent 40%);
  animation: gd-ambient 12s ease-in-out infinite alternate;
  z-index: 0;
}
.gd-page > * { position: relative; z-index: 1; }
/* Must follow `.gd-page > *` — that rule sets position:relative and would collapse the fixed click-catcher. */
.gd-page.gd-lobby-page > .gd-topnav {
  z-index: 120;
}
.gd-page.gd-lobby-page > .gd-nav-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
}

@keyframes gd-ambient {
  from { opacity: 0.55; transform: scale(1); }
  to { opacity: 1; transform: scale(1.04); }
}

/* Language dropdown */
.gd-lang-select {
  appearance: none;
  background: rgba(0, 0, 0, 0.28) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23c4a35a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 0.55rem center;
  border: 1px solid rgba(196, 163, 90, 0.4);
  color: var(--cream);
  border-radius: 8px;
  padding: 0.35rem 1.75rem 0.35rem 0.65rem;
  font-size: 0.85rem;
  cursor: pointer;
  min-height: 2rem;
}
.gd-lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gd-lang-select option { background: #1a2e24; color: #f3efe6; }

/* Sound toggle */
.gd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.25);
  color: var(--cream);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.gd-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }
.gd-icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Lobby hero polish */
.gd-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.75rem;
  border-radius: 1.1rem;
  background:
    linear-gradient(145deg, rgba(196, 163, 90, 0.35), rgba(61, 158, 205, 0.2));
  border: 1px solid rgba(196, 163, 90, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 2rem;
  animation: gd-brand-float 4s ease-in-out infinite;
}
@keyframes gd-brand-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.gd-lobby-hero h1 {
  background: linear-gradient(120deg, #fff8e7 0%, var(--accent) 45%, #7dcea0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}
.gd-lobby-nick {
  text-align: left;
  max-width: 20rem;
  margin: 0.55rem auto 0.25rem;
}
.gd-lobby-nick-input {
  display: block;
  margin: 0 auto;
  max-width: 16rem;
  text-align: center;
}
.gd-wait-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.5rem;
  max-width: 18rem;
}
.gd-wait-ring {
  display: grid;
  grid-template-columns: repeat(2, 2.4rem);
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}
.gd-wait-slot {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  border: 2px solid rgba(255, 255, 255, 0.18);
  overflow: hidden;
}
.gd-wait-slot.team-a { border-color: rgba(61, 158, 205, 0.65); }
.gd-wait-slot.team-b { border-color: rgba(224, 138, 76, 0.65); }
.gd-wait-slot.empty { border-style: dashed; opacity: 0.7; }
.gd-wait-empty {
  font-size: 0.95rem;
  opacity: 0.55;
}
.gd-wait-count {
  margin: 0;
  font-weight: 650;
}
.gd-wait-match-hint,
.gd-wait-two-hint {
  margin: 0;
  font-size: 0.82rem;
  text-align: center;
  max-width: 16rem;
}
.gd-wait-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
  max-width: 14rem;
}
.gd-wait-actions .gd-btn {
  width: 100%;
}
.gd-wait-hint {
  margin: 0;
  font-size: 0.8rem;
  text-align: center;
}

.gd-resume-banner,
.gd-install-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(196, 163, 90, 0.4);
}
.gd-install-banner {
  border-color: rgba(125, 206, 160, 0.35);
}
.gd-install-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.gd-moments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.35rem;
}
.gd-moment-card {
  padding: 0.7rem 0.75rem;
  border-radius: 12px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(196, 163, 90, 0.18), transparent 55%),
    rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-height: 6.5rem;
}
.gd-moment-card strong { font-size: 0.95rem; }
.gd-moment-card p { margin: 0; font-size: 0.78rem; }
.gd-moment-tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(196, 163, 90, 0.25);
  color: #ffe9b8;
}
.gd-moment-card.ace .gd-moment-tag { background: rgba(125, 206, 160, 0.28); color: #d5f5e3; }
.gd-moment-card.points .gd-moment-tag { background: rgba(61, 158, 205, 0.3); color: #cfe9f8; }
.gd-moment-card.long .gd-moment-tag { background: rgba(224, 138, 76, 0.3); color: #ffe0c8; }

.gd-match-review {
  margin: 0.65rem auto 0;
  max-width: 22rem;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
}
.gd-match-review ol {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
}
.gd-match-review li { margin: 0.15rem 0; }

.gd-weekly-board {
  margin-top: 0.85rem;
}
.gd-weekly-list {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.gd-weekly-list li {
  display: grid;
  grid-template-columns: 1.6rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}
.gd-weekly-rank {
  font-weight: 700;
  color: var(--accent);
}
.gd-weekly-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gd-weekly-score {
  font-size: 0.82rem;
  opacity: 0.9;
}
.gd-spectate-banner {
  margin: 0 0 0.45rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px dashed rgba(255, 255, 255, 0.22);
  font-size: 0.8rem;
  text-align: center;
}
.gd-drill-banner {
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.75rem;
  border-radius: 10px;
  background: linear-gradient(120deg, rgba(47, 158, 95, 0.22), rgba(12, 40, 28, 0.55));
  border: 1px solid rgba(120, 210, 160, 0.35);
  font-size: 0.82rem;
  text-align: center;
}
.gd-drill-banner strong { color: #d8f5e4; }
.gd-practice-shell {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.5rem 0 2rem;
}
.gd-practice-hero h1 {
  margin: 0.35rem 0 0.25rem;
  font-size: clamp(1.55rem, 4vw, 2rem);
}
.gd-drill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}
.gd-drill-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 28, 20, 0.55);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}
.gd-drill-card:hover:not(:disabled) {
  border-color: rgba(120, 210, 160, 0.55);
  transform: translateY(-2px);
  background: rgba(12, 40, 28, 0.72);
}
.gd-drill-card:disabled { opacity: 0.55; cursor: wait; }
.gd-drill-card.primary {
  border-color: rgba(212, 175, 55, 0.45);
  background: linear-gradient(145deg, rgba(60, 45, 12, 0.55), rgba(12, 36, 24, 0.7));
}
.gd-drill-card strong { font-size: 1.02rem; }
.gd-drill-section {
  margin: 1.35rem 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.78;
}
.gd-career-strip {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-width: 22rem;
  margin: 0.55rem auto 0;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: left;
}
.gd-career-strip-main {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.gd-career-strip-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.gd-career-strip-hydrating .gd-career-hydrate-hint {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
}
.gd-skeleton {
  display: block;
  border-radius: 0.35rem;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(255, 255, 255, 0.08) 90%
  );
  background-size: 200% 100%;
  animation: gd-skeleton-shimmer 1.15s ease-in-out infinite;
}
.gd-skeleton-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
}
.gd-skeleton-line {
  height: 0.72rem;
}
.gd-skeleton-line-md { width: 6.5rem; }
.gd-skeleton-line-sm { width: 4.75rem; margin-top: 0.28rem; }
@keyframes gd-skeleton-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.gd-btn.is-busy,
.gd-btn:disabled.is-busy,
button.gd-drill-card:disabled.is-busy {
  cursor: wait;
  opacity: 0.72;
}
.gd-play-bar.is-busy {
  pointer-events: none;
  opacity: 0.85;
}
.gd-arena-progress {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem 0.5rem;
  align-items: center;
  font-size: 0.78rem;
}
.gd-arena-progress-track {
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}
.gd-arena-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #7dcea0);
}
.gd-lobby-cta { margin-top: 1.25rem; }
.gd-lobby-join-row {
  justify-content: center;
  margin-top: 0.5rem;
}
.gd-lobby-join-input { max-width: 8rem; }
.gd-btn.with-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.gd-btn.with-icon .gd-btn-ico { font-size: 1.1em; line-height: 1; }
.gd-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gd-btn.primary {
  box-shadow: 0 4px 14px rgba(196, 163, 90, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.gd-btn.primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(196, 163, 90, 0.45);
}

/* Room cards */
.gd-rooms-panel {
  margin: 1.25rem auto 0;
  max-width: 48rem;
}
.gd-rooms-head {
  margin: 0 0 0.75rem;
  background: transparent;
  padding: 0;
}
.gd-room-card:hover {
  transform: translateY(-2px);
  border-color: rgba(196, 163, 90, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}
.gd-occupancy {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.gd-progress-ring {
  --p: 0;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background:
    conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,0.12) 0);
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}
.gd-progress-ring::after {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  background: rgba(12, 28, 20, 0.95);
}
.gd-avatar-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.15rem;
}
.gd-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.25);
  flex-shrink: 0;
  text-transform: uppercase;
}
.gd-avatar.empty {
  background: transparent;
  border-style: dashed;
  opacity: 0.5;
}
.gd-avatar.team-a { background: linear-gradient(135deg, #3d9ecd, #2a6f94); }
.gd-avatar.team-b { background: linear-gradient(135deg, #e08a4c, #b86a35); }
.gd-empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
}
.gd-empty-state .gd-empty-ico {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.85;
  display: block;
}

/* Table velvet + vignette */
.gd-page.table-page .gd-table-stage {
  border-radius: 18px;
  padding: 0.5rem;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(47, 107, 79, 0.55) 0%, transparent 70%),
    rgba(0, 0, 0, 0.15);
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(196, 163, 90, 0.12);
}
.gd-center-play.gd-play-from-bottom .gd-pcard { animation: gd-slide-from-bottom 0.32s ease; }
.gd-center-play.gd-play-from-top .gd-pcard { animation: gd-slide-from-top 0.32s ease; }
.gd-center-play.gd-play-from-left .gd-pcard { animation: gd-slide-from-left 0.32s ease; }
.gd-center-play.gd-play-from-right .gd-pcard { animation: gd-slide-from-right 0.32s ease; }

@keyframes gd-slide-from-bottom {
  from { transform: translateY(48px) scale(0.85); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}
@keyframes gd-slide-from-top {
  from { transform: translateY(-48px) scale(0.85); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}
@keyframes gd-slide-from-left {
  from { transform: translateX(-48px) scale(0.85); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}
@keyframes gd-slide-from-right {
  from { transform: translateX(48px) scale(0.85); opacity: 0.2; }
  to { transform: none; opacity: 1; }
}

/* Seat pill + pulse */
.gd-seat-chip.turn {
  animation: gd-turn-pulse 1.4s ease-in-out infinite;
}
@keyframes gd-turn-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(196, 163, 90, 0.4), 0 0 12px rgba(196, 163, 90, 0.25); }
  50% { box-shadow: 0 0 0 2px rgba(196, 163, 90, 0.75), 0 0 22px rgba(196, 163, 90, 0.45); }
}
.gd-seat-chip .gd-avatar {
  margin: 0 auto 0.25rem;
  width: 2.2rem;
  height: 2.2rem;
  font-size: 0.85rem;
}
.gd-countdown-ring {
  --p: 100;
  --ring-color: var(--accent);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) calc(var(--p) * 1%), rgba(255,255,255,0.12) 0);
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--cream);
  margin-left: auto;
}
.gd-countdown-ring::before {
  content: attr(data-sec);
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
  background: rgba(12, 28, 20, 0.95);
  display: grid;
  place-items: center;
}
.gd-countdown-ring.urgent {
  --ring-color: #ff6b6b;
  animation: gd-urgent-tick 0.6s ease-in-out infinite;
}
.gd-countdown-ring.critical {
  --ring-color: #ff3b3b;
  box-shadow: 0 0 0 2px rgba(255, 80, 80, 0.35);
  animation: gd-critical-tick 0.38s ease-in-out infinite;
}
@keyframes gd-critical-tick {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.08); filter: brightness(1.25); }
}
.gd-hand-band.urgent-turn {
  outline: 1px solid rgba(255, 110, 90, 0.45);
  outline-offset: 2px;
  border-radius: 12px;
  animation: gd-hand-urgent-glow 1.1s ease-in-out infinite;
}
@keyframes gd-hand-urgent-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 90, 70, 0); }
  50% { box-shadow: 0 0 14px 1px rgba(255, 90, 70, 0.28); }
}
.gd-hand-label.gd-hand-label-pop {
  animation: gd-label-pop 0.28s ease-out;
}
@keyframes gd-label-pop {
  from { opacity: 0; transform: translateY(6px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.gd-center-play.gd-trail-burst::after {
  content: "";
  position: absolute;
  inset: 18% 22%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 236, 180, 0.45) 0%, rgba(255, 236, 180, 0) 70%);
  animation: gd-trail-burst 0.42s ease-out forwards;
}
@keyframes gd-trail-burst {
  from { opacity: 0.85; transform: scale(0.55); }
  to { opacity: 0; transform: scale(1.35); }
}
.gd-countdown-ring.gd-seat-turn-timer {
  width: 1.9rem;
  height: 1.9rem;
  font-size: 0.68rem;
  margin: 0;
  flex-shrink: 0;
}
.gd-countdown-ring.gd-seat-turn-timer::before {
  width: 1.4rem;
  height: 1.4rem;
}
.gd-seat-chip .gd-seat-avatar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.gd-seat-chip .gd-seat-avatar-row .gd-avatar {
  margin: 0;
}
.gd-seat-chip .gd-seat-avatar-row .gd-countdown-ring {
  margin-left: 0;
}
.gd-bottom-turn-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  background: rgba(196, 163, 90, 0.14);
  border: 1px solid rgba(196, 163, 90, 0.35);
  width: fit-content;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.gd-bottom-turn-bar .gd-countdown-ring {
  margin-left: 0;
}
.gd-bottom-turn-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
}
.gd-icon {
  display: inline-block;
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  background: currentColor;
  color: var(--accent, #c4a35a);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
/* Hourglass / turn */
.gd-icon-turn {
  width: 0.95rem;
  height: 0.95rem;
  vertical-align: -0.1rem;
  margin-left: 0.2rem;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h12v2l-4 4v4l4 4v2H6v-2l4-4v-4L6 4V2zm2.8 2l3.2 3.2L15.2 4H8.8zM8.8 20l3.2-3.2L15.2 20H8.8z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h12v2l-4 4v4l4 4v2H6v-2l4-4v-4L6 4V2zm2.8 2l3.2 3.2L15.2 4H8.8zM8.8 20l3.2-3.2L15.2 20H8.8z'/%3E%3C/svg%3E");
}
.gd-bottom-turn-bar .gd-icon-turn {
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0;
}
@keyframes gd-urgent-tick {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

/* Top-left: rank + suit on ONE row — unraised peek and raised lift both show 花色 */
.gd-pcard-corner {
  position: absolute;
  top: 0.12rem;
  left: 0.12rem;
  display: inline-flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.06rem;
  line-height: 1;
  width: auto;
  max-width: calc(100% - 0.3rem);
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
}
.gd-pcard.mini .gd-pcard-corner {
  top: 0.08rem;
  left: 0.1rem;
  gap: 0.03rem;
}
.gd-pcard-corner .gd-pcard-rank,
.gd-pcard-corner .gd-pcard-suit {
  flex: 0 0 auto;
}
.gd-pcard.wild {
  box-shadow: inset 0 0 0 2px #e85d4c, 0 0 8px rgba(232, 93, 76, 0.35);
}

/* Deal-in animation */
.gd-my-hand.gd-deal-in .gd-pcard {
  animation: gd-deal-fly 0.45s ease backwards;
}
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(1) { animation-delay: 0.02s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(2) { animation-delay: 0.04s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(3) { animation-delay: 0.06s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(4) { animation-delay: 0.08s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(5) { animation-delay: 0.1s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(6) { animation-delay: 0.12s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(7) { animation-delay: 0.14s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(8) { animation-delay: 0.16s; }
.gd-my-hand.gd-deal-in .gd-pcard:nth-child(n+9) { animation-delay: 0.2s; }

/* In column layout stagger by rank column, not by position inside a column */
.gd-my-hand.gd-deal-in .gd-rank-col .gd-pcard { animation-delay: 0.22s; }
.gd-my-hand.gd-deal-in .gd-rank-col:nth-child(1) .gd-pcard { animation-delay: 0.02s; }
.gd-my-hand.gd-deal-in .gd-rank-col:nth-child(2) .gd-pcard { animation-delay: 0.05s; }
.gd-my-hand.gd-deal-in .gd-rank-col:nth-child(3) .gd-pcard { animation-delay: 0.08s; }
.gd-my-hand.gd-deal-in .gd-rank-col:nth-child(4) .gd-pcard { animation-delay: 0.11s; }
.gd-my-hand.gd-deal-in .gd-rank-col:nth-child(5) .gd-pcard { animation-delay: 0.14s; }
.gd-my-hand.gd-deal-in .gd-rank-col:nth-child(6) .gd-pcard { animation-delay: 0.17s; }
.gd-my-hand.gd-deal-in .gd-rank-col:nth-child(7) .gd-pcard { animation-delay: 0.2s; }
@keyframes gd-deal-fly {
  from { transform: translateY(-40px) rotate(-8deg) scale(0.7); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* Bomb flash overlay only — do NOT transform the stage (keeps layout stable) */
.gd-table-stage.gd-bomb-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(circle at 50% 45%, rgba(255, 220, 120, 0.42), transparent 62%);
  animation: gd-flash 0.55s ease forwards;
  z-index: 35;
}
@keyframes gd-flash {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Victory confetti layer */
.gd-win-banner {
  position: absolute;
  inset: 18% 10%;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.25rem;
  background: rgba(12, 28, 20, 0.72);
  border: 2px solid var(--accent);
  border-radius: 16px;
  text-align: center;
  animation: gd-win-pop 0.45s cubic-bezier(0.2, 1.2, 0.4, 1);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}
.gd-win-banner h2 {
  margin: 0;
  font-size: 1.5rem;
  color: var(--accent);
}
.gd-win-avatars {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.35rem 0 0.5rem;
  position: relative;
  z-index: 1;
}
.gd-win-banner-friend {
  box-shadow: 0 0 0 2px rgba(255, 214, 102, 0.45);
}
.gd-win-banner .gd-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, #c4a35a 2px, transparent 3px),
    radial-gradient(circle, #3d9ecd 2px, transparent 3px),
    radial-gradient(circle, #e08a4c 2px, transparent 3px),
    radial-gradient(circle, #7dcea0 2px, transparent 3px);
  background-size: 40px 40px, 55px 55px, 48px 48px, 62px 62px;
  background-position: 0 0, 20px 10px, 8px 28px, 30px 18px;
  animation: gd-confetti-fall 2.5s linear infinite;
  opacity: 0.7;
}
@keyframes gd-win-pop {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes gd-confetti-fall {
  from { background-position: 0 -20px, 20px -30px, 8px -10px, 30px -40px; }
  to { background-position: 0 60px, 20px 50px, 8px 70px, 30px 40px; }
}
@keyframes gd-badge-pop {
  from { transform: scale(0.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Your turn banner */
.gd-your-turn-banner {
  position: fixed;
  left: 50%;
  top: max(1rem, env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 90;
  background: linear-gradient(90deg, rgba(196, 163, 90, 0.72), rgba(224, 192, 120, 0.72));
  color: var(--ink);
  font-weight: 800;
  padding: 0.55rem 1.4rem;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: gd-banner-in 0.35s ease;
  letter-spacing: 0.04em;
  pointer-events: none;
}
@keyframes gd-banner-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .gd-page::before,
  .gd-brand-mark,
  .gd-brand-logo,
  .gd-seat-chip.turn,
  .gd-seat-chip.trick-owner-pulse,
  .gd-seat-slot.bottom.trick-owner-pulse .gd-my-hand,
  .gd-countdown-ring.urgent,
  .gd-countdown-ring.critical,
  .gd-hand-band.urgent-turn,
  .gd-hand-label.gd-hand-label-pop,
  .gd-center-play.gd-trail-burst::after,
  .gd-emote-bubble,
  .gd-emote-bubble.gd-emote-bubble-self,
  .gd-my-hand.gd-deal-in .gd-pcard,
  .gd-center-play .gd-pcard,
  .gd-play-anim .gd-pcard,
  .gd-table-stage.gd-bomb-fx,
  .gd-table-stage.gd-bomb-fx::after,
  .gd-win-banner,
  .gd-win-banner .gd-confetti,
  .gd-place-badge,
  .gd-your-turn-banner,
  .gd-moment-banner,
  .gd-toast {
    animation: none !important;
  }
}

.gd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* —— Lobby two-column shell —— */
.gd-lobby-page {
  max-width: 72rem;
  margin: 0 auto;
}

.gd-lobby-shell {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.25rem 1.75rem;
  align-items: start;
  margin-top: 0.35rem;
}

.gd-lobby-play {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.gd-lobby-brand {
  text-align: left;
  padding: 0.25rem 0 0.15rem;
}
.gd-lobby-brand .gd-brand-mark {
  margin: 0 0 0.65rem;
}
.gd-lobby-brand .gd-brand-logo {
  display: block;
  width: 5.5rem;
  height: 5.5rem;
  margin: 0 0 0.75rem;
  border-radius: 50%;
  object-fit: cover;
  box-shadow:
    0 0 0 2px rgba(196, 163, 90, 0.45),
    0 10px 28px rgba(0, 0, 0, 0.35);
  animation: gd-brand-float 4s ease-in-out infinite;
}
.gd-lobby-brand h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(2rem, 4.5vw, 3rem);
  letter-spacing: 0.06em;
  font-weight: 700;
  background: linear-gradient(120deg, #fff8e7 0%, var(--accent) 45%, #7dcea0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gd-lobby-brand .gd-lead {
  margin: 0;
  opacity: 0.88;
  font-size: 1.05rem;
}

.gd-topnav-profile {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.gd-topnav-profile .gd-avatar-sm {
  width: 1.55rem;
  height: 1.55rem;
  font-size: 0.55rem;
  border-width: 1px;
}
.gd-topnav-profile .gd-avatar-sm.gd-avatar-cartoon svg,
.gd-topnav-profile .gd-avatar-sm.gd-avatar-photo img {
  width: 100%;
  height: 100%;
}

.gd-play-bar,
.gd-join-bar {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 1.1rem 1.1rem 1.2rem;
}
.gd-join-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  background: transparent;
  border: none;
  padding: 0.55rem 0 0;
}

.gd-join-details {
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.55rem 0.9rem 0.65rem;
}
.gd-join-details > summary {
  cursor: pointer;
  list-style: none;
  font-size: 0.88rem;
  opacity: 0.85;
  user-select: none;
}
.gd-join-details > summary::-webkit-details-marker { display: none; }
.gd-join-details > summary::before {
  content: "▸ ";
  color: var(--accent);
}
.gd-join-details[open] > summary::before { content: "▾ "; }

.gd-play-bar-field .gd-label {
  margin-bottom: 0.35rem;
}
.gd-play-bar-field .gd-input {
  width: 100%;
  max-width: 100%;
}
.gd-play-bar-cta {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0;
}
.gd-cta-primary {
  width: 100%;
  justify-content: center;
  min-height: 3rem;
  font-size: 1.05rem;
  box-shadow: 0 6px 18px rgba(196, 163, 90, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.gd-cta-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(196, 163, 90, 0.38);
}
.gd-cta-secondary,
.gd-cta-social {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}
.gd-cta-secondary .gd-btn.cta,
.gd-cta-social .gd-btn.cta {
  justify-content: center;
  width: 100%;
}
.gd-btn-quiet {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  opacity: 0.92;
  font-size: 0.92rem;
  padding-top: 0.45rem;
  padding-bottom: 0.45rem;
}
.gd-btn-debug {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
  opacity: 0.7;
  background: transparent;
  border-style: dashed;
}

.gd-join-bar .gd-lobby-join-input {
  flex: 1 1 7rem;
  max-width: 10rem;
  margin: 0;
}

.gd-lobby-rooms {
  margin: 0;
  max-width: none;
  min-height: 18rem;
  display: flex;
  flex-direction: column;
}
.gd-lobby-rooms .gd-rooms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
}
.gd-lobby-rooms .gd-room-grid {
  grid-template-columns: 1fr;
  gap: 0.85rem;
  flex: 1;
}
.gd-lobby-rooms .gd-room-card {
  animation: gd-toast-in 0.28s ease;
}
.gd-thumb-seat.sit-open {
  box-shadow: 0 0 0 2px rgba(196, 163, 90, 0.55);
  background: rgba(196, 163, 90, 0.12);
}
.gd-lobby-rooms .gd-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  min-height: 14rem;
}
.gd-lobby-rooms .gd-empty-ico {
  font-size: 3.25rem;
}

.gd-room-id {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}
.gd-room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}
.gd-room-actions .gd-btn {
  flex: 1 1 auto;
  min-height: 2.4rem;
}

/* Compass seat thumbnail */
.gd-table-thumb {
  position: relative;
  display: grid;
  grid-template-columns: 2.4rem 1fr 2.4rem;
  grid-template-rows: 2.4rem minmax(3.6rem, 1fr) 2.4rem;
  grid-template-areas:
    ".    top  ."
    "left mid  right"
    ".    bot  .";
  gap: 0.25rem;
  min-height: 8.5rem;
  padding: 0.35rem;
}
.gd-table-thumb-felt {
  grid-area: mid;
  border-radius: 50% / 42%;
  background:
    radial-gradient(ellipse at 50% 45%, #2f6b4f 0%, #1a4232 72%);
  border: 1px solid rgba(196, 163, 90, 0.28);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.28);
  min-height: 3.6rem;
}
.gd-thumb-seat {
  appearance: none;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.2);
  border-radius: 999px;
  padding: 0;
  width: 2.35rem;
  height: 2.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  color: var(--cream);
  justify-self: center;
  align-self: center;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.gd-thumb-seat.top { grid-area: top; }
.gd-thumb-seat.left { grid-area: left; }
.gd-thumb-seat.right { grid-area: right; }
.gd-thumb-seat.bottom { grid-area: bot; }
.gd-thumb-seat.team-a { box-shadow: inset 0 2px 0 0 var(--team-a); }
.gd-thumb-seat.team-b { box-shadow: inset 0 2px 0 0 var(--team-b); }
.gd-thumb-seat.filled {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.28);
}
.gd-thumb-seat.sit-open {
  cursor: pointer;
  border-color: rgba(196, 163, 90, 0.5);
}
.gd-thumb-seat.sit-open:hover:not(:disabled) {
  background: rgba(196, 163, 90, 0.16);
  border-color: var(--accent);
  transform: scale(1.06);
}
.gd-thumb-seat:disabled {
  opacity: 0.95;
  cursor: default;
}
.gd-thumb-seat .gd-avatar {
  width: 1.85rem;
  height: 1.85rem;
  margin: 0;
  border-width: 1px;
  font-size: 0.68rem;
}
/* Practice arena mini tables (~50×50 felt) */
.gd-practice-page .gd-practice-shell {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0.75rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.gd-practice-header h1 {
  margin: 0.25rem 0 0.35rem;
}
.gd-practice-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.gd-practice-floor {
  padding: 0.85rem 1rem 1.15rem;
}
.gd-practice-grid {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.85rem 0.75rem;
  justify-items: center;
}
.gd-practice-card {
  width: 10.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  pointer-events: none;
}
.gd-practice-mini {
  position: relative;
  width: 100px;
  height: 100px;
  display: grid;
  grid-template-columns: 16px 1fr 16px;
  grid-template-rows: 16px 1fr 16px;
  grid-template-areas:
    ".    top  ."
    "left mid  right"
    ".    bot  .";
  gap: 2px;
}
.gd-practice-felt {
  grid-area: mid;
  border-radius: 50% / 42%;
  background:
    radial-gradient(ellipse at 50% 45%, #2f6b4f 0%, #1a4232 72%);
  border: 1px solid rgba(196, 163, 90, 0.35);
  box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.28);
}
.gd-practice-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  justify-self: center;
  align-self: center;
  background: rgba(255, 255, 255, 0.28);
}
.gd-practice-dot.top { grid-area: top; }
.gd-practice-dot.left { grid-area: left; }
.gd-practice-dot.right { grid-area: right; }
.gd-practice-dot.bottom { grid-area: bot; }
.gd-practice-dot.human {
  background: var(--accent, #c4a35a);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
}
.gd-practice-dot.bot {
  background: rgba(255, 255, 255, 0.35);
}
.gd-practice-name {
  max-width: 10.5rem;
  font-size: 0.85rem;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gd-practice-phase {
  font-size: 0.72rem;
  line-height: 1.15;
  text-align: center;
}

.gd-thumb-empty {
  font-size: 0.72rem;
  font-weight: 700;
  opacity: 0.65;
}

@media (max-width: 899px) {
  .gd-lobby-page .gd-topnav {
    flex-wrap: nowrap;
    overflow: visible;
  }
  .gd-lobby-shell {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .gd-lobby-brand {
    text-align: center;
  }
  .gd-lobby-brand .gd-brand-mark,
  .gd-lobby-brand .gd-brand-logo {
    margin-left: auto;
    margin-right: auto;
  }
  .gd-lobby-brand .gd-brand-logo {
    width: 4.5rem;
    height: 4.5rem;
  }
  .gd-cta-primary {
    min-height: 2.85rem;
  }
  .gd-lobby-rooms {
    min-height: 0;
  }
  .gd-room-actions .gd-copy-link {
    display: none;
  }
}

/* Personal scores */
.gd-seat-score {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 0.15rem;
}
.gd-deal-scores {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 25;
  text-align: left;
  width: min(16rem, 92%);
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(8, 18, 14, 0.55);
  border: 1px solid rgba(196, 163, 90, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
.gd-deal-scores strong {
  display: block;
  color: var(--accent);
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.gd-deal-scores ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.gd-deal-scores li {
  font-size: 0.85rem;
  padding: 0.12rem 0;
  opacity: 0.95;
}
.gd-deal-scores li.plus { color: #7dcea0; }
.gd-deal-scores li.minus { color: #e88a7a; }

/* Bot debug controls */
.gd-bot-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin-top: 0.65rem;
}
.gd-bot-speed {
  width: auto;
  min-width: 6.5rem;
  padding: 0.35rem 0.5rem;
}
.gd-practice-speed-label {
  margin: 0;
  white-space: nowrap;
}
.gd-practice-speed {
  width: auto;
  min-width: 4.5rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.85rem;
}

/* ===== Mobile immersive table (landscape fullscreen) ===== */
.gd-table-float-tools {
  display: none;
}
.gd-rotate-gate {
  display: none;
}

.gd-page.table-page.gd-mobile-table {
  max-width: none;
  width: 100%;
  /* Prefer live visualViewport height (JS sets --gd-app-height). Avoid pinning 100svh
     forever — that keeps the table short even after iOS Safari chrome collapses. */
  height: var(--gd-app-height, 100dvh);
  margin: 0;
  padding: 0.2rem max(0.35rem, env(safe-area-inset-right))
           max(0.2rem, env(safe-area-inset-bottom))
           max(0.35rem, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: none;
  box-sizing: border-box;
}

/* iOS: temporarily allow page scroll so Safari can collapse address/tab bars */
html.gd-ios-chrome-open,
html.gd-ios-chrome-open body {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: none;
  height: auto;
  min-height: 100%;
}
html.gd-ios-chrome-locked,
html.gd-ios-chrome-locked body {
  overflow: hidden;
  overscroll-behavior: none;
  /* Fill the screen — never pin a short --gd-app-height that letterboxes white */
  position: fixed;
  inset: 0;
  width: 100%;
  height: auto;
  min-height: 100%;
  background-color: #163828;
}

/* Fullscreen / locked immersive table: freeze document rubber-banding */
html.gd-table-scroll-lock,
html.gd-table-scroll-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: none;
  position: fixed;
  inset: 0;
  width: 100%;
  height: auto;
  min-height: 100%;
  background-color: #163828;
}

/* Friends/profile overlay: keep swipe scrolling inside the drawer, not the lobby. */
html.gd-overlay-scroll-lock,
html.gd-overlay-scroll-lock body {
  overflow: hidden !important;
  overscroll-behavior: none;
}
html.gd-table-scroll-lock .gd-page.table-page.gd-mobile-table {
  touch-action: manipulation;
  overscroll-behavior: none;
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  /* Fill the fixed viewport; --gd-app-height remains for inner layout math */
  height: auto;
  min-height: 100%;
  box-sizing: border-box;
}
html.gd-table-scroll-lock .gd-my-hand .gd-cards {
  touch-action: pan-x;
}

.gd-ios-scroll-spacer {
  width: 1px;
  height: 160vh;
  pointer-events: none;
  visibility: hidden;
}
.gd-ios-chrome-tip {
  display: none;
}
.gd-page.table-page.gd-mobile-table .gd-ios-chrome-tip:not([hidden]) {
  display: flex;
  position: fixed;
  top: max(0.35rem, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 55;
  max-width: min(92vw, 22rem);
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: rgba(8, 18, 14, 0.78);
  color: #f2f6f3;
  font-size: 0.78rem;
  line-height: 1.35;
  text-align: center;
  pointer-events: none;
  backdrop-filter: blur(6px);
}

/* Hide lobby-style chrome; keep only game UI */
.gd-page.table-page.gd-mobile-table .gd-table-chrome {
  display: none !important;
}

.gd-page.table-page.gd-mobile-table .gd-table-float-tools {
  display: flex;
  position: fixed;
  top: max(0.28rem, env(safe-area-inset-top));
  right: max(0.4rem, env(safe-area-inset-right));
  z-index: 60;
  gap: 0.4rem;
  align-items: center;
  pointer-events: auto;
  touch-action: manipulation;
}
.gd-page.table-page.gd-mobile-table .gd-float-coach {
  margin: 0;
  padding: 0.32rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff8f5;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.gd-page.table-page.gd-mobile-table .gd-float-coach.on {
  border-color: rgba(125, 206, 160, 0.65);
  color: #c8f0d8;
}
.gd-page.table-page.gd-mobile-table .gd-emote-bar {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 0.12rem 0.2rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.gd-page.table-page.gd-mobile-table .gd-emote-btn {
  width: 1.7rem;
  height: 1.7rem;
  border: none;
  background: transparent;
}
.gd-page.table-page.gd-mobile-table .gd-float-speed option {
  color: #1a1a1a;
  background: #fff;
}
.gd-page.table-page.gd-mobile-table .gd-float-exit {
  margin: 0;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(140, 40, 40, 0.82);
  border: 1px solid rgba(255, 200, 180, 0.35);
  color: #fff8f5;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  white-space: nowrap;
}
.gd-page.table-page.gd-mobile-table .gd-float-exit:active {
  transform: scale(0.97);
  background: rgba(160, 48, 48, 0.92);
}

.gd-page.table-page.gd-mobile-table .gd-status {
  flex-shrink: 0;
  margin: 0 2.5rem 0.2rem 0;
  padding: 0.2rem 0.45rem;
  font-size: 0.72rem;
  gap: 0.35rem 0.55rem;
  border-radius: 8px;
}
.gd-page.table-page.gd-mobile-table .gd-level-chip {
  padding: 0.08rem 0.2rem 0.08rem 0.3rem;
  gap: 0.2rem;
}
.gd-page.table-page.gd-mobile-table .gd-level-chip-label { font-size: 0.62rem; }
.gd-page.table-page.gd-mobile-table .gd-level-chip-rank {
  font-size: 0.85rem;
  min-width: 1.35rem;
  height: 1.35rem;
}

.gd-page.table-page.gd-mobile-table .gd-table-stage {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0.1rem 0.15rem;
  border-radius: 10px;
  gap: 0.15rem 0.25rem;
  /* Narrow side columns for compact player panels (大掼蛋-style) */
  grid-template-columns: minmax(3.6rem, 11vw) minmax(0, 1fr) minmax(3.6rem, 11vw);
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-areas:
    ".    top  ."
    "left mid  right"
    "bot  bot  bot";
}

.gd-page.table-page.gd-mobile-table .gd-seat-slot.top {
  max-width: min(22rem, 72vw);
  width: auto;
  justify-self: center;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right {
  max-width: 4.6rem;
  width: 100%;
  align-self: center;
  justify-self: center;
}

/*
 * Other three seats — left/right stay compact vertical panels;
 * partner (top) is a short horizontal strip to free vertical space.
 */
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-chip,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-chip,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-chip {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.12rem;
  padding: 0.2rem 0.2rem 0.25rem;
  text-align: center;
  border-radius: 10px;
  border-top-width: 2px;
  background: rgba(0, 0, 0, 0.22);
  min-height: 0;
  width: 100%;
  max-width: 4.6rem;
  box-sizing: border-box;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-chip {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  max-width: none;
  width: max-content;
  padding: 0.12rem 0.45rem 0.12rem 0.18rem;
  text-align: left;
}

.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-avatar-row,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-avatar-row,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-avatar-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-avatar-row {
  flex-direction: row;
  flex-shrink: 0;
}

.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-chip .gd-avatar,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-chip .gd-avatar,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-chip .gd-avatar {
  width: 2.35rem;
  height: 2.35rem;
  font-size: 0.78rem;
  margin: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-chip .gd-avatar {
  width: 2.1rem;
  height: 2.1rem;
  font-size: 0.72rem;
}

.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-name,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-name,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-name {
  display: block;
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-name {
  max-width: 4.2rem;
  flex-shrink: 1;
  min-width: 0;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-name .gd-badge,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-name .gd-badge,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-name .gd-badge,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-name .gd-icon,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-name .gd-icon,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-name .gd-icon,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-name .gd-place-badge,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-name .gd-place-badge,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-name .gd-place-badge {
  display: none;
}

.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-role,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-role,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-role,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-score,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-score,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-score {
  display: none;
}

/* Tier as compact banner under avatar (新手 / 学徒 / …) */
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-tier,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-tier,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-tier {
  display: inline-block;
  margin: 0;
  padding: 0.06rem 0.35rem;
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: #1a1408;
  background: linear-gradient(180deg, #f0c982 0%, #c4a35a 100%);
  border: 1px solid rgba(255, 230, 170, 0.55);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-chip.team-b .gd-seat-tier,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-chip.team-b .gd-seat-tier {
  background: linear-gradient(180deg, #7ec8ef 0%, #3d9ecd 100%);
  color: #061820;
  border-color: rgba(180, 230, 255, 0.45);
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-chip.partner .gd-seat-tier {
  background: linear-gradient(180deg, #f6d28a 0%, #e08a4c 55%, #c45a2f 100%);
  color: #fff8ef;
  border-color: rgba(255, 210, 150, 0.55);
}

.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-card-backs,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-card-backs,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-card-backs {
  margin: 0.05rem 0 0;
  gap: 0.15rem;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-card-backs {
  margin: 0;
  flex-shrink: 0;
  align-items: center;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-card-backs .gd-pcard.mini,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-card-backs .gd-pcard.mini,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-card-backs .gd-pcard.mini {
  width: 1.05rem;
  height: 1.4rem;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-card-backs-count,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-card-backs-count,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-card-backs-count {
  font-size: 0.62rem;
  min-width: 1.1rem;
  padding: 0.02rem 0.2rem;
}

.gd-page.table-page.gd-mobile-table .gd-seat-timer-slot {
  min-height: 1.45rem;
  margin-top: 0.08rem;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-countdown-ring.gd-seat-turn-timer,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-countdown-ring.gd-seat-turn-timer,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-countdown-ring.gd-seat-turn-timer {
  margin: 0;
  width: 1.35rem;
  height: 1.35rem;
  font-size: 0.55rem;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-tier {
  flex-shrink: 0;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-countdown-ring.gd-seat-turn-timer::before,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-countdown-ring.gd-seat-turn-timer::before,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-countdown-ring.gd-seat-turn-timer::before {
  width: 1.05rem;
  height: 1.05rem;
}

.gd-page.table-page.gd-mobile-table .gd-seat-relation {
  bottom: -0.15rem;
  font-size: 0.48rem;
  padding: 0 0.18rem;
}
.gd-page.table-page.gd-mobile-table .gd-seat-first {
  top: -0.18rem;
  right: -0.22rem;
  font-size: 0.48rem;
}

.gd-page.table-page.gd-mobile-table .gd-center-play {
  min-height: 0;
  padding: 0.25rem 0.35rem;
  border-width: 0.28rem;
  border-radius: 22px;
  overflow: hidden;
}
/* Landscape wait panel: horizontal ring + compact actions (avoid vertical clip) */
.gd-page.table-page.gd-mobile-table .gd-wait-panel {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.35rem 0.75rem;
  max-width: min(40rem, 96%);
  padding: 0.2rem 0.35rem;
}
.gd-page.table-page.gd-mobile-table .gd-wait-ring {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0;
  grid-template-columns: unset;
}
.gd-page.table-page.gd-mobile-table .gd-wait-slot {
  width: 2.15rem;
  height: 2.15rem;
  flex: 0 0 auto;
}
.gd-page.table-page.gd-mobile-table .gd-wait-count {
  margin: 0;
  font-size: 0.85rem;
  white-space: nowrap;
}
.gd-page.table-page.gd-mobile-table .gd-wait-panel .gd-btn {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.bottom {
  min-height: 0;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.bottom .gd-seat-chip.mine,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.bottom .gd-seat-chip.sit-open {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem 0.65rem;
  padding: 0.28rem 0.65rem;
  max-width: min(36rem, 96%);
  margin: 0 auto;
  text-align: left;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.bottom .gd-seat-chip.mine .gd-muted,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.bottom .gd-seat-chip.sit-open .gd-muted {
  display: none;
}
.gd-page.table-page.gd-mobile-table .gd-seat-slot.top .gd-seat-chip.sit-open,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.left .gd-seat-chip.sit-open,
.gd-page.table-page.gd-mobile-table .gd-seat-slot.right .gd-seat-chip.sit-open {
  gap: 0.1rem;
  padding: 0.15rem 0.18rem 0.2rem;
  max-width: 3.8rem;
}
.gd-page.table-page.gd-mobile-table .gd-sit-btn {
  min-height: 0;
  padding: 0.18rem 0.35rem;
  font-size: 0.68rem;
  line-height: 1.1;
}
.gd-page.table-page.gd-mobile-table .gd-overlay-panel {
  top: 34%;
  width: min(20rem, 72%);
  max-height: calc(100% - 5.4rem);
  padding: 0.45rem 0.7rem 0.55rem;
}
.gd-page.table-page.gd-mobile-table .gd-overlay-panel.gd-tribute-return {
  width: min(36rem, 94%);
  max-height: calc(100% - 4.8rem);
}
.gd-page.table-page.gd-mobile-table .gd-overlay-panel h3 {
  font-size: 0.95rem;
}
.gd-page.table-page.gd-mobile-table .gd-overlay-panel .gd-cards {
  max-height: 3.4rem;
  overflow: hidden;
}
.gd-page.table-page.gd-mobile-table .gd-overlay-panel.gd-tribute-return .gd-cards {
  max-height: none;
  overflow: visible;
}
.gd-page.table-page.gd-mobile-table .gd-hand-band {
  gap: 0.25rem;
  align-items: center;
}
.gd-page.table-page.gd-mobile-table .gd-countdown-ring.gd-hand-timer {
  width: 1.85rem;
  height: 1.85rem;
  font-size: 0.68rem;
  margin: 0 0 0 0.05rem;
}
.gd-page.table-page.gd-mobile-table .gd-countdown-ring.gd-hand-timer::before {
  width: 1.4rem;
  height: 1.4rem;
}
.gd-page.table-page.gd-mobile-table .gd-center-play::before {
  font-size: 3.5rem;
}
.gd-page.table-page.gd-mobile-table .gd-center-play .gd-cards .gd-pcard.mini {
  width: 1.7rem;
  height: 2.35rem;
}
.gd-page.table-page.gd-mobile-table .gd-center-play .gd-cards .gd-pcard.mini .gd-pcard-pip {
  font-size: 0.88rem;
}
.gd-page.table-page.gd-mobile-table .gd-bottom-turn-bar {
  display: none;
}

/* Bottom: own hand must fit without horizontal scroll */
.gd-page.table-page.gd-mobile-table .gd-seat-slot.bottom {
  min-width: 0;
  max-width: 100%;
  min-height: 4.6rem;
}
.gd-page.table-page.gd-mobile-table .gd-hand-band::before {
  flex-basis: 1.85rem;
  width: 1.85rem;
  height: 1.85rem;
}
.gd-page.table-page.gd-mobile-table .gd-my-score {
  display: none;
}
.gd-page.table-page.gd-mobile-table .gd-hand-label {
  bottom: calc(100% + 0.06rem);
  margin: 0;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
}
.gd-page.table-page.gd-mobile-table .gd-hand-label-type,
.gd-page.table-page.gd-mobile-table .gd-hand-label-rank {
  font-size: 0.78rem;
}
.gd-page.table-page.gd-mobile-table .gd-bottom-turn-bar {
  margin-bottom: 0.15rem;
  padding: 0.12rem 0.4rem;
}
.gd-page.table-page.gd-mobile-table .gd-my-hand {
  border-radius: 8px 8px 0 0;
  padding: 0.15rem 0.25rem 0.05rem;
  background: rgba(0, 0, 0, 0.32);
}
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns {
  overflow-x: auto;
  overflow-y: hidden;
  width: 100%;
  max-width: 100%;
  justify-content: center;
  /* No column overlap — leftover width helps tap targets */
  gap: 0.18rem;
  padding: 1.45rem 0.15rem 0.05rem;
  -webkit-overflow-scrolling: touch;
}
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-rank-col {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 2.55rem;
  margin-left: 0;
  /* +10% vs prior clamp(2.15rem, 16dvh, 3.05rem) */
  --card-h: clamp(2.35rem, 17.6dvh, 3.35rem);
  /* Keep rank + suit visible even in tall stacks */
  /* One-line corner peek only */
  --stack: max(1.05rem, min(1.2rem, calc(4.5rem / var(--n, 1))));
}
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns > .gd-rank-col:first-child {
  margin-left: 0;
}
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns .gd-pcard:not(.mini) {
  width: clamp(1.7rem, 5.6vw, 2.55rem);
  max-width: 2.55rem;
  height: var(--card-h);
}
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns .gd-pcard:not(.mini) .gd-pcard-pip {
  font-size: clamp(0.95rem, 2.8vw, 1.28rem);
}
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns .gd-pcard.sel,
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns .gd-pcard.sel:hover,
.gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns .gd-pcard.interactive.sel:hover {
  transform: translateY(-0.65rem);
  transition-duration: 0.05s;
}
.gd-page.table-page.gd-mobile-table .gd-pcard-joker-text {
  font-size: clamp(0.3rem, 1.55vw, 0.4rem);
  letter-spacing: 0;
  top: 0.08rem;
  left: 0.1rem;
}
.gd-page.table-page.gd-mobile-table .gd-rank-col-count {
  top: -0.85rem;
  font-size: 0.55rem;
  padding: 0.02rem 0.22rem;
}
.gd-page.table-page.gd-mobile-table .gd-action-bar {
  position: static;
  padding: 0.12rem 0.35rem max(0.12rem, env(safe-area-inset-bottom));
  border-radius: 0 0 8px 8px;
  gap: 0.25rem;
}
.gd-page.table-page.gd-mobile-table .gd-action-tools {
  gap: 0.25rem;
}
.gd-page.table-page.gd-mobile-table .gd-action-main {
  gap: 0.4rem;
}
.gd-page.table-page.gd-mobile-table .gd-tool-btn {
  min-width: 2rem;
  min-height: 1.75rem;
  padding: 0.08rem 0.18rem;
  border-radius: 7px;
}
.gd-page.table-page.gd-mobile-table .gd-tool-glyph {
  font-size: 0.9rem;
}
.gd-page.table-page.gd-mobile-table .gd-tool-text { display: none; }
.gd-page.table-page.gd-mobile-table .gd-suit-tools {
  min-width: 6.9rem;
  gap: 0.12rem;
}
.gd-page.table-page.gd-mobile-table .gd-suit-btn {
  width: 1.58rem;
  height: 1.58rem;
  font-size: 0.92rem;
}
.gd-page.table-page.gd-mobile-table .gd-play-btn {
  min-height: 1.85rem;
  min-width: 4rem;
  padding: 0.22rem 0.7rem;
  font-size: 0.88rem;
  border-radius: 8px;
}

/* Portrait: force rotate overlay; hide table until landscape */
.gd-page.table-page.gd-mobile-table.gd-need-landscape .gd-status,
.gd-page.table-page.gd-mobile-table.gd-need-landscape .gd-table-stage,
.gd-page.table-page.gd-mobile-table.gd-need-landscape .gd-your-turn-banner,
.gd-page.table-page.gd-mobile-table.gd-need-landscape .gd-table-float-tools {
  visibility: hidden;
  pointer-events: none;
}
.gd-page.table-page.gd-mobile-table.gd-need-landscape .gd-rotate-gate:not([hidden]) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(47, 107, 79, 0.55), transparent 60%),
    rgba(8, 18, 14, 0.92);
}

/* Tap required for fullscreen / orientation.lock (browser policy) */
.gd-immersive-gate {
  display: none;
}
.gd-page.table-page.gd-mobile-table .gd-immersive-gate:not([hidden]) {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 48;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(47, 107, 79, 0.5), transparent 60%),
    rgba(8, 18, 14, 0.88);
}
.gd-immersive-gate-card {
  text-align: center;
  max-width: 18rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}
.gd-immersive-gate-card strong {
  font-size: 1.15rem;
}
.gd-immersive-gate-card p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.88rem;
  line-height: 1.4;
}
.gd-immersive-gate-card .gd-btn {
  min-width: 10rem;
  min-height: 2.75rem;
}
.gd-rotate-gate-card {
  text-align: center;
  max-width: 18rem;
}
.gd-rotate-gate-card strong {
  display: block;
  font-size: 1.15rem;
  margin: 0.5rem 0 0.35rem;
}
.gd-rotate-gate-card p {
  margin: 0;
  opacity: 0.85;
  font-size: 0.88rem;
  line-height: 1.4;
}
.gd-rotate-gate-ico {
  display: inline-block;
  font-size: 2.4rem;
  color: var(--accent);
  animation: gd-rotate-hint 1.6s ease-in-out infinite;
}
@keyframes gd-rotate-hint {
  0%, 100% { transform: rotate(0deg); }
  40% { transform: rotate(90deg); }
  60% { transform: rotate(90deg); }
}

@media (orientation: landscape) and (max-height: 420px) {
  .gd-page.table-page.gd-mobile-table .gd-my-hand .gd-rank-col {
    /* +10% vs prior clamp(1.95rem, 22dvh, 2.7rem) */
    --card-h: clamp(2.15rem, 24dvh, 2.95rem);
    --stack: min(1.05rem, calc(4.2rem / var(--n, 1)));
  }
  .gd-page.table-page.gd-mobile-table .gd-my-hand .gd-cards.columns {
    padding-top: 1.65rem;
    gap: 0.14rem;
  }
  .gd-page.table-page.gd-mobile-table .gd-center-play {
    padding: 0.2rem 0.3rem;
  }
}

/* —— Profile / Friends social UI —— */
.gd-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #c23b22;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}
button.gd-link {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.gd-drawer-backdrop,
.gd-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 18, 28, 0.55);
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  overscroll-behavior: none;
}
.gd-modal-backdrop {
  justify-content: center;
  align-items: center;
  padding: 1rem;
  z-index: 95;
}
.gd-friends-drawer {
  width: min(24rem, 100vw);
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  background: var(--panel, #1a2433);
  color: var(--text, #eef3f8);
  box-shadow: -8px 0 28px rgba(0,0,0,0.35);
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
  animation: gd-drawer-in 0.22s ease;
}
@keyframes gd-drawer-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.gd-drawer-header,
.gd-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.gd-drawer-header h3,
.gd-modal-header h3 { margin: 0; font-size: 1.05rem; }
.gd-btn-icon {
  background: transparent;
  border: 0;
  color: inherit;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0.75;
}
.gd-drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0.75rem 1rem 1.25rem;
}
.gd-tab-bar {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.gd-tab-bar button {
  flex: 1;
  border: 0;
  border-radius: 0.45rem;
  padding: 0.4rem 0.35rem;
  background: transparent;
  color: inherit;
  cursor: pointer;
  opacity: 0.7;
  font-size: 0.85rem;
}
.gd-tab-bar button.active {
  background: rgba(255,255,255,0.08);
  opacity: 1;
  font-weight: 600;
}
.gd-friend-item,
.gd-partner-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.gd-friends-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.gd-friends-pager .gd-btn-sm:disabled {
  opacity: 0.4;
  cursor: default;
}
.gd-friend-avatar-wrap { position: relative; }
.gd-status-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  border: 2px solid var(--panel, #1a2433);
  background: #6b7785;
}
.gd-status-dot.online { background: #2fbf71; }
.gd-status-dot.in-game { background: #f0a202; }
.gd-friend-info,
.gd-partner-info { flex: 1; min-width: 0; }
button.gd-friend-open-profile {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
  font: inherit;
}
button.gd-friend-open-profile:hover .gd-friend-name {
  text-decoration: underline;
  color: var(--accent, #7dffb2);
}
.gd-friend-avatar-wrap.gd-friend-open-profile {
  position: relative;
  flex-shrink: 0;
}
.gd-friend-name-row { display: flex; align-items: center; gap: 0.4rem; }
.gd-friend-name,
.gd-partner-name,
.gd-profile-name { font-weight: 650; }
.gd-friend-status,
.gd-partner-stats,
.gd-status-text { font-size: 0.8rem; opacity: 0.75; margin: 0.15rem 0 0; }
.gd-status-badge {
  font-size: 0.68rem;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.gd-status-badge.online { background: rgba(47,191,113,0.18); color: #7dffb2; }
.gd-status-badge.in-game { background: rgba(240,162,2,0.2); color: #ffd27a; }
.gd-friend-actions { display: flex; flex-direction: column; gap: 0.25rem; }
.gd-btn-sm {
  border: 0;
  border-radius: 0.35rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.gd-btn-sm.gd-btn-primary { background: var(--accent, #3d8bfd); color: #fff; }
.gd-btn-sm.gd-btn-secondary { background: rgba(255,255,255,0.1); color: inherit; }
.gd-btn-sm.gd-btn-danger-text { background: transparent; color: #ff8d7a; }
.gd-tag-muted { font-size: 0.75rem; opacity: 0.55; }
.gd-requests-heading {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.8rem;
  font-weight: 650;
  opacity: 0.85;
}
.gd-requests-heading:first-child { margin-top: 0.15rem; }
.gd-search-bar { display: flex; gap: 0.4rem; margin-bottom: 0.75rem; }
.gd-center-padding { padding: 1.25rem 0.5rem; text-align: center; }
.gd-profile-modal {
  width: min(34rem, 100%);
  max-height: min(90vh, 44rem);
  overflow: auto;
  background: var(--panel, #1a2433);
  color: var(--text, #eef3f8);
  border-radius: 0.85rem;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.gd-modal-body { padding: 1rem; }
.gd-profile-header-card {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  margin-bottom: 0.85rem;
}
.gd-profile-avatar-wrap { position: relative; }
.gd-flair-badge {
  position: absolute;
  right: -0.35rem;
  bottom: -0.2rem;
  font-size: 1rem;
}
.gd-profile-name-row { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.gd-tier-badge {
  font-size: 0.72rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(61,139,253,0.2);
  color: #9ec5ff;
}
.gd-profile-sub-row { display: flex; gap: 0.65rem; flex-wrap: wrap; margin-top: 0.25rem; font-size: 0.82rem; }
.gd-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}
.gd-stat-card {
  background: rgba(255,255,255,0.05);
  border-radius: 0.55rem;
  padding: 0.65rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.gd-stat-label { font-size: 0.75rem; opacity: 0.7; }
.gd-stat-val { font-size: 1.15rem; font-weight: 700; }
.gd-stat-val.gd-highlight { color: #7dffb2; }
.gd-stat-sub { font-size: 0.72rem; opacity: 0.65; }
.gd-edit-form .gd-form-group { margin-bottom: 0.85rem; }
.gd-edit-form label { display: block; margin-bottom: 0.3rem; font-size: 0.85rem; }
.gd-form-actions { margin-top: 0.75rem; }
.gd-success { color: #7dffb2; }
.gd-avatar-lg { width: 4rem; height: 4rem; font-size: 1.35rem; }
.gd-table-invite-toast {
  position: fixed;
  right: 1rem;
  top: max(1rem, env(safe-area-inset-top, 0px));
  bottom: auto;
  z-index: 90;
  max-width: min(22rem, calc(100vw - 2rem));
  animation: gd-invite-in 0.28s ease;
}
.gd-message-toast {
  position: fixed;
  right: 1rem;
  top: max(5.4rem, calc(env(safe-area-inset-top, 0px) + 4.4rem));
  bottom: auto;
  z-index: 120;
  max-width: min(22rem, calc(100vw - 2rem));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem;
  animation: gd-invite-in 0.28s ease;
}
.gd-message-toast-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(212, 175, 106, 0.42);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(180deg, rgba(54, 44, 30, 0.97) 0%, rgba(34, 28, 20, 0.98) 100%);
  color: var(--cream, #f3e6c8);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  font: inherit;
}
.gd-message-toast-card strong {
  display: block;
  margin-bottom: 0.2rem;
}
.gd-message-toast-preview {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.gd-message-toast-cta {
  display: inline-block;
  margin-top: 0.55rem;
  color: #ffe6a8;
  font-size: 0.82rem;
}
.gd-message-toast-dismiss {
  align-self: start;
  width: 1.7rem;
  height: 1.7rem;
  border: 1px solid rgba(212, 175, 106, 0.3);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  color: var(--cream, #f3e6c8);
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
}
@keyframes gd-invite-in {
  from { transform: translateY(-0.6rem); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.gd-table-invite-card {
  background: var(--panel, #1a2433);
  color: var(--text, #eef3f8);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 12px 36px rgba(0,0,0,0.4);
}
.gd-table-invite-card strong { display: block; margin-bottom: 0.25rem; }
.gd-table-invite-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.45rem;
  margin-top: 0.75rem;
}
.gd-social-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.55rem;
  margin-top: 0.85rem;
}
.gd-board-tabs {
  padding: 0.45rem 0 0;
  border-bottom: 0;
}
.gd-board-tabs button { flex: 1; }
.gd-profile-friend-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.gd-reaction-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
}
.gd-reaction-target-label {
  font-size: 0.72rem;
  opacity: 0.7;
  margin-right: 0.05rem;
}
.gd-reaction-sep {
  width: 1px;
  height: 1.1rem;
  background: rgba(255,255,255,0.18);
  margin: 0 0.1rem;
}
.gd-social-tools {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.gd-social-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 0.35rem);
  z-index: 40;
  min-width: min(18rem, 72vw);
  max-width: min(22rem, 88vw);
  padding: 0.55rem 0.65rem;
  border-radius: 0.65rem;
  background: rgba(18, 28, 38, 0.96);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 10px 28px rgba(0,0,0,0.45);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.gd-social-panel .gd-emote-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
}
.gd-chip-btn {
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
  color: inherit;
  border-radius: 999px;
  padding: 0.18rem 0.45rem;
  font-size: 0.72rem;
  line-height: 1.2;
  cursor: pointer;
}
.gd-chip-btn.active,
.gd-emote-btn.active {
  outline: 2px solid var(--accent, #7dffb2);
  outline-offset: 1px;
  border-color: transparent;
}
.gd-tool-btn.on {
  border-color: rgba(125, 255, 178, 0.45);
  background: rgba(125, 255, 178, 0.12);
}
.gd-reaction-bubble {
  animation: gd-reaction-pop 1.4s ease forwards;
}
@keyframes gd-reaction-pop {
  0% { transform: scale(0.6); opacity: 0; }
  18% { transform: scale(1.15); opacity: 1; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0; }
}

/* Mobile landscape: keep action bar to sort/hint/social + play; panel floats above hand */
.gd-page.table-page.gd-mobile-table .gd-social-panel {
  left: 0;
  right: auto;
  bottom: calc(100% + 0.25rem);
  min-width: min(16.5rem, 70vw);
  max-width: min(20rem, 78vw);
  padding: 0.4rem 0.5rem;
}
.gd-page.table-page.gd-mobile-table .gd-social-panel .gd-emote-btn {
  width: 1.85rem;
  height: 1.85rem;
}
.gd-page.table-page.gd-mobile-table .gd-chip-btn {
  padding: 0.14rem 0.38rem;
  font-size: 0.68rem;
}
@media (orientation: landscape) and (max-height: 500px) {
  .gd-action-tools .gd-emote-bar-inline,
  .gd-action-tools .gd-reaction-bar:not(.gd-social-panel .gd-reaction-bar) {
    display: none;
  }
  .gd-social-panel {
    max-height: min(42vh, 11rem);
    overflow: auto;
  }
}

/* —— Admin dashboard —— */
.gd-admin-wrap {
  max-width: 64rem;
  margin: 1rem auto;
  padding: 1rem 1.25rem;
}
.gd-admin-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
  gap: 0.65rem;
  margin: 0.75rem 0 1rem;
}
.gd-admin-kpi {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  padding: 0.7rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 4.2rem;
}
.gd-admin-kpi .gd-admin-kpi-label {
  font-size: 0.72rem;
  opacity: 0.7;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.gd-admin-kpi .gd-admin-kpi-val {
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.gd-admin-kpi .gd-admin-kpi-sub {
  font-size: 0.72rem;
  opacity: 0.65;
}
.gd-admin-kpi.ok { border-color: rgba(125, 255, 178, 0.35); }
.gd-admin-kpi.ok .gd-admin-kpi-val { color: #7dffb2; }
.gd-admin-kpi.warn { border-color: rgba(255, 196, 92, 0.45); }
.gd-admin-kpi.warn .gd-admin-kpi-val { color: #ffc45c; }
.gd-admin-kpi.danger { border-color: rgba(255, 120, 120, 0.45); }
.gd-admin-kpi.danger .gd-admin-kpi-val { color: #ff8a8a; }
.gd-admin-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 0.35rem;
}
.gd-admin-chart-card {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 0.65rem;
  padding: 0.75rem 0.85rem 0.9rem;
  min-height: 10rem;
}
.gd-admin-chart-card h3 {
  margin: 0 0 0.65rem;
  font-size: 0.92rem;
  font-weight: 600;
}
.gd-admin-chart-card.span-2 { grid-column: 1 / -1; }
.gd-admin-hbar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.gd-admin-hbar-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.2rem;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
}
.gd-admin-hbar-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
.gd-admin-hbar-fill {
  height: 100%;
  border-radius: 999px;
  background: #5b9fd4;
  min-width: 0;
  transition: width 0.25s ease;
}
.gd-admin-hbar-fill.lobby { background: #5b9fd4; }
.gd-admin-hbar-fill.table { background: #e0a04a; }
.gd-admin-hbar-fill.phase { background: #7bc47f; }
.gd-admin-hbar-fill.arena { background: #9b8fd4; }
.gd-admin-hbar-count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}
.gd-admin-trend-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  margin-bottom: 0.55rem;
}
.gd-admin-trend-toolbar .gd-btn.slim {
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
}
.gd-admin-spark {
  width: 100%;
  height: 9.5rem;
  display: block;
}
.gd-admin-spark-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  opacity: 0.85;
}
.gd-admin-spark-legend i {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 0.15rem;
  margin-right: 0.3rem;
  vertical-align: -0.05rem;
}
.gd-admin-spark-legend .m { background: #5b9fd4; }
.gd-admin-spark-legend .p { background: #7dffb2; }
.gd-admin-spark-legend .a { background: #ffc45c; }
.gd-admin-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.gd-admin-empty {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
  opacity: 0.65;
}
.gd-admin-users-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.gd-admin-users-meta {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
}
.gd-admin-page-size {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}
.gd-admin-page-size select {
  width: auto;
  min-width: 3.5rem;
  padding: 0.25rem 0.4rem;
}
.gd-admin-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
}
.gd-admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.gd-admin-table th,
.gd-admin-table td {
  padding: 0.55rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
}
.gd-admin-table th {
  background: rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  font-weight: 600;
}
.gd-admin-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.04);
}
.gd-admin-table tbody tr.is-locked {
  opacity: 0.72;
}
.gd-admin-table td.gd-admin-empty {
  text-align: center;
  padding: 1.25rem;
  opacity: 0.65;
}
.gd-admin-sort {
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.gd-admin-sort:hover {
  color: var(--accent, #c4a35a);
}
.gd-admin-uid {
  font-size: 0.72rem;
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gd-admin-flags {
  white-space: nowrap;
}
.gd-admin-flag {
  display: inline-block;
  margin: 0.1rem 0.15rem 0.1rem 0;
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 600;
}
.gd-admin-flag.admin { background: rgba(155, 143, 212, 0.35); color: #d4ccff; }
.gd-admin-flag.test { background: rgba(91, 159, 212, 0.3); color: #9fd0ff; }
.gd-admin-flag.locked { background: rgba(255, 120, 120, 0.25); color: #ffb0b0; }
.gd-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  min-width: 14rem;
}
.gd-admin-actions .gd-btn.slim {
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.2;
}
.gd-admin-pager {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
@media (max-width: 720px) {
  .gd-admin-charts { grid-template-columns: 1fr; }
  .gd-admin-chart-card.span-2 { grid-column: auto; }
  .gd-admin-hbar-row { grid-template-columns: 4.5rem 1fr 2rem; }
}

/* Message inbox */
.gd-messages-shell {
  display: grid;
  grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-top: 0.75rem;
}

.gd-messages-sidebar,
.gd-messages-thread {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 0.9rem;
}

.gd-messages-sidebar-head h2,
.gd-messages-thread-head h3 {
  margin: 0;
}

.gd-messages-tabs {
  display: flex;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.gd-messages-tabs button,
.gd-message-item,
.gd-messages-search-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border-radius: 12px;
}

.gd-messages-tabs button {
  padding: 0.45rem 0.75rem;
}

.gd-messages-tabs button.active,
.gd-message-item.active {
  background: rgba(196, 163, 90, 0.18);
  border-color: rgba(196, 163, 90, 0.45);
}

.gd-messages-compose {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  margin: 0.9rem 0;
  align-items: center;
}

.gd-messages-compose .gd-input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.gd-messages-compose .gd-btn-primary {
  white-space: nowrap;
  flex-shrink: 0;
}

.gd-messages-search-results,
.gd-messages-list,
.gd-messages-bubbles {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.gd-message-item,
.gd-messages-search-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  text-align: left;
}

.gd-message-item-main {
  min-width: 0;
  flex: 1;
}

.gd-message-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.gd-message-item-preview {
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(243, 239, 230, 0.76);
  font-size: 0.9rem;
}

.gd-messages-thread-head,
.gd-messages-thread-actions,
.gd-messages-send-row,
.gd-profile-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: space-between;
}

.gd-messages-thread-head {
  margin-bottom: 0.85rem;
}

.gd-messages-bubbles {
  min-height: 18rem;
}

.gd-message-bubble-wrap {
  display: flex;
}

.gd-message-bubble-wrap.mine {
  justify-content: flex-end;
}

.gd-message-bubble {
  max-width: min(36rem, 88%);
  border-radius: 14px;
  padding: 0.7rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.gd-message-bubble-wrap.mine .gd-message-bubble {
  background: rgba(196, 163, 90, 0.2);
  border-color: rgba(196, 163, 90, 0.35);
}

.gd-message-bubble-body {
  white-space: pre-wrap;
  word-break: break-word;
}

.gd-message-bubble-meta {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: rgba(243, 239, 230, 0.64);
}

.gd-messages-composer {
  margin-top: 0.95rem;
}

.gd-messages-textarea {
  min-height: 6rem;
  width: 100%;
  resize: vertical;
  box-sizing: border-box;
}

.gd-messages-empty-thread {
  min-height: 18rem;
  display: grid;
  place-items: center;
  color: rgba(243, 239, 230, 0.72);
  text-align: center;
}

@media (max-width: 900px) {
  .gd-messages-shell {
    grid-template-columns: 1fr;
  }
}


