@font-face {
  font-family: 'Canda Tawa Cute';
  src: url('assets/fonts/CandaTawaCute.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Candal';
  src: url('assets/fonts/Candal.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-card: 'Canda Tawa Cute', 'Candal', -apple-system, BlinkMacSystemFont, "SF Pro Rounded", sans-serif;
  --font-heading: 'Candal', 'Canda Tawa Cute', -apple-system, BlinkMacSystemFont, "SF Pro Rounded", sans-serif;
  --font-ui: "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --bg-deep: #f7c7dc;
  --bg-table: #1b333c;
  --bg-table-light: #24434e;
  --pptx-yellow: #FFF7AD;
  --pptx-pink: #FFA9F9;
  --pptx-peach: #F9A975;
  --pptx-peach-deep: #df8243;
  --panel-bg: rgba(255, 250, 240, 0.86);
  --panel-border: rgba(223, 130, 67, 0.45);
  --cream: #fffaf0;
  --cream-dark: #f2e4c4;
  --ink: #2b1a0e;
  --ink-soft: #6a4a33;
  --gold: #ef8e52;
  --gold-light: #F9A975;
  --fresh: #2f9959;
  --warn: #d98216;
  --spoil: #8e44ad;
  --danger: #d6493e;
  --cyan: #4895b8;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-card: 0 7px 18px rgba(96, 52, 24, 0.22);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

input, textarea {
  user-select: text;
  -webkit-user-select: text;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(125deg, #FFF7AD 0%, #FFD6C8 50%, #FFA9F9 100%);
  color: var(--ink);
  font-family: var(--font-ui);
  font-synthesis: none;
  overflow: hidden;
  touch-action: manipulation;
}

button, input, select, textarea {
  font-family: var(--font-ui);
  font-synthesis: none;
}

.view {
  display: none;
  width: 100%;
  height: 100%;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* ================= BUTTONS ================= */
.btn {
  border: none;
  border-radius: 14px;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 20px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.btn:active {
  transform: scale(0.96);
}

.btn-primary {
  background: linear-gradient(180deg, #ffbe8f 0%, #F9A975 55%, #eb8a4d 100%);
  color: var(--ink);
  box-shadow: 0 4px 0 #c66a31, 0 8px 18px rgba(130, 62, 22, 0.22);
}

.btn-primary:hover {
  filter: brightness(1.04);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.btn-secondary {
  background: rgba(255, 250, 240, 0.92);
  color: var(--ink);
  border: 1.5px solid #e4955e;
}

.btn-secondary:hover {
  background: #fff4e2;
}

.btn-ghost {
  background: rgba(255, 250, 240, 0.68);
  color: var(--ink);
  border: 1.5px solid rgba(223, 130, 67, 0.35);
}

.btn-sm {
  font-size: 13px;
  padding: 8px 14px;
  min-height: 36px;
  border-radius: 10px;
}

.btn-xl {
  font-size: 18px;
  padding: 15px 28px;
  min-height: 54px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  border: 1.5px solid rgba(223, 130, 67, 0.4);
  background: rgba(255, 250, 240, 0.85);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:active {
  transform: scale(0.94);
}

/* ================= HOME SCREEN ================= */
#view-home {
  overflow-y: auto;
  align-items: center;
  justify-content: center;
  padding: calc(18px + var(--safe-top)) 20px calc(18px + var(--safe-bottom));
}

.home-card {
  width: 100%;
  max-width: 820px;
  background: rgba(255, 250, 242, 0.88);
  border: 2.5px solid #e89861;
  border-radius: 26px;
  padding: 26px 28px;
  box-shadow: 0 20px 55px rgba(128, 56, 36, 0.2);
  backdrop-filter: blur(12px);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 22px;
}

.logo-medallion {
  width: 170px;
  height: 170px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #f6c96c;
  box-shadow: 0 12px 28px rgba(90, 44, 20, 0.28);
  background: var(--bg-table);
}

.logo-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
}

.pill-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(249, 169, 117, 0.34);
  color: #7c3810;
  border: 1.5px solid rgba(223, 130, 67, 0.5);
}

.home-title-wrap h1 {
  margin: 8px 0 6px;
  font-family: var(--font-card);
  font-size: 48px;
  font-weight: normal;
  line-height: 1.05;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.8);
}

.subtitle {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}

.setup-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.setup-box {
  background: rgba(249, 169, 117, 0.16);
  border: 1.5px solid rgba(223, 130, 67, 0.35);
  border-radius: 16px;
  padding: 12px;
}

.setup-label {
  display: block;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8c4116;
  margin-bottom: 8px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.seg-btn {
  flex: 1 1 auto;
  min-height: 38px;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1.5px solid rgba(223, 130, 67, 0.32);
  background: rgba(255, 252, 246, 0.85);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.seg-btn.active {
  background: #F9A975;
  color: var(--ink);
  border-color: #d67638;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(196, 102, 42, 0.25);
}

.custom-goal-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-soft);
}

.custom-goal-row input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1.5px solid rgba(223, 130, 67, 0.45);
  background: rgba(255, 252, 246, 0.95);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-secondary {
  display: flex;
  gap: 12px;
}

.home-secondary .btn {
  flex: 1;
}

/* ================= TOP BAR ================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(4px + var(--safe-top)) calc(12px + var(--safe-right)) 4px calc(12px + var(--safe-left));
  background: rgba(255, 250, 242, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid rgba(223, 130, 67, 0.35);
  flex-shrink: 0;
  gap: 8px;
}

#view-game .top-bar .icon-btn {
  width: 34px;
  height: 34px;
  font-size: 16px;
}

.top-left, .top-right, .top-center {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-logo-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-card);
  font-weight: normal;
  font-size: 20px;
  color: var(--ink);
}

.top-logo-chip img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #f6c96c;
  object-fit: cover;
  background: var(--bg-table);
}

.turn-badge, .goal-badge {
  font-size: 13.5px;
  font-weight: 800;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(249, 169, 117, 0.28);
  color: var(--ink);
}

.goal-badge {
  background: #F9A975;
  color: var(--ink);
  border: 1.5px solid #df8243;
}

.goal-badge.final-turn {
  background: linear-gradient(90deg, #ffe27a, #ffb347);
  color: #2b1a0e;
  border: 2px solid #c84b42;
  box-shadow: 0 0 0 3px rgba(200, 75, 66, 0.22);
  animation: finalTurnPulse 1.1s ease-in-out infinite;
}

.goal-badge.overtime {
  background: linear-gradient(90deg, #ff9966, #ff5e62);
  color: #fffaf0;
  border: 2px solid #7a1c1c;
  animation: finalTurnPulse 1.1s ease-in-out infinite;
}

@keyframes finalTurnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* ================= TABLE LAYOUT ================= */
.table-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  padding: 4px calc(10px + var(--safe-right)) calc(4px + var(--safe-bottom)) calc(10px + var(--safe-left));
  gap: 4px;
  min-height: 0;
  overflow: hidden;
}

.player-strip {
  flex: 1.06 1 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 0;
}

.player-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(255, 250, 242, 0.86);
  border: 1.5px solid rgba(223, 130, 67, 0.35);
  border-radius: 12px;
  padding: 3px 10px;
  box-shadow: 0 3px 10px rgba(120, 58, 30, 0.08);
  flex-shrink: 0;
}

.hud-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 145px;
}

.hud-identity > div {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.avatar-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.opp-dot { background: rgba(214, 73, 62, 0.25); border: 1.5px solid #e06d64; }
.me-dot { background: rgba(58, 163, 98, 0.25); border: 1.5px solid #59c983; }

.player-name {
  font-weight: 800;
  font-size: 14.5px;
  line-height: 1.1;
}

.sub-stat {
  font-size: 12.5px;
  font-weight: 700;
  opacity: 0.78;
}

.mp-meter-wrap {
  flex: 1;
  max-width: 480px;
}

.mp-meter-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 2px;
  line-height: 1.1;
}

.mp-bar {
  height: 9px;
  background: rgba(43, 26, 14, 0.14);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(43, 26, 14, 0.14);
}

.mp-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.me-fill {
  background: linear-gradient(90deg, #35a864, #70d680, #F9A975);
}

.opp-fill {
  background: linear-gradient(90deg, #d6493e, #f07b55, #F9A975);
}

.piles-mini {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pile-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 9px;
  background: rgba(249, 169, 117, 0.22);
  border: 1.5px solid rgba(223, 130, 67, 0.4);
  color: var(--ink);
  font-weight: 800;
  font-size: 13px;
}

.compost-chip {
  cursor: pointer;
  background: rgba(155, 89, 182, 0.18);
  border-color: rgba(142, 68, 173, 0.45);
  color: #4d1f66;
}

.deck-draw-chip {
  cursor: pointer;
  background: linear-gradient(180deg, #ffcf9f 0%, #F9A975 100%);
  border: 2px solid #c66a31;
  color: var(--ink);
  box-shadow: 0 3px 0 #c66a31, 0 4px 12px rgba(180, 90, 30, 0.25);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.deck-draw-chip:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #c66a31, 0 8px 16px rgba(180, 90, 30, 0.35);
}

.deck-draw-chip:active:not(:disabled) {
  transform: scale(0.95);
}

.deck-draw-chip:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

.deck-draw-chip.deck-boosted {
  background: linear-gradient(180deg, #fff1a8 0%, #f7cb52 100%);
  border-color: #b57400;
  box-shadow: 0 3px 0 #b57400, 0 0 14px rgba(247, 203, 82, 0.65);
}

.deck-draw-chip.deck-chilled {
  background: linear-gradient(180deg, #e5d8f5 0%, #c8b0e8 100%);
  border-color: #6b3fa0;
  box-shadow: 0 3px 0 #6b3fa0;
}

.deck-draw-label {
  font-size: 11.5px;
  white-space: nowrap;
}

.mini-card-back {
  width: 18px;
  height: 24px;
  border-radius: 4px;
  background: #F9A975;
  border: 1.5px solid #df8243;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mini-card-back img {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #f6c96c;
}

/* ================= BOARD LANES ================= */
.board-lanes {
  flex: 1 1 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 8px;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
  min-height: 0;
}

.lane {
  background: rgba(255, 250, 242, 0.52);
  border: 1.5px dashed rgba(196, 102, 42, 0.4);
  border-radius: 14px;
  padding: 4px 8px 5px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
}

.plate-lane {
  flex: 3 1 0;
}

.bug-lane {
  flex: 2 1 0;
}

.deck-lane {
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-start;
  padding: 4px 10px 8px;
}

.deck-lane .lane-label {
  align-self: center;
}

/* Full-size 3D Stacked Card Deck on the Table! */
.table-deck-stack {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  max-height: 330px;
  aspect-ratio: 5.65 / 8.09;
  width: auto;
  padding: 5px;
  border-radius: 11px;
  background: #F9A975;
  border: 2.5px solid #df8243;
  box-shadow:
    0 3px 0 #d98245,
    0 5px 0 #fff4e0,
    0 7px 0 #c96f34,
    0 9px 0 #fff4e0,
    0 11px 0 #b35c24,
    0 14px 20px rgba(85, 40, 18, 0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 10px;
  transition: transform 0.14s ease, box-shadow 0.16s ease, filter 0.15s ease;
}

.deck-card-inner {
  width: 100%;
  height: 100%;
  border-radius: 7px;
  border: 1.5px solid rgba(43, 26, 14, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.deck-medallion {
  width: 72%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid #f6c96c;
  background: #1b333c;
  box-shadow: 0 3px 10px rgba(43, 26, 14, 0.28);
}

.deck-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  display: block;
}

.deck-count-pill {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(27, 51, 60, 0.92);
  color: #ffe394;
  border: 1px solid rgba(246, 201, 108, 0.7);
  border-radius: 999px;
  font-size: 11px;
  line-height: 1;
  padding: 2px 6px;
  z-index: 3;
}

.deck-draw-cta {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: linear-gradient(180deg, #fff5d6 0%, #f6c96c 100%);
  color: #2b1a0e;
  border: 1.5px solid #b57400;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.1;
  padding: 3px 4px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(43, 26, 14, 0.35);
  z-index: 3;
}

.me-deck-stack {
  cursor: pointer;
}

.me-deck-stack:not(:disabled) {
  animation: deckReadyGlow 1.6s infinite alternate;
}

.me-deck-stack:hover:not(:disabled) {
  transform: translateY(-4px) scale(1.03);
}

.me-deck-stack:active:not(:disabled) {
  transform: translateY(1px) scale(0.97);
}

.me-deck-stack:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  animation: none;
}

.me-deck-stack.deck-boosted {
  border-color: #b57400;
  box-shadow:
    0 3px 0 #d4961a,
    0 5px 0 #fff8d6,
    0 7px 0 #b57400,
    0 9px 0 #fff8d6,
    0 11px 0 #8f5800,
    0 0 22px rgba(247, 203, 82, 0.85);
}

.me-deck-stack.deck-boosted .deck-draw-cta {
  background: linear-gradient(180deg, #fff7b8 0%, #f7cb52 100%);
  color: #5c3300;
}

.me-deck-stack.deck-chilled .deck-draw-cta {
  background: linear-gradient(180deg, #efe2ff 0%, #c8a2f0 100%);
  border-color: #6b3fa0;
  color: #361359;
}

.me-deck-stack.deck-final .deck-draw-cta {
  background: linear-gradient(180deg, #7be09f 0%, #2f9959 100%);
  border-color: #1c6b3b;
  color: #ffffff;
}

@keyframes deckReadyGlow {
  from { filter: drop-shadow(0 0 0px rgba(246, 201, 108, 0.2)); }
  to   { filter: drop-shadow(0 0 10px rgba(246, 201, 108, 0.85)); }
}

.lane-count {
  font-family: var(--font-card);
  font-weight: normal;
  color: #8c4116;
}

.lane-label {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
  margin-bottom: 3px;
  line-height: 1.15;
  display: flex;
  align-items: center;
  gap: 5px;
  align-self: flex-start;
  flex-shrink: 0;
}

.lane-hint {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.slot-row {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  justify-content: safe center;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 2px 2px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}

.board-slot {
  height: 100%;
  max-height: 360px;
  aspect-ratio: 5.65 / 8.09;
  width: auto;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255, 248, 236, 0.55);
  border: 1.5px dashed rgba(196, 102, 42, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.slot-empty-text {
  font-size: 11px;
  font-weight: 700;
  color: rgba(106, 74, 51, 0.55);
  text-align: center;
  padding: 6px;
}

.board-slot.highlight-play {
  border: 2px solid var(--fresh);
  background: rgba(58, 163, 98, 0.2);
  box-shadow: 0 0 18px rgba(58, 163, 98, 0.45);
  cursor: pointer;
}

.board-slot.highlight-target {
  border: 2px solid #ff6b57;
  box-shadow: 0 0 20px rgba(255, 107, 87, 0.75);
  cursor: pointer;
  animation: pulseTarget 1s infinite alternate;
}

@keyframes pulseTarget {
  from { transform: scale(1); }
  to { transform: scale(1.035); }
}

/* ================= CENTER STATUS BAR ================= */
.center-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(255, 250, 242, 0.92);
  border: 1.5px solid #e6955e;
  border-radius: 12px;
  padding: 3px 10px;
  flex-shrink: 0;
  box-shadow: 0 3px 12px rgba(120, 58, 30, 0.11);
}

.status-banner {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  flex: 1;
  line-height: 1.2;
}

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

.quota-pills {
  display: flex;
  gap: 5px;
}

.quota-pill {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(249, 169, 117, 0.3);
  color: var(--ink);
}

.quota-pill.used {
  opacity: 0.4;
  text-decoration: line-through;
}

.btn-end-turn {
  min-height: 32px;
  padding: 5px 14px;
  font-size: 13.5px;
}

/* ================= CARDS (Matching PPTX #F9A975 frame & 5.65:8.09 aspect ratio) ================= */
.game-card {
  width: 100%;
  height: 100%;
  container-type: inline-size;
  border-radius: clamp(9px, 7cqw, 16px);
  background: #F9A975;
  color: #2b1a0e;
  border: 2.5px solid #e68a4d;
  box-shadow: inset 0 0 0 1px rgba(255, 244, 224, 0.35), var(--shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.game-card.fam-food { border-color: #df8243; }
.game-card.fam-bug { border-color: #c83e37; }
.game-card.fam-plant { border-color: #3f8f53; }
.game-card.fam-prehistoric { border-color: #8f4e27; }
.game-card.fam-future { border-color: #3e799c; }
.game-card.fam-powerup { border-color: #8a4bc4; }

.card-pwr-badge {
  font-family: var(--font-ui);
  font-size: clamp(10px, 7.6cqw, 18px);
  font-weight: 800;
  line-height: 1;
  padding: clamp(2px, 1.8cqw, 6px) clamp(4px, 3.5cqw, 10px);
  border-radius: 6px;
  flex-shrink: 0;
  background: #8a4bc4;
  color: #ffffff;
}

.powerup-effect-box {
  font-family: var(--font-ui);
  font-size: clamp(10.5px, 8cqw, 19px);
  font-weight: 700;
  line-height: 1.2;
  color: #2b1a0e;
  text-align: center;
  background: rgba(255, 250, 240, 0.86);
  border-radius: 6px;
  padding: clamp(3px, 2.2cqw, 7px) clamp(4px, 3cqw, 10px);
  border: 1px solid rgba(138, 75, 196, 0.35);
}

.board-slot.highlight-upgrade {
  border: 2.5px solid #8a4bc4;
  box-shadow: 0 0 20px rgba(138, 75, 196, 0.75);
  cursor: pointer;
  animation: pulseTarget 0.9s infinite alternate;
}

/* Subtle holo shine on Ultra Rare cards! */
.game-card.rarity-ultrarare::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 240, 200, 0.28) 38%,
    rgba(255, 175, 245, 0.25) 50%,
    rgba(160, 235, 255, 0.26) 62%,
    rgba(255, 255, 255, 0) 80%);
  z-index: 2;
}

/* Radiant Golden Foil Mascot Promo Card! */
.game-card.is-promo {
  background: linear-gradient(145deg, #fff5b8 0%, #f7cb52 34%, #ffe98a 56%, #e4a321 86%, #ffe178 100%);
  border-color: #b57400;
  box-shadow: inset 0 0 0 1.5px rgba(255, 253, 230, 0.9), 0 8px 22px rgba(181, 116, 0, 0.42);
}

.game-card.is-promo::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(120deg,
    rgba(255, 255, 255, 0) 15%,
    rgba(255, 252, 215, 0.48) 34%,
    rgba(255, 214, 102, 0.28) 46%,
    rgba(255, 195, 245, 0.24) 55%,
    rgba(180, 245, 255, 0.24) 64%,
    rgba(255, 255, 255, 0) 82%);
  z-index: 2;
}

.game-card.is-promo .card-art-wrap {
  box-shadow: 0 0 0 1.5px rgba(181, 116, 0, 0.55), 0 2px 6px rgba(112, 68, 0, 0.3);
}

.game-card.is-promo .trait-pill {
  background: linear-gradient(180deg, #fff8cc 0%, #f8d264 100%);
  border-color: #b57400;
  color: #5c3300;
}

.card-meta-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  font-family: var(--font-ui);
  font-size: clamp(8.5px, 6.4cqw, 16px);
  font-weight: 700;
  color: #2b1a0e;
  margin-top: clamp(2px, 1.5cqw, 6px);
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
}

.rarity-tag {
  font-family: var(--font-ui);
  font-weight: 700;
  white-space: nowrap;
}

.game-card.selected-attacker {
  box-shadow: 0 0 0 3px #ff8c42, 0 0 22px rgba(255, 140, 66, 0.85);
  transform: translateY(-4px);
}

.game-card.ready-bug {
  box-shadow: 0 0 0 2.5px #fff1a8, 0 6px 18px rgba(246, 201, 108, 0.55);
}

.game-card.exhausted {
  filter: saturate(0.75) brightness(0.92);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(3px, 2.5cqw, 7px) clamp(5px, 4cqw, 10px) clamp(2px, 1.8cqw, 5px);
  background: transparent;
  gap: 4px;
  flex-shrink: 0;
}

.card-title {
  font-family: var(--font-card);
  font-size: clamp(13.5px, 11.4cqw, 34px);
  font-weight: normal;
  line-height: 1.08;
  color: #000000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title.long-name {
  font-size: clamp(12px, 9.8cqw, 28px);
  letter-spacing: -0.02em;
}

.card-title.xlong-name {
  font-size: clamp(10.5px, 8.4cqw, 24px);
  letter-spacing: -0.03em;
}

.card-mp-badge, .card-atk-badge {
  font-family: var(--font-ui);
  font-size: clamp(10px, 7.8cqw, 20px);
  font-weight: 800;
  line-height: 1;
  padding: clamp(2px, 1.8cqw, 6px) clamp(4px, 3.5cqw, 11px);
  border-radius: 6px;
  flex-shrink: 0;
}

.card-mp-badge {
  background: #2f9959;
  color: #ffffff;
}

.card-def-badge {
  font-family: var(--font-ui);
  font-size: clamp(9.5px, 7.2cqw, 18px);
  font-weight: 800;
  line-height: 1;
  padding: clamp(2px, 1.8cqw, 6px) clamp(4px, 3.2cqw, 10px);
  border-radius: 6px;
  flex-shrink: 0;
  background: #3e799c;
  color: #ffffff;
}

.card-atk-badge {
  background: #c83e37;
  color: #fff;
}

.card-art-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0 6px;
  border-radius: 6px;
  overflow: hidden;
  background: #e5935f;
  box-shadow: 0 1px 3px rgba(43, 26, 14, 0.25);
}

.card-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  display: block;
}

.card-info-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: rgba(20, 39, 47, 0.8);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

.prep-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(20, 39, 47, 0.9);
  color: #ffe394;
  font-family: var(--font-ui);
  font-size: clamp(9.5px, 7cqw, 17px);
  font-weight: 800;
  padding: clamp(2px, 1.6cqw, 5px) clamp(6px, 4cqw, 12px);
  border-radius: 999px;
  z-index: 2;
}

.cost-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  background: #2b1a0e;
  color: #ffe394;
  font-family: var(--font-ui);
  font-size: clamp(9.5px, 7cqw, 17px);
  font-weight: 900;
  padding: clamp(2px, 1.6cqw, 5px) clamp(6px, 4cqw, 12px);
  border-radius: 999px;
  border: 1px solid rgba(255, 227, 148, 0.6);
  z-index: 3;
}

.cost-pill.cant-afford {
  background: rgba(160, 42, 34, 0.9);
  color: #ffd9d6;
}

.trait-pill {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(255, 250, 240, 0.94);
  color: #2b1a0e;
  font-family: var(--font-ui);
  font-size: clamp(9.5px, 7.2cqw, 18px);
  font-weight: 700;
  line-height: 1.05;
  padding: clamp(2px, 1.6cqw, 5px) clamp(6px, 4cqw, 12px);
  border-radius: 999px;
  border: 1px solid rgba(43, 26, 14, 0.28);
  z-index: 2;
}

.hand-card-shell.unaffordable .game-card {
  opacity: 0.7;
  filter: saturate(0.7);
}

.board-slot.guard-blocked .game-card {
  opacity: 0.65;
}

.serve-btn {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  background: linear-gradient(180deg, #4ec97b 0%, #2d8f51 100%);
  color: #fff;
  border: 1.5px solid #e6ffed;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 900;
  padding: 4px 5px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
  z-index: 4;
  animation: gentlePulse 1.3s infinite alternate;
}

@keyframes gentlePulse {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.card-footer {
  padding: clamp(4px, 3cqw, 10px) clamp(5px, 4cqw, 12px) clamp(4px, 3cqw, 10px);
  background: transparent;
  flex-shrink: 0;
}

.meter-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  font-family: var(--font-ui);
  font-size: clamp(9.5px, 7.8cqw, 20px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.08;
  white-space: nowrap;
  color: #000000;
  margin-bottom: clamp(2px, 1.6cqw, 5px);
}

.meter-bar {
  height: clamp(5px, 3.8cqw, 11px);
  border-radius: 999px;
  background: rgba(43, 26, 14, 0.22);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.sp-fresh { background: #2d9454; }
.sp-warn { background: #d48212; }
.sp-danger { background: #7d32a8; }
.hp-fill { background: #c83e37; }

.attack-sub {
  font-family: var(--font-ui);
  font-size: clamp(9.5px, 7.2cqw, 18px);
  font-weight: 700;
  color: #2b1a0e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: clamp(2px, 1.5cqw, 5px);
}

/* ================= HAND TRAY ================= */
.hand-tray-wrap {
  flex: 0.92 1 0;
  min-height: 158px;
  max-height: 365px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 250, 242, 0.86);
  backdrop-filter: blur(10px);
  border-top: 2px solid rgba(223, 130, 67, 0.4);
  border-radius: 16px 16px 0 0;
  padding: 4px 10px 4px;
}

.hand-tray {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  gap: clamp(8px, 1.1vw, 18px);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 6px 3px;
  justify-content: safe center;
  align-items: center;
  -webkit-overflow-scrolling: touch;
}

.hand-card-shell {
  height: 100%;
  max-height: 350px;
  aspect-ratio: 5.65 / 8.09;
  width: auto;
  flex: 0 0 auto;
  position: relative;
  transition: transform 0.16s ease;
}

.hand-card-shell.selected {
  transform: translateY(-7px) scale(1.02);
  z-index: 5;
}

.hand-card-shell.selected .game-card {
  box-shadow: 0 0 0 3px var(--gold-light), 0 14px 26px rgba(0, 0, 0, 0.5);
}

.hand-play-btn {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 5px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  color: var(--ink);
  border: 1.5px solid #fff6dc;
  border-radius: 7px;
  font-size: 10.5px;
  font-weight: 900;
  padding: 5px 4px;
  cursor: pointer;
  z-index: 6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

/* Floating combat popups & shakes */
.shake-hit {
  animation: shakeHit 0.36s ease;
}

@keyframes shakeHit {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px) rotate(-2deg); }
  50% { transform: translateX(6px) rotate(2deg); }
  80% { transform: translateX(-4px); }
}

.float-pop {
  position: fixed;
  pointer-events: none;
  font-weight: 900;
  font-size: 20px;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.65);
  z-index: 999;
  animation: floatUp 1.05s ease-out forwards;
}

@keyframes floatUp {
  0% { opacity: 1; transform: translate(-50%, 0) scale(0.85); }
  25% { opacity: 1; transform: translate(-50%, -18px) scale(1.12); }
  100% { opacity: 0; transform: translate(-50%, -58px) scale(0.95); }
}

/* ================= GALLERY ================= */
#view-gallery {
  overflow: hidden;
}

.gallery-title {
  margin: 0;
  font-family: var(--font-card);
  font-weight: normal;
  font-size: 26px;
  color: var(--ink);
}

.gallery-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 250, 242, 0.72);
  border-bottom: 1px solid rgba(223, 130, 67, 0.25);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1.5px solid rgba(223, 130, 67, 0.35);
  background: rgba(255, 252, 246, 0.88);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  background: #F9A975;
  color: var(--ink);
  border-color: #d67638;
}

.gallery-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.gallery-size-toggle {
  display: inline-flex;
  align-items: center;
  background: rgba(249, 169, 117, 0.22);
  border: 1.5px solid rgba(223, 130, 67, 0.4);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}

.size-btn {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 800;
  padding: 6px 11px;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.size-btn:hover {
  color: var(--ink);
}

.size-btn.active {
  background: #F9A975;
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(130, 62, 22, 0.18);
}

.search-input {
  min-width: 290px;
  padding: 9px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(223, 130, 67, 0.45);
  background: rgba(255, 252, 246, 0.92);
  color: var(--ink);
  font-size: 14px;
}

.gallery-note {
  padding: 7px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  background: rgba(249, 169, 117, 0.25);
}

.gallery-grid {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 24px calc(32px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(235px, 21vw, 315px), 1fr));
  gap: 20px;
  align-content: start;
}

.gallery-grid.size-compact {
  grid-template-columns: repeat(auto-fill, minmax(clamp(175px, 14vw, 220px), 1fr));
  gap: 14px;
}

.gallery-grid.size-xl {
  grid-template-columns: repeat(auto-fill, minmax(clamp(305px, 28vw, 410px), 1fr));
  gap: 24px;
}

.gallery-item {
  width: 100%;
  aspect-ratio: 5.65 / 8.09;
  position: relative;
  transition: transform 0.16s ease;
}

.gallery-item:hover {
  transform: translateY(-4px);
}

.pptx-star {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(20, 39, 47, 0.88);
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  z-index: 2;
}

/* ================= MODALS ================= */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(65, 30, 20, 0.42);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  z-index: 100;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  overflow-y: auto;
  background: #fffaf0;
  color: var(--ink);
  border: 2.5px solid #e89861;
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 24px 64px rgba(102, 46, 22, 0.28);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(223, 130, 67, 0.45);
  background: rgba(249, 169, 117, 0.25);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
}

.modal-pass-card, .modal-victory-card {
  max-width: 460px;
  text-align: center;
}

#modal-pass {
  background: linear-gradient(125deg, #FFF7AD 0%, #FFD6C8 50%, #FFA9F9 100%);
}

.pass-logo {
  width: 150px;
  height: 150px;
  margin: 0 auto 14px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #f6c96c;
  background: var(--bg-table);
}

.pass-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
}

.modal-inspect-card {
  max-width: 960px;
}

/* 3D Card Flip Inspector */
.inspect-layout {
  display: grid;
  grid-template-columns: minmax(290px, 380px) 1fr;
  gap: 30px;
  align-items: start;
}

.inspect-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.flip-card-wrap {
  width: 100%;
  max-width: 380px;
  aspect-ratio: 5.65 / 8.09;
  height: auto;
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  transform-style: preserve-3d;
}

.flip-card-wrap.flipped .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 14px;
}

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

.card-back-art {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  background: #F9A975;
  border: 3px solid #df8243;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 244, 224, 0.35), var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-back-border {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  border: 2px solid rgba(43, 26, 14, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F9A975;
  overflow: hidden;
  position: relative;
}

.card-back-micro {
  position: absolute;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--font-card);
  font-size: 6px;
  font-weight: normal;
  letter-spacing: 0.14em;
  color: rgba(43, 26, 14, 0.055);
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}

.card-back-micro.top { top: 4px; }
.card-back-micro.bottom { bottom: 4px; transform: rotate(180deg); }

.card-back-medallion {
  width: 168px;
  height: 168px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #f6c96c;
  box-shadow: 0 8px 20px rgba(43, 26, 14, 0.32);
  background: var(--bg-table);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.card-back-medallion img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  display: block;
}

.inspect-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.inspect-badge {
  font-size: 13px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(249, 169, 117, 0.3);
  color: var(--ink);
}

.inspect-badge-link {
  text-decoration: none;
  background: rgba(41, 128, 185, 0.16);
  border: 1.5px solid rgba(41, 128, 185, 0.35);
  color: #184e73;
  transition: transform 0.12s ease, background 0.15s ease;
}

.inspect-badge-link:hover {
  background: rgba(41, 128, 185, 0.28);
  transform: translateY(-1px);
}

.inspect-lore {
  margin: 0 0 12px;
  padding: 10px 13px;
  border-left: 4px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: linear-gradient(90deg, rgba(255, 244, 214, 0.92) 0%, rgba(255, 250, 240, 0.72) 100%);
  font-style: italic;
  font-size: 15px;
  line-height: 1.48;
  color: var(--ink);
}

.inspect-details h2 {
  font-family: var(--font-card);
  font-weight: normal;
  margin: 0 0 10px;
  font-size: 38px;
  color: var(--ink);
}

.inspect-desc {
  margin: 0 0 16px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-soft);
}

.inspect-editor {
  background: rgba(249, 169, 117, 0.18);
  border: 1.5px solid rgba(223, 130, 67, 0.35);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
}

.editor-row input[type="number"] {
  width: 84px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid #df8243;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
  font-size: 15px;
  text-align: center;
}

.compost-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.compost-item {
  width: 100%;
  aspect-ratio: 5.65 / 8.09;
}

.compost-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px;
  opacity: 0.7;
}

.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 18px;
}

.rule-item {
  display: flex;
  gap: 12px;
  background: rgba(249, 169, 117, 0.2);
  border: 1px solid rgba(223, 130, 67, 0.3);
  padding: 12px;
  border-radius: 14px;
}

.rule-ico {
  font-size: 24px;
  line-height: 1;
}

.rule-item p {
  margin: 4px 0 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ink-soft);
}

.victory-trophy {
  font-size: 56px;
}

.victory-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 20px;
}

.v-stat {
  background: rgba(249, 169, 117, 0.22);
  border: 1px solid rgba(223, 130, 67, 0.35);
  padding: 12px;
  border-radius: 14px;
}

.victory-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.victory-sub-actions {
  display: flex;
  gap: 10px;
}

.victory-sub-actions .btn {
  flex: 1;
}

/* ================= DESKTOP HOVER CARD ZOOM ================= */
.card-hover-zoom {
  position: fixed;
  top: 50%;
  right: 22px;
  transform: translateY(-50%) scale(0.96);
  width: clamp(260px, 21vw, 330px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 160;
  opacity: 0;
  transition: opacity 0.14s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.card-hover-zoom.visible {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.card-hover-zoom.side-left {
  left: 22px;
  right: auto;
}

.card-hover-zoom.side-right {
  right: 22px;
  left: auto;
}

.hover-zoom-card {
  width: 100%;
  aspect-ratio: 5.65 / 8.09;
  filter: drop-shadow(0 20px 38px rgba(43, 26, 14, 0.45));
}

.hover-zoom-card .card-info-btn,
.hover-zoom-card .hand-play-btn {
  display: none;
}

.hover-zoom-caption {
  width: 100%;
  background: rgba(255, 250, 240, 0.96);
  border: 2px solid #df8243;
  border-radius: 12px;
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.38;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 10px 26px rgba(43, 26, 14, 0.25);
}

@media (hover: none), (pointer: coarse) {
  .card-hover-zoom {
    display: none !important;
  }
}

.toast-layer {
  position: fixed;
  top: calc(56px + var(--safe-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  background: rgba(255, 250, 240, 0.96);
  border: 2px solid #df8243;
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 22px rgba(102, 46, 22, 0.22);
}

/* ================= RESPONSIVE (iPad Portrait & Smaller Viewports) ================= */
@media (max-width: 900px) {
  .home-brand {
    flex-direction: column;
    text-align: center;
  }
  .setup-grid {
    grid-template-columns: 1fr;
  }
  .board-lanes {
    flex-wrap: wrap;
    gap: 6px;
  }
  .lane {
    padding: 5px 8px 6px;
  }
  .board-slot {
    height: clamp(118px, 15.5vh, 156px);
  }
  .hand-tray {
    justify-content: flex-start;
  }
  .hand-card-shell {
    height: clamp(128px, 17vh, 156px);
  }
  .inspect-layout {
    grid-template-columns: 1fr;
  }
  .inspect-stage {
    margin: 0 auto;
  }
  .lane-hint {
    display: none;
  }
}

@media (max-height: 760px) and (min-width: 901px) {
  .board-slot {
    height: clamp(124px, 19.5vh, 154px);
  }
  .hand-card-shell {
    height: clamp(122px, 19vh, 150px);
  }
}
