:root {
  --bg-dark: #0a1210;
  --felt-center: #123127;
  --felt-edge: #081914;
  --panel-bg: rgba(12, 22, 19, 0.88);
  --gold: #d4af37;
  --gold-bright: #f5d77a;
  --crimson: #e11d48;
  --pink: #ec4899;
  --emerald: #10b981;
  --text: #f3f4f6;
  --muted: #9ca3af;
  --card-white: #faf8f3;
  --card-ink: #171717;
  --card-red: #c81e32;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: radial-gradient(circle at 50% 35%, var(--felt-center), var(--felt-edge) 75%, var(--bg-dark));
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.casino-app {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Header */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: var(--panel-bg);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  backdrop-filter: blur(8px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 36px;
  width: auto;
  border-radius: 6px;
}

.brand h1 {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}

.brand .subtitle {
  font-size: 0.78rem;
  color: var(--muted);
}

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

.select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
}

.select-wrap select {
  background: #14241e;
  color: var(--text);
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  transition: all 0.18s ease;
}

.btn-gold {
  background: linear-gradient(135deg, #d4af37, #f5d77a);
  color: #141414;
  padding: 8px 14px;
  font-size: 0.85rem;
}
.btn-gold:hover { transform: translateY(-1px); filter: brightness(1.08); }

.btn-primary {
  background: linear-gradient(135deg, #e11d48, #be123c);
  color: #fff;
  padding: 10px 22px;
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(225, 29, 72, 0.35);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 8px 12px;
  font-size: 0.83rem;
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.15); }
.btn-ghost:disabled { opacity: 0.35; cursor: not-allowed; }

/* Dealer Zone */
.dealer-zone {
  width: 100%;
}

.dealer-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg, rgba(16, 26, 23, 0.95), rgba(26, 18, 22, 0.92));
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: 14px;
  padding: 10px 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.dealer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.dealer-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  box-shadow: 0 0 14px rgba(212, 175, 55, 0.4);
}

.dealer-badge {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gold);
  color: #111;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
}

.dealer-speech {
  flex: 1;
}

.dealer-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 5px;
}

.dealer-name {
  font-weight: 800;
  color: var(--gold-bright);
  font-size: 0.95rem;
}

.round-badge, .venue-badge {
  font-size: 0.75rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.round-badge {
  background: rgba(212, 175, 55, 0.18);
  color: var(--gold-bright);
  border: 1px solid rgba(212, 175, 55, 0.4);
}

.venue-badge {
  background: rgba(16, 185, 129, 0.16);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.speech-text {
  font-size: 0.92rem;
  line-height: 1.45;
  color: #f3f4f6;
}

/* Main 3-Column Table */
.table-grid {
  display: grid;
  grid-template-columns: 270px 1fr 270px;
  gap: 14px;
  align-items: stretch;
}

.side-panel {
  background: var(--panel-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.role-tag {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.male-tag { color: #60a5fa; }
.female-tag { color: #f472b6; }

.state-name {
  font-size: 0.95rem;
  font-weight: 800;
  color: #fff;
}

.portrait-box {
  position: relative;
  width: 100%;
  height: 210px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b1411;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.portrait-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.portrait-box.corrupted {
  border-color: var(--crimson);
  box-shadow: 0 0 18px rgba(225, 29, 72, 0.6);
}

.shadow-alert {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(225, 29, 72, 0.92);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.stat-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
}

.progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.frame-fill { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.attraction-fill { background: linear-gradient(90deg, #ec4899, #f43f5e); }

/* Suit Meters */
.suit-meters, .pandora-code-box {
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meter-title {
  font-size: 0.72rem;
  color: var(--gold-bright);
  font-weight: 700;
  margin-bottom: 2px;
}

.suit-meter {
  display: grid;
  grid-template-columns: 62px 1fr 36px;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
}

.suit-label.red { color: #fb7185; font-weight: 700; }
.suit-label.dark { color: #e5e7eb; font-weight: 700; }

.mini-bar {
  height: 7px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}

.mini-fill {
  height: 100%;
  transition: width 0.3s ease;
}
.diamond-fill { background: #f59e0b; }
.spade-fill { background: #94a3b8; }
.club-fill { background: #34d399; }
.heart-fill { background: #f43f5e; }
.mini-fill.bust { background: #ef4444 !important; }

.meter-num {
  text-align: right;
  font-size: 0.7rem;
  color: var(--muted);
}

/* Pandora 3-Axis */
.code-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.code-pill {
  font-size: 0.78rem;
  padding: 5px 8px;
  border-radius: 7px;
  font-weight: 700;
  text-align: center;
}

.code-pill.locked {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

.code-pill.unlocked {
  background: rgba(236, 72, 153, 0.18);
  color: #fbcfe8;
  border: 1px solid rgba(236, 72, 153, 0.55);
}

.secret-note {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 2px;
}

/* Center Duel Arena */
.duel-arena {
  background: radial-gradient(circle at 50% 50%, rgba(20, 62, 48, 0.72), rgba(9, 24, 19, 0.88));
  border: 2px solid rgba(212, 175, 55, 0.42);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.ets-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ets-step {
  font-size: 0.74rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ets-step.active {
  background: rgba(212, 175, 55, 0.22);
  color: var(--gold-bright);
  border-color: var(--gold);
  font-weight: 800;
}

.ets-step.done {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}

.clash-zone {
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 12px;
  min-height: 235px;
}

.slot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.slot-label {
  font-size: 0.76rem;
  color: var(--gold-bright);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.played-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 186px;
}

.empty-slot {
  width: 132px;
  height: 184px;
  border: 2px dashed rgba(212, 175, 55, 0.35);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  padding: 10px;
}

.vs-badge {
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.5);
}

.combo-hint, .woman-hint {
  font-size: 0.76rem;
  min-height: 18px;
  text-align: center;
  color: #fde68a;
  font-weight: 700;
}

.turn-result {
  text-align: center;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 0.86rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.45);
}

.arena-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Trump Playing Cards */
.hand-zone {
  background: var(--panel-bg);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
  padding: 12px 16px;
}

.hand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 0.85rem;
  font-weight: 700;
}

.hand-header small {
  font-weight: 400;
  color: var(--muted);
}

.deck-counter {
  font-size: 0.78rem;
  color: var(--gold-bright);
}

.hand-cards {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.trump-card {
  width: 136px;
  height: 190px;
  background: var(--card-white);
  color: var(--card-ink);
  border-radius: 12px;
  border: 2px solid #d6cbb3;
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.trump-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.6);
  border-color: var(--gold);
}

.trump-card.selected {
  transform: translateY(-14px);
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(245, 215, 122, 0.55), 0 14px 26px rgba(0, 0, 0, 0.65);
}

.trump-card.red-suit { color: var(--card-red); }
.trump-card.joker-color {
  background: linear-gradient(145deg, #fffbeb, #fef3c7);
  border-color: var(--gold);
  color: #b45309;
}
.trump-card.joker-curse {
  background: linear-gradient(145deg, #1f1b24, #2d141c);
  border-color: var(--crimson);
  color: #fda4af;
}
.trump-card.woman-card {
  width: 146px;
  height: 196px;
  cursor: default;
  background: linear-gradient(160deg, #fff5f8, #fce7f3);
  border: 2px solid var(--pink);
  color: #9d174d;
}
.trump-card.woman-card:hover { transform: none; }

.card-corner {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  width: 24px;
}

.card-corner.bottom {
  align-self: flex-end;
  transform: rotate(180deg);
}

.card-rank {
  font-size: 1.05rem;
  font-weight: 900;
}

.card-suit {
  font-size: 0.95rem;
}

.card-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 2px;
}

.card-big-suit {
  font-size: 1.8rem;
  line-height: 1;
}

.card-title {
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
}

.card-desc {
  font-size: 0.66rem;
  line-height: 1.25;
  color: #4b5563;
}

.trump-card.joker-curse .card-desc { color: #fecdd3; }

.card-tag {
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
}

/* Modals */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-content {
  background: #101c18;
  border: 1px solid var(--gold);
  border-radius: 16px;
  max-width: 520px;
  width: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-content h2 { color: var(--gold-bright); }
.modal-content ul { padding-left: 18px; display: flex; flex-direction: column; gap: 8px; font-size: 0.88rem; line-height: 1.5; }

.end-content { text-align: center; align-items: center; }
.end-badge {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--gold);
  color: #111;
}
.end-quote {
  background: rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--gold);
  padding: 10px 14px;
  font-size: 0.86rem;
  font-style: italic;
  color: #e5e7eb;
  text-align: left;
  width: 100%;
}

.hidden { display: none !important; }

@media (max-width: 1024px) {
  .table-grid {
    grid-template-columns: 1fr;
  }
  .portrait-box { height: 180px; }
}


/* =========================================================
   INTERACTIVE DEALER ARM, FLYING CARDS & FX ANIMATIONS
   ========================================================= */

.dealer-avatar-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.dealer-avatar.dealing {
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(245, 215, 122, 0.85);
}

.dealer-arm {
  position: absolute;
  top: 50%;
  font-size: 1.55rem;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.65));
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease;
}

.dealer-arm.arm-left {
  left: -14px;
  transform: translate(10px, -50%) rotate(15deg) scale(0.7);
}
.dealer-arm.arm-left.reach {
  opacity: 1;
  transform: translate(-34px, 6px) rotate(-22deg) scale(1.25);
}

.dealer-arm.arm-right {
  right: -14px;
  transform: translate(-10px, -50%) rotate(-15deg) scale(0.7);
}
.dealer-arm.arm-right.reach {
  opacity: 1;
  transform: translate(34px, 6px) rotate(22deg) scale(1.25);
}

/* FX Overlay */
.fx-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  overflow: hidden;
}

/* Flying Card Back (Gold Luxury Pattern) */
.flying-card {
  position: fixed;
  width: 96px;
  height: 136px;
  border-radius: 10px;
  background:
    repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.22) 0 6px, transparent 6px 12px),
    linear-gradient(145deg, #1b1124, #0d1f18);
  border: 2px solid var(--gold-bright);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65), 0 0 14px rgba(212, 175, 55, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--gold-bright);
  transform-origin: center center;
  transition: transform 0.44s cubic-bezier(0.18, 0.89, 0.32, 1.15), opacity 0.2s ease;
}

/* 3D Card Flip In */
@keyframes cardFlipIn {
  0% {
    transform: perspective(700px) rotateY(90deg) scale(0.85);
    opacity: 0.2;
  }
  60% {
    transform: perspective(700px) rotateY(-8deg) scale(1.04);
    opacity: 1;
  }
  100% {
    transform: perspective(700px) rotateY(0deg) scale(1);
    opacity: 1;
  }
}

.card-flip-in {
  animation: cardFlipIn 0.45s ease-out forwards;
}

/* Hand Card Deal Pop */
@keyframes dealPop {
  0% { transform: translateY(-24px) scale(0.75); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.trump-card.deal-pop {
  animation: dealPop 0.32s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Clash Impact */
@keyframes clashHit {
  0% { transform: scale(1); }
  35% { transform: scale(1.1) translateY(-6px); }
  100% { transform: scale(1); }
}

.clash-hit {
  animation: clashHit 0.32s ease-out;
}

/* Table Shake (Crit / Shadow Bust) */
@keyframes tableShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px) rotate(-0.4deg); }
  40% { transform: translateX(8px) rotate(0.4deg); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}

.table-shake {
  animation: tableShake 0.38s ease-in-out;
}

/* Floating Combat Numbers */
@keyframes floatPop {
  0% { transform: translate(-50%, 0) scale(0.7); opacity: 0; }
  20% { transform: translate(-50%, -14px) scale(1.15); opacity: 1; }
  100% { transform: translate(-50%, -62px) scale(0.95); opacity: 0; }
}

.float-pop {
  position: fixed;
  font-size: 1.25rem;
  font-weight: 900;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.85);
  animation: floatPop 1.1s ease-out forwards;
  white-space: nowrap;
}
.float-pop.good { color: #34d399; }
.float-pop.love { color: #f472b6; }
.float-pop.bad { color: #fb7185; }
.float-pop.gold { color: #fde047; }


/* =========================================================
   REALISTIC DEALER HAND SWEEP, LUXURY CARD BACK,
   FULLSCREEN MODE & MOBILE OPTIMIZATION
   ========================================================= */

.duel-arena {
  position: relative;
  overflow: hidden;
}

.dealer-hand-stage {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 210px;
  pointer-events: none;
  z-index: 15;
}

.dealer-hand-img {
  position: absolute;
  top: 0;
  left: 50%;
  width: 220px;
  height: auto;
  border-radius: 50%;
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 55%, transparent 100%);
  mask-image: radial-gradient(ellipse 68% 68% at 50% 50%, #000 55%, transparent 100%);
  opacity: 0;
  filter: contrast(1.12) saturate(1.15) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.8));
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
}

.dealer-hand-img.hand-left {
  transform: translate(-50%, -60px) scaleX(-1) rotate(-18deg) scale(0.8);
}
.dealer-hand-img.hand-left.reach {
  opacity: 0.96;
  transform: translate(-88%, 24px) scaleX(-1) rotate(8deg) scale(1.08);
}

.dealer-hand-img.hand-right {
  transform: translate(-50%, -60px) rotate(-18deg) scale(0.8);
}
.dealer-hand-img.hand-right.reach {
  opacity: 0.96;
  transform: translate(-12%, 24px) rotate(8deg) scale(1.08);
}

/* Luxury Art Deco Cheetah Joker Card Back */
.flying-card {
  background-image: url('../assets/brand/card_back.jpg');
  background-size: cover;
  background-position: center;
  font-size: 0;
}

/* Fullscreen Mode Polish */
:fullscreen body,
body:fullscreen {
  overflow-y: auto;
}
:fullscreen .casino-app {
  max-width: 1480px;
  min-height: 100vh;
  justify-content: space-between;
  padding: 14px 24px;
}

/* Mobile Optimization (<= 768px) */
@media (max-width: 768px) {
  .casino-app {
    padding: 8px 10px 16px;
    gap: 8px;
  }

  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px;
  }

  .brand h1 { font-size: 0.98rem; }
  .brand-logo { height: 28px; }

  .top-controls {
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
  }

  .select-wrap {
    flex: 1 1 46%;
    font-size: 0.75rem;
  }
  .select-wrap select {
    width: 100%;
    padding: 5px 6px;
    font-size: 0.76rem;
  }

  .top-controls button {
    padding: 6px 9px;
    font-size: 0.74rem;
  }

  .dealer-card {
    padding: 8px 10px;
    gap: 10px;
  }
  .dealer-avatar { width: 52px; height: 52px; }
  .speech-text { font-size: 0.8rem; }

  /* Compact 2-column side panels on mobile, Duel Arena full width */
  .table-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .duel-arena {
    grid-column: 1 / -1;
    order: 2;
    padding: 10px;
  }

  .player-panel { order: 1; padding: 8px; gap: 6px; }
  .woman-panel { order: 1; padding: 8px; gap: 6px; }

  .portrait-box { height: 115px; }
  .state-name { font-size: 0.8rem; }
  .suit-meters, .pandora-code-box { padding: 6px; }
  .suit-meter { grid-template-columns: 46px 1fr 30px; font-size: 0.68rem; }
  .code-pill { font-size: 0.68rem; padding: 3px 5px; }
  .secret-note { display: none; }

  .clash-zone {
    min-height: 170px;
    gap: 6px;
  }
  .vs-badge { font-size: 1rem; }

  /* Horizontal swipeable touch-friendly card hand */
  .hand-zone { padding: 8px 10px; }
  .hand-header { font-size: 0.76rem; }
  .hand-header small { display: none; }

  .hand-cards {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 10px 4px 6px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
  }

  .trump-card {
    flex: 0 0 108px;
    width: 108px;
    height: 152px;
    padding: 6px;
  }
  .trump-card.woman-card {
    width: 118px;
    height: 162px;
  }
  .empty-slot { width: 108px; height: 152px; font-size: 0.72rem; }
  .card-rank { font-size: 0.88rem; }
  .card-title { font-size: 0.7rem; }
  .card-desc { font-size: 0.6rem; }
}


/* =========================================================
   MOOD LIGHTING, BODY CUES, DIALOGUE, BETTING, QTE, RELICS, ARCHIVE
   ========================================================= */

/* Mood Lighting by Attraction Level */
.duel-arena {
  transition: background 0.7s ease, border-color 0.7s ease, box-shadow 0.7s ease;
}
.duel-arena.mood-warm {
  background: radial-gradient(circle at 50% 50%, rgba(84, 58, 22, 0.78), rgba(22, 18, 10, 0.92));
  border-color: rgba(245, 215, 122, 0.65);
}
.duel-arena.mood-hot {
  background: radial-gradient(circle at 50% 50%, rgba(112, 22, 48, 0.8), rgba(26, 8, 15, 0.94));
  border-color: rgba(236, 72, 153, 0.75);
  box-shadow: inset 0 0 55px rgba(236, 72, 153, 0.25);
}

.relic-badge {
  font-size: 0.74rem;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 800;
  background: rgba(168, 85, 247, 0.2);
  color: #e9d5ff;
  border: 1px solid rgba(168, 85, 247, 0.5);
}

.body-cue-banner {
  margin-top: 6px;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fde68a;
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(253, 230, 138, 0.25);
  border-radius: 8px;
  padding: 5px 10px;
}

.dialogue-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
  line-height: 1.4;
}

.dlg-line.male-dlg { color: #93c5fd; }
.dlg-line.female-dlg { color: #fbcfe8; }

/* Poker Betting Bar */
.bet-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bet-label {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--gold-bright);
}

.bet-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 5px 11px;
  font-size: 0.76rem;
  border-radius: 999px;
}
.bet-btn.active {
  background: rgba(212, 175, 55, 0.28);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.bet-btn.allin.active {
  background: rgba(225, 29, 72, 0.35);
  border-color: #fb7185;
  color: #ffe4e6;
}

/* Shit Test 5s QTE Modal */
.qte-content {
  border-color: #f43f5e;
  box-shadow: 0 0 36px rgba(244, 63, 94, 0.45);
}
.qte-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.qte-badge {
  background: #e11d48;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 999px;
}
.qte-timer {
  font-size: 1.2rem;
  font-weight: 900;
  color: #fda4af;
}
.qte-bar-wrap {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.qte-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #f43f5e, #fbbf24);
  transition: width 0.1s linear;
}
.qte-question {
  font-size: 1.02rem;
  font-weight: 800;
  color: #fbcfe8;
  line-height: 1.45;
}
.qte-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.qte-opt-btn {
  text-align: left;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 14px;
  font-size: 0.86rem;
  line-height: 1.35;
}
.qte-opt-btn:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: var(--gold-bright);
}

/* Relic Choices */
.relic-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.relic-opt {
  text-align: left;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(212, 175, 55, 0.4);
  padding: 12px 14px;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.relic-opt:hover {
  background: rgba(212, 175, 55, 0.2);
  transform: translateY(-2px);
}
.relic-opt strong { color: var(--gold-bright); font-size: 0.94rem; }
.relic-opt span { font-size: 0.8rem; color: #d1d5db; font-weight: 400; }

/* Archive Collection */
.archive-content { max-width: 640px; max-height: 85vh; overflow-y: auto; }
.archive-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.archive-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.78rem;
}
.archive-item.cleared {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.12);
}
.archive-item strong { color: var(--gold-bright); font-size: 0.84rem; }
@media (max-width: 600px) {
  .archive-list { grid-template-columns: 1fr; }
}


/* =========================================================
   TOP BAR ALIGNMENT POLISH
   ========================================================= */
.top-bar {
  gap: 14px;
  flex-wrap: wrap;
}
.brand {
  flex-shrink: 0;
}
.top-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.select-group {
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 10px;
  padding: 4px 8px;
}
.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
}
.select-wrap select {
  height: 30px;
  padding: 0 8px;
  font-size: 0.8rem;
  border-radius: 6px;
}
.btn-group button {
  height: 34px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  font-size: 0.8rem;
}


/* Turn Timer Bar */
.turn-timer-wrap {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.turn-timer-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--muted);
}
.turn-timer-head strong {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}
.turn-timer-wrap.urgent .turn-timer-head strong {
  color: #fb7185;
}
.turn-timer-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  overflow: hidden;
}
.turn-timer-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #10b981, #f5d77a);
  transition: width 0.1s linear;
}
.turn-timer-wrap.urgent .turn-timer-bar {
  background: linear-gradient(90deg, #e11d48, #fb7185);
}
