/* Mobile-first: 375px base */

body {
  margin: 0;
}

.gb-root {
  padding: 12px;
  background-color: #1a5c30;
  background-image: url("/assets/boards/board-1-1d85e151.jpg");
  background-repeat: repeat;
  margin-top: 52px;
  height: calc(100vh - 52px);
  box-sizing: border-box;
  color: white;
  display: flex;
  flex-direction: column;
  overflow: visible;
}

.gb-state {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 2px solid #10b981;
  border-radius: 12px;
  background-color: rgba(16, 185, 129, 0.2);
  color: #fffef0;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.gb-state--completed {
  border-color: #f59e0b;
  background-color: rgba(245, 158, 11, 0.2);
  color: #fffef0;
}

.gb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: nowrap;
  padding: 4px 8px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.gb-header > .gb-last-plays {
  flex: 1;
  margin: 0;
  background: none;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.gb-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.gb-back-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  line-height: 1;
  transition: background 0.15s ease;
}

.gb-back-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.gb-spectator-badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 4px 10px;
}

/* Chat trigger button in the header */
.gb-chat-trigger {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  line-height: 1;
  display: flex;
  align-items: center;
}

.gb-chat-trigger--unread {
  border-color: rgba(106, 196, 232, 0.6);
  background: rgba(106, 196, 232, 0.15);
}

.gb-chat-trigger-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e05252;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ── Table layout ─────────────────────────────────────── */

.gb-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-height: 0;
  justify-content: center;
  overflow: visible;
  margin-bottom: 20px;
}

.gb-table-top {
  display: flex;
  justify-content: center;
}

.gb-table-mid {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.gb-table-board {
  flex: 1;
  min-width: 0;
}

/* ── Seats ────────────────────────────────────────────── */

.gb-seat {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gb-seat--top {
  padding: 2px 0;
}

.gb-seat--bottom {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 0;
}

.gb-seat--left,
.gb-seat--right {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 44px;
  flex-shrink: 0;
}

.gb-seat-tiles {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.gb-seat-tiles--column {
  flex-direction: column;
}

.gb-seat-tiles--row {
  flex-direction: row;
}

.gb-seat-tile {
  flex-shrink: 0;
}

.gb-seat-tile--small .gb-pip-half {
  width: 28px;
  height: 28px;
  padding: 3px;
}

.gb-seat-tile--small .gb-tile-divider {
  width: 2px;
  height: 20px;
}

.gb-seat-tile--small.gb-tile--vertical .gb-tile-divider {
  width: 20px;
  height: 2px;
}
 
.gb-seat-tile--small .gb-pip-dot::after {
  width: 5px;
  height: 5px;
}

.gb-edge-name {
  writing-mode: vertical-lr;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0.55;
  align-self: center;
  flex-shrink: 0;
}

.gb-edge-name--left {
  transform: rotate(180deg);
}

.gb-seat--offline {
  opacity: 0.45;
}

.gb-seat--highlighting {
}

.gb-seat--winner {
  border: 2px solid #ffd700;
  background-color: rgba(255, 215, 0, 0.12);
}

/* ── Seat meta ────────────────────────────────────────── */

.gb-seat-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.gb-seat-name {
  font-size: 11px;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gb-seat-score {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

/* ── Avatar ───────────────────────────────────────────── */

.gb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.gb-avatar--turn {
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.gb-avatar--me {
  background: rgba(255, 255, 255, 0.18);
}

.gb-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gb-avatar--online  { border-color: rgba(74, 222, 128, 1.0); }
.gb-avatar--away    { border-color: rgba(74, 222, 128, 0.35); }
.gb-avatar--offline { border-color: rgba(74, 222, 128, 0.1); }

/* ── Tile backs (face-down) ───────────────────────────── */

.gb-tile-back {
  background: #fffef0;
  border: 1.5px solid #2a2a2a;
  border-radius: 3px;
  position: relative;
  flex-shrink: 0;
}

.gb-tile-back::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 1px;
}

/* ── Board ────────────────────────────────────────────── */

.gb-board {
  position: relative;
  margin: 8px 0;
}

/* Ghost tile shown at a valid board end while dragging */
.gb-tile--ghost {
  opacity: 0.4;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  pointer-events: none;
}

.gb-tile--ghost--active {
  opacity: 0.9;
  background: rgba(16, 185, 129, 0.35);
  animation: gb-ghost-pulse 1s ease-out infinite;
}

@keyframes gb-ghost-pulse {
  0%   { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5), 0 0 0 0   rgba(16, 185, 129, 0.5); }
  70%  { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5), 0 0 0 12px rgba(16, 185, 129, 0);   }
  100% { box-shadow: 0 0 8px rgba(16, 185, 129, 0.5), 0 0 0 0   rgba(16, 185, 129, 0);   }
}

/* Tile in hand currently being dragged — hidden but space preserved */
.gb-tile--dragging {
  opacity: 0 !important;
  transform: translateY(-12px) scale(0.9) !important;
}

/* Flying tile clone that follows the pointer during drag */
.gb-drag-flying {
  position: fixed;
  pointer-events: none;
  z-index: 500;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
  transform: scale(1.08);
  transform-origin: top left;
}

/* Flying tile turns ghost when hovering over a valid drop zone */
.gb-drag-flying--over .gb-tile {
  opacity: 0.4;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  box-shadow: none;
}


/* ── Tile ─────────────────────────────────────────────── */

.gb-tile {
  display: inline-flex;
  align-items: center;
  background: #fffef0;
  border: 2px solid #2a2a2a;
  border-radius: 5px;
  flex-shrink: 0;
  cursor: default;
  user-select: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.gb-tile--playable {
  cursor: grab;
  transform: translateY(-12px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
}

.gb-tile--playable:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.gb-tile--selected {
  border-color: #ff6b35;
}

.gb-tile--vertical {
  flex-direction: column;
}

.gb-tile--vertical .gb-tile-divider {
  width: 22px;
  height: 2px;
}

.gb-tile-divider {
  width: 2px;
  height: 22px;
  background: #2a2a2a;
  flex-shrink: 0;
}

/* ── Pip half ─────────────────────────────────────────── */

.gb-pip-half {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: 30px;
  height: 30px;
  padding: 4px;
  box-sizing: border-box;
}

.gb-pip-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

.gb-pip-dot::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #1a1a1a;
}

/* ── Hand ─────────────────────────────────────────────── */

.gb-hand {
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px 14px;
  margin: 0 -12px -4px;
  overflow: visible;
}

.gb-hand--highlighting {
}

.gb-hand--winner {
  border-top-color: #ffd700;
  background-color: rgba(255, 215, 0, 0.07);
}

.gb-hand-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.gb-hand-player-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
}

.gb-hand-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.55;
}

.gb-hand-action {
  font-size: 11px;
  background: rgba(255, 215, 0, 0.2);
  border: 1px solid rgba(255, 215, 0, 0.5);
  border-radius: 4px;
  padding: 1px 6px;
  color: #ffd700;
  text-transform: capitalize;
}

.gb-hand-tiles {
  display: flex;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  padding-top: 15px;
  padding-bottom: 2px;
}

.gb-hand-empty {
  opacity: 0.4;
  font-style: italic;
  font-size: 14px;
  padding: 8px 0;
}

.gb-hand-drag-hint {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.45);
  padding-top: 6px;
  pointer-events: none;
  animation: gb-hint-fade 3.5s ease forwards;
}

@keyframes gb-hint-fade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  65%  { opacity: 1; }
  100% { opacity: 0; }
}

.gb-hand-holder {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 6px 10px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
  width: fit-content;
  max-width: calc(100% - 24px);
  margin: -15px auto 0;
  overflow: visible;
  clip-path: none;
}

.gb-hand-holder--idle {
  border-color: rgba(255, 254, 235, 0.3);
}

.gb-hand-holder--turn {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.15);
}

@keyframes gb-hand-flash-red {
  0%   { border-color: #ef4444; background-color: rgba(239, 68, 68, 0.15); }
  30%  { border-color: rgba(239, 68, 68, 0.2); background-color: transparent; }
  60%  { border-color: #ef4444; background-color: rgba(239, 68, 68, 0.1); }
  100% { border-color: rgba(255, 254, 235, 0.3); background-color: transparent; }
}

@keyframes gb-play-highlight {
  0%   { border-color: #4ade80; background-color: rgba(74, 222, 128, 0.25); }
  55%  { border-color: #10b981; background-color: rgba(16, 185, 129, 0.12); }
  100% { border-color: rgba(255, 254, 235, 0.3); background-color: transparent; }
}

.gb-hand-holder--passed {
  animation: gb-hand-flash-red 2s ease-out forwards;
}

.gb-hand-holder--highlighting {
  animation: gb-play-highlight 1.2s ease-out forwards;
}

.gb-hand-holder--won {
  border-color: #f59e0b;
}

/* Invisible spacer matching a vertical tile — keeps holder width stable as tiles are played */
.gb-hand-tile-ghost {
  width: 34px;
  height: 66px;
  flex-shrink: 0;
  visibility: hidden;
}

.gb-seat-tiles {
  border: 2px solid transparent;
  border-radius: 14px;
  padding: 8px 10px;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.gb-seat-tiles--idle {
  border-color: rgba(255, 254, 235, 0.3);
}

.gb-seat-tiles--turn {
  border-color: #10b981;
  background-color: rgba(16, 185, 129, 0.12);
}

.gb-seat-tiles--passed {
  animation: gb-hand-flash-red 2s ease-out forwards;
}

.gb-seat-tiles--highlighting {
  animation: gb-play-highlight 1.2s ease-out forwards;
}

.gb-seat-tiles--won {
  border-color: #f59e0b;
}

/* ── Error ────────────────────────────────────────────── */

.gb-error {
  background: rgba(220, 50, 50, 0.2);
  border: 1px solid rgba(220, 50, 50, 0.5);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  color: #ff8888;
  margin-bottom: 10px;
}

.game-complete-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
}

.game-complete-card {
  background: rgba(20, 35, 24, 0.95);
  border: 2px solid #ffd700;
  border-radius: 18px;
  padding: 28px 24px;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.2);
}

.game-complete-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 10px;
}

.game-complete-text {
  font-size: 15px;
  color: #fff;
  margin-bottom: 18px;
  line-height: 1.4;
}

.game-complete-button {
  font-size: 14px;
  padding: 10px 18px;
}

/* ── Last plays ───────────────────────────────────── */

.gb-last-plays {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  margin-bottom: 4px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  font-size: 12px;
}

.gb-last-plays-label {
  font-weight: 600;
  opacity: 0.7;
  white-space: nowrap;
  flex-shrink: 0;
}

.gb-last-plays-list {
  display: flex;
  gap: 4px;
  align-items: center;
  overflow: hidden;
  flex: 1;
  min-width: 0;
}

.gb-last-play {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.gb-last-play-player {
  font-weight: 600;
  color: #7ecf9a;
}

.gb-last-play-action {
  opacity: 0.7;
  font-size: 12px;
}

.gb-last-play-pass {
  font-weight: 700;
  color: #ef4444;
  font-size: 12px;
}

.gb-last-play-tile {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0;
  margin-right: -8px;
}

.gb-last-play-tile .gb-tile {
  margin: 0;
  padding: 0;
}

.gb-last-plays-separator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.gb-last-play-tile .gb-tile {
  transform: scale(0.6);
  transform-origin: left center;
}

/* ── Direction picker ─────────────────────────────────── */

.gb-picker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  z-index: 200;
}

.gb-picker {
  width: 100%;
  background: #152318;
  border-radius: 18px 18px 0 0;
  padding: 20px 16px 36px;
}

.gb-picker-title {
  text-align: center;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.45;
  color: white;
  margin-bottom: 14px;
}

.gb-picker-btn {
  display: block;
  width: 100%;
  padding: 18px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  color: white;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.gb-picker-btn:last-child {
  margin-bottom: 0;
}

.gb-picker-btn:active {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Play animation ───────────────────────────────────── */

/*
 * Anchored at viewport top-left. The Web Animations API (in PlayAnimation.jsx)
 * measures real DOM positions and drives all movement via translate().
 * CSS only handles the 3-D card flip on the inner element.
 */
.gb-play-anim {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  pointer-events: none;
  will-change: transform;
}

.gb-play-perspective {
  perspective: 700px;
}

/* Flip container — starts showing the back, rotates to show the front */
.gb-play-flip {
  transform-style: preserve-3d;
  position: relative;
  width: 44px;
  height: 86px;
}

.gb-play-flip--card {
  transform: rotateY(180deg);
  animation: gb-flip 0.42s ease-in-out 0.18s forwards;
}

@keyframes gb-flip {
  from { transform: rotateY(180deg); }
  to   { transform: rotateY(0deg); }
}

.gb-play-flip-front,
.gb-play-flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gb-play-flip-back {
  transform: rotateY(180deg);
}

/* Full-size ivory tile back used as the card's reverse face */
.gb-tile-back-full {
  width: 44px;
  height: 86px;
  background: #fffef0;
  border: 2px solid #2a2a2a;
  border-radius: 5px;
  position: relative;
}

.gb-tile-back-full::after {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 2px;
}

/* ── Winner announcement ──────────────────────────────── */

.gb-winner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  animation: gb-winner-fade-in 0.4s ease-out;
}

.gb-winner-confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.gb-winner-confetti-piece {
  position: absolute;
  top: -12px;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  opacity: 0.95;
  transform-origin: center;
  animation-name: gb-confetti-fall;
  animation-timing-function: linear;
  animation-iteration-count: 1;
  animation-fill-mode: both;
}
@keyframes gb-confetti-fall {
  0% { transform: translateY(0) rotate(var(--rotate, 0deg)); opacity: 1; }
  100% { transform: translateY(120vh) rotate(calc(var(--rotate, 0deg) + 540deg)); opacity: 0.2; }
}

.gb-winner-card {
  position: relative;
  background: rgba(13, 33, 16, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid #ffd700;
  border-radius: 20px;
  padding: 40px 32px;
  text-align: center;
  max-width: 320px;
  width: 90%;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.25), 0 0 80px rgba(255, 215, 0, 0.1);
  animation: gb-winner-scale-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.gb-winner-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.gb-winner-close:hover {
  color: rgba(255, 255, 255, 0.85);
}

.gb-winner-trophy {
  font-size: 56px;
  margin-bottom: 12px;
  line-height: 1;
}

.gb-winner-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #ffd700;
  opacity: 0.7;
  margin-bottom: 14px;
}

.gb-winner-name {
  font-size: 40px;
  font-weight: 700;
  color: #ffd700;
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  text-shadow: 0 0 24px rgba(255, 215, 0, 0.5);
}

.gb-winner-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.gb-winner-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  justify-content: center;
  align-items: center;
}

.gb-winner-back {
  padding: 8px 16px;
  background: none;
  color: #fffef0;
  text-decoration: none;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.gb-winner-back:hover {
  border-color: #fffef0;
  text-decoration: none;
}

.gb-winner-back:active {
  opacity: 0.8;
}

.gb-winner-play-again {
  padding: 10px 22px;
  background: #10b981;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.gb-winner-play-again:hover {
  background: #059669;
}

.gb-winner-play-again:active {
  transform: scale(0.97);
}

@keyframes gb-winner-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes gb-winner-scale-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Round result + next-round card ──────────────────── */

.gb-round-result-card {
  align-self: center;
  background: rgba(12, 28, 18, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  padding: 10px 18px;
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.55);
  animation: gb-winner-scale-in 0.2s ease;
  white-space: nowrap;
}

.gb-round-result-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.gb-round-result-heading {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.gb-round-result-sub {
  font-size: 12px;
  opacity: 0.55;
}

.gb-round-result-next {
  margin-left: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  flex-shrink: 0;
}

.gb-round-result-next:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ── Chat ────────────────────────────────────────────── */

/* Notification preview strip — fixed bottom-right, appears for 4s on new message */
.gb-chat-preview {
  position: fixed;
  bottom: 16px;
  right: 12px;
  z-index: 250;
  background: rgba(12, 28, 18, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  max-width: 260px;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  display: flex;
  gap: 5px;
  align-items: baseline;
  box-shadow: 0 2px 14px rgba(0,0,0,0.45);
  animation: gb-chat-slide-in 0.2s ease;
}

.gb-chat-preview-player {
  font-weight: 600;
  color: #7ecf9a;
  white-space: nowrap;
  flex-shrink: 0;
}

.gb-chat-preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.gb-chat-preview-open {
  font-size: 11px;
  opacity: 0.55;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Full chat panel — fixed overlay anchored to bottom-right */
.gb-chat-panel {
  position: fixed;
  bottom: 16px;
  right: 12px;
  z-index: 300;
  width: 290px;
  height: 340px;
  background: rgba(12, 28, 18, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 28px rgba(0,0,0,0.55);
  animation: gb-chat-slide-in 0.18s ease;
}

.gb-chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.gb-chat-panel-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.gb-chat-panel-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}

.gb-chat-panel-close:hover { color: #fff; }

.gb-chat-panel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}

.gb-chat-panel-messages::-webkit-scrollbar {
  width: 4px;
}

.gb-chat-panel-messages::-webkit-scrollbar-track {
  background: transparent;
}

.gb-chat-panel-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 2px;
}

.gb-chat-panel-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.32);
}

.gb-chat-empty {
  text-align: center;
  opacity: 0.35;
  font-style: italic;
  font-size: 13px;
  margin: auto;
}

.gb-chat-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gb-chat-msg--mine { align-items: flex-end; }

.gb-chat-msg-meta {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.gb-chat-msg--mine .gb-chat-msg-meta { flex-direction: row-reverse; }

.gb-chat-msg-player {
  font-size: 11px;
  font-weight: 600;
  color: #7ecf9a;
}

.gb-chat-msg--mine .gb-chat-msg-player { color: #6ac4e8; }

.gb-chat-msg-time {
  font-size: 10px;
  opacity: 0.4;
}

.gb-chat-msg-text {
  font-size: 13px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 5px 9px;
  max-width: 210px;
  word-break: break-word;
  line-height: 1.4;
}

.gb-chat-msg--mine .gb-chat-msg-text {
  background: rgba(106,196,232,0.18);
}

.gb-chat-panel-input {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.gb-chat-input-field {
  flex: 1;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 13px;
  padding: 6px 10px;
  outline: none;
}

.gb-chat-input-field:focus { border-color: rgba(255,255,255,0.35); }

.gb-chat-input-field::placeholder { color: rgba(255,255,255,0.3); }

.gb-chat-send-btn {
  background: rgba(106,196,232,0.25);
  border: 1px solid rgba(106,196,232,0.4);
  border-radius: 8px;
  color: #6ac4e8;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.gb-chat-send-btn:hover:not(:disabled) { background: rgba(106,196,232,0.35); }

.gb-chat-send-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

@keyframes gb-chat-slide-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Away warning ────────────────────────────────────── */

.away-warning-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 400;
  animation: away-warning-fade-in 0.3s ease-out;
}

.away-warning-modal {
  position: relative;
  background: rgba(13, 33, 16, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid rgba(16, 185, 129, 0.4);
  border-radius: 16px;
  padding: 0;
  max-width: 340px;
  width: 90%;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(16, 185, 129, 0.1);
  animation: away-warning-scale-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.away-warning-header {
  padding: 20px 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.away-warning-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #ffd700;
  text-shadow: 0 0 16px rgba(255, 215, 0, 0.3);
}

.away-warning-body {
  padding: 20px;
}

.away-warning-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
}

.away-warning-body strong {
  color: #ff6b6b;
  font-weight: 600;
}

.away-warning-footer {
  display: flex;
  gap: 12px;
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.away-warning-footer button {
  flex: 1;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  transition: all 0.2s ease;
}

.away-warning-footer button:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.4);
}

.away-warning-footer button:active {
  opacity: 0.85;
}

.away-warning-footer .btn-primary {
  background: rgba(16, 185, 129, 0.3);
  border-color: rgba(16, 185, 129, 0.5);
  color: #7ecf9a;
}

.away-warning-footer .btn-primary:hover {
  background: rgba(16, 185, 129, 0.45);
  border-color: rgba(16, 185, 129, 0.7);
}

@keyframes away-warning-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes away-warning-scale-in {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ── Desktop adjustments (768px+) ────────────────────── */

@media (min-width: 768px) {
  .gb-root {
    padding: 24px;
  }

  .gb-pip-half {
    width: 38px;
    height: 38px;
    padding: 5px;
  }

  .gb-tile-divider {
    height: 30px;
  }

  .gb-pip-dot::after {
    width: 8px;
    height: 8px;
  }

  .gb-hand {
    margin: 0 -24px -16px;
    padding: 8px 24px env(safe-area-inset-bottom, 16px);
  }

  .gb-hand-tile-ghost {
    width: 42px;
    height: 82px;
  }

  .gb-picker-overlay {
    align-items: center;
    justify-content: center;
  }

  .gb-picker {
    width: 320px;
    border-radius: 16px;
    padding: 24px;
  }

  .gb-play-flip,
  .gb-tile-back-full {
    width: 54px;
    height: 106px;
  }
}
