/* ==========================================================================
   MIYAKO HOME — 3-COLUMN FIXED-VIEWPORT SCENT ALCHEMIST MINI-GAME
   ========================================================================== */

:root {
  --bg-deep: #211914;
  --bg-panel: rgba(46, 35, 28, 0.85);
  --bg-panel-inner: rgba(33, 24, 19, 0.76);
  --text-cream: #faf3e8;
  --text-muted: #cdb9a5;
  --text-dark: #241912;
  --accent-wine: #76251f;
  --accent-gold: #d4a359;
  --accent-gold-bright: #f3c878;
  --border-gold: rgba(212, 163, 89, 0.35);
  --font-serif: "Noto Serif", Georgia, serif;
  --font-sans: "Noto Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}

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

html,
body {
  width: 100%;
  height: 100%;
  background: var(--bg-deep);
  color: var(--text-cream);
  font-family: var(--font-sans);
  overflow: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Fixed 1-Screen Game Viewport */
.game-viewport {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(
      circle at 15% 20%,
      rgba(148, 56, 48, 0.22),
      transparent 42%
    ),
    radial-gradient(
      circle at 50% 55%,
      rgba(224, 185, 126, 0.18),
      transparent 52%
    ),
    radial-gradient(
      circle at 85% 25%,
      rgba(105, 148, 120, 0.16),
      transparent 42%
    ),
    linear-gradient(180deg, #271f19 0%, #2e241d 55%, #221a15 100%);
  overflow: hidden;
}

/* ==========================================================================
   TOP GAME HUD BAR
   ========================================================================== */
.game-hud {
  height: 62px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: rgba(35, 27, 21, 0.92);
  border-bottom: 1px solid var(--border-gold);
  backdrop-filter: blur(12px);
  z-index: 30;
}

.hud-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-cream);
}

.hud-brand img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.hud-divider {
  width: 1px;
  height: 26px;
  background: var(--border-gold);
}

.hud-title-wrap {
  display: flex;
  flex-direction: column;
}

.hud-badge {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent-gold);
}

.hud-title-wrap h1 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-cream);
  line-height: 1.15;
}

/* Quest Progress Steps in HUD */
.hud-quests {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quest-step {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: var(--text-muted);
  transition: all 0.25s ease;
}

.quest-step.active {
  background: rgba(212, 163, 89, 0.18);
  border-color: var(--accent-gold);
  color: var(--text-cream);
  box-shadow: 0 0 16px rgba(212, 163, 89, 0.22);
}

.quest-step.done {
  background: rgba(77, 124, 93, 0.24);
  border-color: #68a37c;
  color: #dff5e6;
}

.quest-num {
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
}

.quest-step.active .quest-num {
  background: var(--accent-gold);
  color: #16100c;
}

.quest-step.done .quest-num {
  background: #5ca374;
  color: #fff;
}

.quest-arrow {
  color: rgba(212, 163, 89, 0.45);
  font-size: 13px;
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-btn-gold,
.hud-btn-ghost,
.hud-btn-back {
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: var(--font-sans);
}

.hud-btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-cream);
}

.hud-btn-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.hud-btn-icon:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 10px rgba(255, 248, 238, 0.15);
}

.hud-btn-icon:hover svg {
  transform: scale(1.08);
}

.hud-btn-icon[aria-pressed="false"] {
  color: rgba(247, 239, 226, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.hud-btn-icon svg {
  width: 17px;
  height: 17px;
  display: block;
  fill: currentColor;
  stroke: currentColor;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
}

.hud-btn-icon:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 10px rgba(255, 248, 238, 0.15);
}

.hud-btn-icon:hover svg {
  transform: scale(1.08);
}

.hud-btn-icon[aria-pressed="false"] {
  color: rgba(247, 239, 226, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
}

.hud-btn-gold {
  background: rgba(212, 163, 89, 0.16);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold-bright);
}

.hud-btn-gold:hover {
  background: var(--accent-gold);
  color: #16100c;
}

.hud-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-cream);
}

.hud-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
}

.hud-btn-back {
  background: var(--accent-wine);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.hud-btn-back:hover {
  background: #912f27;
}

/* ==========================================================================
   3-COLUMN GAME ARENA (NO SCROLL)
   ========================================================================== */
.game-arena {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) minmax(0, 0.95fr);
  gap: 14px;
  padding: 12px 18px 14px;
  overflow: hidden;
}

.arena-col {
  height: 100%;
  min-width: 0;
  min-height: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: 22px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  overflow: hidden;
  position: relative;
}

.col-head-row {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.col-head-row > .col-head {
  flex: 0 1 auto;
  min-width: 0;
}

.col-random-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.col-random-btn svg {
  width: 17px;
  height: 17px;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.col-head {
  flex-shrink: 0;
}

.col-step-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-gold);
  text-transform: uppercase;
  margin-bottom: 0;
}

.col-head h2 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-cream);
  line-height: 1.2;
}

.col-head p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 3px;
}

/* ==========================================================================
   COLUMN 1: FRAGRANCE WHEEL & SUB-NOTES SHELF
   ========================================================================== */
.wheel-box {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
  position: relative;
}

.wheel-hover-card {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  background: rgba(18, 12, 9, 0.94);
  border: 1px solid var(--accent-gold);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.8),
    0 0 16px rgba(212, 163, 89, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s;
  text-align: center;
  max-width: 250px;
}

.wheel-hover-card.visible {
  opacity: 1;
  visibility: visible;
}

.wheel-hover-title {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  letter-spacing: 0.04em;
}

.wheel-hover-desc {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-cream);
}

.fragrance-wheel-svg {
  width: 100%;
  height: 100%;
  max-width: 420px;
  max-height: 420px;
  overflow: visible;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.58));
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
  transition: transform 1.05s cubic-bezier(0.16, 1, 0.3, 1);
}

.wheel-slice {
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    filter 0.2s ease,
    transform 0.2s ease;
  transform-origin: 210px 210px;
}

.wheel-slice:hover {
  filter: brightness(1.16);
  transform: scale(1.025);
}

.wheel-slice:focus {
  outline: none;
}

.wheel-slice:focus-visible {
  outline: none;
  filter: brightness(1.22) drop-shadow(0 0 12px rgba(243, 200, 120, 0.85));
}

.wheel-slice.active {
  filter: brightness(1.25) drop-shadow(0 0 14px rgba(243, 200, 120, 0.55));
  transform: scale(1.04);
}

.wheel-label {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  fill: #fff8ee;
  pointer-events: none;
  text-anchor: middle;
  dominant-baseline: central;
  letter-spacing: 0.02em;
}

.wheel-center-link {
  cursor: pointer;
  outline: none;
  transition:
    transform 0.25s ease,
    filter 0.25s ease;
  transform-origin: 210px 210px;
}

.wheel-center-link:hover .wheel-center-circle {
  filter: drop-shadow(0 0 16px rgba(243, 200, 120, 0.75));
  stroke: var(--accent-gold-bright);
  stroke-width: 3.5;
}

.wheel-center-link:hover {
  transform: scale(1.05);
}

.wheel-center-circle {
  fill: #f7efe2;
  stroke: var(--accent-gold);
  stroke-width: 2.5;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
  transition: all 0.25s ease;
}

.wheel-center-logo {
  pointer-events: none;
}

/* Sub-notes shelf */
.family-shelf {
  flex-shrink: 0;
  background: var(--bg-panel-inner);
  border: 1px solid rgba(212, 163, 89, 0.24);
  border-radius: 16px;
  padding: 10px 12px;
}

.shelf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 8px;
}

.shelf-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--text-cream);
  flex-shrink: 0;
  white-space: nowrap;
}

.family-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.shelf-desc {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 64px;
  gap: 6px;
}

.note-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  padding: 5px 8px;
  height: 100%;
  min-width: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-cream);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.note-pick-btn:hover {
  background: rgba(212, 163, 89, 0.16);
  border-color: var(--accent-gold);
  transform: translateY(-1.5px);
}

.note-pick-btn.picked {
  background: rgba(212, 163, 89, 0.26);
  border-color: var(--accent-gold-bright);
  box-shadow: 0 0 14px rgba(212, 163, 89, 0.3);
}

.note-pick-name {
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.22;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-wrap: balance;
}

.note-pick-tag {
  flex-shrink: 0;
  font-size: 9px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(212, 163, 89, 0.2);
  color: var(--accent-gold-bright);
  white-space: nowrap;
}

/* ==========================================================================
   COLUMN 2: ALCHEMY WORKBENCH (DRAG SAMPLE VIALS -> MIXING FLASK)
   ========================================================================== */
.vials-tray {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0;
}

.vial-slot-wrap {
  min-width: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.vial-role-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.sample-vial {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 8px 6px;
  border-radius: 14px;
  background: var(--bg-panel-inner);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.25s ease;
  position: relative;
}

.sample-vial.empty {
  cursor: pointer;
}

.sample-vial.empty:hover {
  border-color: rgba(243, 200, 120, 0.72);
  background: rgba(212, 163, 89, 0.1);
  transform: translateY(-2px);
}

@keyframes vial-target-glow {
  0%,
  100% {
    box-shadow:
      0 0 0 1.5px rgba(243, 200, 120, 0.7),
      0 0 14px rgba(243, 200, 120, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 2px rgba(255, 232, 175, 0.95),
      0 0 24px rgba(243, 200, 120, 0.65);
  }
}

.sample-vial.is-selected-slot {
  border-style: solid;
  border-color: #ffe2a8;
  background: rgba(243, 200, 120, 0.2);
  animation: vial-target-glow 1.8s ease-in-out infinite;
  transform: translateY(-2px);
}

.vial-slot-wrap.is-selected-slot .vial-role-label {
  color: #fff3d1;
  text-shadow: 0 0 10px rgba(243, 200, 120, 0.7);
}

.sample-vial.ready {
  border-style: solid;
  border-color: var(--accent-gold);
  background: rgba(212, 163, 89, 0.12);
  cursor: grab;
  animation: vial-float 2.6s ease-in-out infinite;
}

.sample-vial.ready:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 20px rgba(212, 163, 89, 0.28);
}

.sample-vial.ready:active {
  cursor: grabbing;
}

.sample-vial.poured {
  border-style: solid;
  border-color: #5ca374;
  background: rgba(77, 124, 93, 0.16);
  opacity: 0.9;
  cursor: pointer;
  animation: none;
}

.sample-vial.poured:hover {
  border-color: var(--accent-gold-bright);
  transform: translateY(-2px);
}

@keyframes vial-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Miniature Potion Vial Graphic */
.vial-bottle-graphic {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 5px;
}

.vial-cork {
  width: 12px;
  height: 5px;
  background: #b5834c;
  border-radius: 2px 2px 0 0;
}

.vial-neck {
  width: 16px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.vial-body {
  width: 34px;
  height: 42px;
  border-radius: 6px 6px 14px 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vial-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0%;
  background: var(--accent-gold);
  transition:
    height 0.4s ease,
    background-color 0.3s ease;
  opacity: 0.85;
}

.sample-vial.ready .vial-liquid {
  height: 76%;
}

.sample-vial.poured .vial-liquid {
  height: 12%;
}

.vial-icon {
  position: relative;
  z-index: 2;
  font-size: 15px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

.vial-name {
  display: block;
  width: 100%;
  font-family: var(--font-serif);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-cream);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.vial-status {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  font-size: 9.5px;
  color: var(--accent-gold-bright);
  margin-top: 1px;
}

.sample-vial.poured .vial-status {
  color: #8ce0a8;
  font-weight: 700;
}

/* Floating Upward Drag-to-Discard Zone */
.vial-discard-zone {
  position: absolute;
  top: 10px;
  left: 16px;
  right: 16px;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1.5px dashed rgba(235, 118, 108, 0.55);
  background: rgba(45, 18, 16, 0.92);
  color: #f6c7c1;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(8px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
  transition: all 0.18s ease;
}

.vial-discard-zone[hidden] {
  display: none !important;
}

.vial-discard-zone.is-active {
  border-style: solid;
  border-color: #f0746a;
  background: linear-gradient(
    135deg,
    rgba(168, 42, 34, 0.96),
    rgba(118, 28, 22, 0.98)
  );
  color: #fff5f3;
  box-shadow: 0 10px 30px rgba(168, 42, 34, 0.52);
  transform: translateY(-2px) scale(1.015);
}

.discard-zone-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.18s ease, background 0.18s ease;
}

.vial-discard-zone.is-active .discard-zone-icon {
  transform: scale(1.12);
  background: rgba(255, 255, 255, 0.24);
}

.sample-vial.is-discard-armed {
  opacity: 0.45;
  border-color: #ef6c63 !important;
  box-shadow: 0 0 16px rgba(239, 108, 99, 0.42);
}

.vial-touch-ghost {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(34, 23, 17, 0.94);
  border: 1.5px solid var(--accent-gold);
  color: var(--text-cream);
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.vial-touch-ghost.is-discard {
  border-color: #f0746a;
  background: rgba(132, 30, 24, 0.95);
  color: #fff5f3;
}

/* Central Dropzone & Mixing Flask */
.alchemy-dropzone {
  flex: 1;
  min-height: 0;
  position: relative;
  border-radius: 18px;
  background: radial-gradient(
    circle at 50% 60%,
    rgba(224, 185, 126, 0.22) 0%,
    rgba(34, 25, 20, 0.82) 72%
  );
  border: 1.5px dashed rgba(212, 163, 89, 0.38);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  transition: all 0.25s ease;
  overflow: hidden;
}

.alchemy-dropzone.drag-over {
  border-style: solid;
  border-color: var(--accent-gold-bright);
  background: radial-gradient(
    circle at 50% 55%,
    rgba(243, 200, 120, 0.3) 0%,
    rgba(34, 25, 20, 0.88) 75%
  );
  box-shadow: inset 0 0 30px rgba(243, 200, 120, 0.25);
  transform: scale(1.01);
}

/* Watermark Miyako Logo in Background */
.dropzone-bg-watermark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.dropzone-watermark-img {
  width: min(290px, 78%);
  height: auto;
  opacity: 0.085;
  filter: brightness(1.8) sepia(0.35) hue-rotate(-15deg);
  transform: scale(1.05);
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

.alchemy-dropzone.drag-over .dropzone-watermark-img {
  opacity: 0.14;
  transform: scale(1.1);
}

.alchemy-dropzone.brewing-magic {
  border-style: solid;
  border-color: var(--accent-gold-bright);
  background: radial-gradient(
    circle at 50% 54%,
    rgba(243, 200, 120, 0.36) 0%,
    rgba(181, 95, 58, 0.22) 42%,
    rgba(20, 14, 11, 0.92) 78%
  );
  box-shadow:
    inset 0 0 46px rgba(243, 200, 120, 0.32),
    0 0 28px rgba(212, 163, 89, 0.35);
}

.alchemy-dropzone.brewing-magic .dropzone-watermark-img {
  opacity: 0.2;
  transform: scale(1.15) rotate(8deg);
  filter: brightness(2.2) sepia(0.5)
    drop-shadow(0 0 18px rgba(243, 200, 120, 0.6));
  transition:
    opacity 0.6s ease,
    transform 2.6s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.6s ease;
}

/* Magic Alchemy Circle & Shockwave Stage */
.alchemy-magic-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.alchemy-dropzone.brewing-magic .alchemy-magic-stage {
  opacity: 1;
}

.magic-rune-ring {
  width: 215px;
  height: 215px;
  filter: drop-shadow(0 0 12px rgba(243, 200, 120, 0.75));
  transform: scale(0.6) rotate(0deg);
}

.alchemy-dropzone.brewing-magic .magic-rune-ring {
  animation: magic-rune-spin 2.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes magic-rune-spin {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(0deg);
  }
  18% {
    opacity: 1;
    transform: scale(1.02) rotate(65deg);
  }
  82% {
    opacity: 1;
    transform: scale(1.08) rotate(310deg);
  }
  92% {
    opacity: 1;
    transform: scale(1.26) rotate(345deg);
  }
  100% {
    opacity: 0;
    transform: scale(1.4) rotate(360deg);
  }
}

.magic-core-glow {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 232, 175, 0.65) 0%,
    rgba(212, 163, 89, 0.25) 55%,
    transparent 75%
  );
  opacity: 0;
}

.alchemy-dropzone.brewing-magic .magic-core-glow {
  animation: magic-core-pulse 2.75s ease-in-out forwards;
}

@keyframes magic-core-pulse {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  25% {
    opacity: 0.85;
    transform: scale(1.1);
  }
  50% {
    opacity: 0.6;
    transform: scale(0.95);
  }
  80% {
    opacity: 1;
    transform: scale(1.35);
  }
  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

.magic-shockwave {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  border: 2.5px solid #fff3d1;
  box-shadow:
    0 0 24px #f3c878,
    inset 0 0 18px #f3c878;
  opacity: 0;
}

.alchemy-dropzone.brewing-magic .magic-shockwave {
  animation: magic-shockwave-burst 2.75s ease-out forwards;
}

@keyframes magic-shockwave-burst {
  0%,
  74% {
    opacity: 0;
    transform: scale(0.4);
  }
  80% {
    opacity: 1;
    transform: scale(0.9);
  }
  100% {
    opacity: 0;
    transform: scale(2.65);
  }
}

.dropzone-hint-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(212, 163, 89, 0.16);
  border: 1px solid rgba(212, 163, 89, 0.35);
  color: var(--accent-gold-bright);
  z-index: 5;
  transition: all 0.25s ease;
}

.alchemy-dropzone.brewing-magic .dropzone-hint-pill {
  background: rgba(243, 200, 120, 0.28);
  border-color: #fff3d1;
  color: #fff8ee;
  box-shadow: 0 0 16px rgba(243, 200, 120, 0.45);
}

.mixing-flask-svg {
  height: 100%;
  max-height: 195px;
  width: auto;
  z-index: 3;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
  transition: transform 0.3s ease;
  transform-origin: 50% 62%;
}

.mixing-flask-svg.flask-shake {
  animation: flask-shake-anim 2.75s cubic-bezier(0.36, 0.07, 0.19, 0.97)
    forwards;
}

@keyframes flask-shake-anim {
  0% {
    transform: translateY(0) rotate(0deg) scale(1);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
  }
  10% {
    transform: translateY(-12px) rotate(-6deg) scale(1.06);
    filter: drop-shadow(0 0 18px rgba(243, 200, 120, 0.65));
  }
  18% {
    transform: translateY(-14px) rotate(11deg) scale(1.08);
  }
  26% {
    transform: translateY(-11px) rotate(-13deg) scale(1.09);
  }
  34% {
    transform: translateY(-15px) rotate(14deg) scale(1.1);
    filter: drop-shadow(0 0 26px rgba(243, 200, 120, 0.85));
  }
  42% {
    transform: translateY(-12px) rotate(-15deg) scale(1.11);
  }
  50% {
    transform: translateY(-16px) rotate(15deg) scale(1.12);
  }
  58% {
    transform: translateY(-13px) rotate(-14deg) scale(1.12);
    filter: drop-shadow(0 0 32px rgba(255, 224, 150, 0.95));
  }
  66% {
    transform: translateY(-16px) rotate(13deg) scale(1.13);
  }
  74% {
    transform: translateY(-14px) rotate(-10deg) scale(1.14);
  }
  82% {
    transform: translateY(-18px) rotate(0deg) scale(1.18);
    filter: drop-shadow(0 0 42px rgba(255, 245, 210, 1)) brightness(1.28);
  }
  91% {
    transform: translateY(-6px) rotate(3deg) scale(1.05);
    filter: drop-shadow(0 0 24px rgba(243, 200, 120, 0.8)) brightness(1.08);
  }
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
  }
}

.mixing-flask-svg.flask-shake #flask-layer-top,
.mixing-flask-svg.flask-shake #flask-layer-heart,
.mixing-flask-svg.flask-shake #flask-layer-base {
  animation: liquid-alchemy-swirl 2.75s ease-in-out forwards;
  transform-origin: center;
}

@keyframes liquid-alchemy-swirl {
  0%,
  100% {
    filter: brightness(1) saturate(1);
  }
  30% {
    filter: brightness(1.2) saturate(1.3);
  }
  60% {
    filter: brightness(1.35) saturate(1.45) hue-rotate(12deg);
  }
  82% {
    filter: brightness(1.65) saturate(1.6) contrast(1.1);
  }
}

#flask-layer-top,
#flask-layer-heart,
#flask-layer-base,
#flask-meniscus {
  transition: all 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Pouring Vial Animation Actor */
.pouring-actor {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(12px) rotate(-115deg);
  z-index: 10;
  pointer-events: none;
  animation: tilt-pour 0.9s ease-in-out forwards;
}

@keyframes tilt-pour {
  0% {
    opacity: 0;
    transform: translate(40px, -15px) rotate(-35deg);
  }
  25% {
    opacity: 1;
    transform: translate(16px, 4px) rotate(-118deg);
  }
  80% {
    opacity: 1;
    transform: translate(16px, 4px) rotate(-122deg);
  }
  100% {
    opacity: 0;
    transform: translate(36px, -10px) rotate(-45deg);
  }
}

.pouring-vial-body {
  width: 28px;
  height: 44px;
  border-radius: 6px 6px 12px 12px;
  border: 2px solid #fff8ee;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  position: relative;
}

.pouring-vial-liquid {
  position: absolute;
  inset: 0;
  background: var(--accent-gold);
}

.pouring-stream {
  position: absolute;
  top: -4px;
  left: 11px;
  width: 6px;
  height: 115px;
  border-radius: 999px;
  background: var(--accent-gold);
  transform-origin: top center;
  transform: rotate(118deg);
  box-shadow: 0 0 12px currentColor;
  animation: stream-flow 0.8s ease-out forwards;
}

@keyframes stream-flow {
  0% {
    height: 0;
    opacity: 0.95;
  }
  35% {
    height: 120px;
    opacity: 1;
  }
  85% {
    height: 120px;
    opacity: 0.9;
  }
  100% {
    height: 0;
    opacity: 0;
  }
}

/* Rising Aroma Bubbles / Sparkles */
.aroma-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

.aroma-bubble {
  position: absolute;
  bottom: 45px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  opacity: 0;
  animation: bubble-rise 1.4s ease-out forwards;
}

@keyframes bubble-rise {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0.9;
  }
  100% {
    transform: translateY(-130px) scale(1.35);
    opacity: 0;
  }
}

.magic-sparkle {
  position: absolute;
  left: 50%;
  top: 54%;
  font-size: 15px;
  line-height: 1;
  color: #fff3d1;
  text-shadow:
    0 0 10px #f3c878,
    0 0 20px var(--sparkle-color, #d4a359);
  pointer-events: none;
  opacity: 0;
  animation: magic-sparkle-burst var(--dur, 1.1s) cubic-bezier(0.16, 1, 0.3, 1)
    forwards;
}

@keyframes magic-sparkle-burst {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  }
  25% {
    opacity: 1;
    transform: translate(
        calc(-50% + var(--tx, 0px) * 0.45),
        calc(-50% + var(--ty, 0px) * 0.45)
      )
      scale(1.25) rotate(90deg);
  }
  100% {
    opacity: 0;
    transform: translate(
        calc(-50% + var(--tx, 0px)),
        calc(-50% + var(--ty, 0px))
      )
      scale(0.3) rotate(220deg);
  }
}

.final-bottle-svg.bottle-enchanted {
  animation: bottle-enchant-pulse 0.85s ease-out;
}

@keyframes bottle-enchant-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.6));
  }
  45% {
    transform: scale(1.09);
    filter: drop-shadow(0 0 28px rgba(243, 200, 120, 0.9)) brightness(1.15);
  }
}

.pour-progress-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-muted);
  z-index: 5;
}

.quick-pour-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-gold);
  background: rgba(212, 163, 89, 0.2);
  color: var(--accent-gold-bright);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.quick-pour-btn:hover {
  background: var(--accent-gold);
  color: #16100c;
}

/* ==========================================================================
   COLUMN 3: BESPOKE BOTTLE & 3 RATIOS (40-30-30, 50-40-20, 50-40-10)
   ========================================================================== */
.col-bespoke {
  gap: 10px;
}

.bespoke-bottle-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 10px;
  background: radial-gradient(
    circle at 50% 38%,
    rgba(224, 185, 126, 0.22) 0%,
    rgba(33, 24, 19, 0.78) 72%
  );
  border: 1px solid rgba(212, 163, 89, 0.28);
  border-radius: 18px;
  padding: 12px 16px 12px;
}

.bespoke-bottle-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
}

.final-bottle-svg {
  height: 100%;
  max-height: 245px;
  min-height: 165px;
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.65));
}

#final-liquid-top,
#final-liquid-heart,
#final-liquid-base {
  transition: all 0.45s ease;
}

.final-label-main {
  font-family: var(--font-serif);
  font-size: 9.2px;
  font-weight: 700;
  fill: #fff8ee;
  text-anchor: end;
  letter-spacing: 0.08em;
}

.final-label-small {
  font-size: 6.8px;
  font-weight: 400;
  fill: rgba(255, 248, 238, 0.88);
  text-anchor: end;
  letter-spacing: 0.03em;
}

.final-label-ratio {
  font-size: 6.2px;
  font-weight: 700;
  fill: var(--accent-gold-bright);
  text-anchor: end;
  letter-spacing: 0.08em;
}

.final-label-vol {
  font-size: 5.2px;
  font-weight: 600;
  fill: rgba(255, 248, 238, 0.72);
  text-anchor: end;
  letter-spacing: 0.02em;
}

.bespoke-ratio-bars {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 163, 89, 0.2);
}

.ratio-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.ratio-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.ratio-label {
  color: var(--text-muted);
  white-space: nowrap;
}

.ratio-label strong {
  color: var(--accent-gold-bright);
}

.ratio-note-tag {
  margin-left: auto;
  font-family: var(--font-serif);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 3 Formula Cards */
.formula-selector-group {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.group-title {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-gold);
}

.formula-cards {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.formula-recipe-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-cream);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.formula-recipe-btn:hover {
  background: rgba(212, 163, 89, 0.12);
  border-color: rgba(212, 163, 89, 0.45);
}

.formula-recipe-btn:hover,
.formula-recipe-btn:focus-visible {
  z-index: 25;
}

.formula-recipe-btn.active {
  background: linear-gradient(
    135deg,
    rgba(212, 163, 89, 0.22),
    rgba(118, 37, 31, 0.32)
  );
  border-color: var(--accent-gold-bright);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.recipe-ratio {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 163, 89, 0.4);
  font-family: var(--font-serif);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-gold-bright);
  white-space: nowrap;
}

.recipe-name {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-cream);
}

.recipe-desc {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 7px);
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(24, 16, 12, 0.96);
  border: 1px solid rgba(212, 163, 89, 0.55);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.52);
  font-size: 11px;
  line-height: 1.4;
  color: var(--text-cream);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s ease;
  z-index: 30;
}

.formula-recipe-btn:hover .recipe-desc,
.formula-recipe-btn:focus-visible .recipe-desc {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Footer Controls in Column 3 */
.bespoke-footer-controls {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.craft-submit-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent-gold-bright);
  background: linear-gradient(135deg, #99322a 0%, #76251f 55%, #571915 100%);
  color: #fff8ee;
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(118, 37, 31, 0.55);
  transition: all 0.25s ease;
}

.craft-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(212, 163, 89, 0.45);
  background: linear-gradient(135deg, #b33b32 0%, #872b24 100%);
}

.craft-submit-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ==========================================================================
   POP-UP RESULT MODAL (NO PAGE SCROLL)
   ========================================================================== */
.result-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(12, 8, 6, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.3s ease-out;
}

.result-modal-backdrop[hidden] {
  display: none !important;
}

@keyframes modal-fade-in {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.result-modal-dialog {
  width: min(1060px, 96vw);
  max-height: 92vh;
  background: linear-gradient(165deg, #f8f1e5 0%, #ede0cb 100%);
  color: var(--text-dark);
  border-radius: 26px;
  border: 2px solid var(--accent-gold);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.75);
  padding: 26px 32px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.result-modal-dialog::-webkit-scrollbar {
  display: none;
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 16px;
  z-index: 6;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(36, 25, 18, 0.2);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-dark);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background: var(--accent-wine);
  color: #fff;
}

.modal-top-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(36, 25, 18, 0.14);
  padding-bottom: 10px;
  margin-bottom: 16px;
  padding-right: 44px;
}

.modal-serial {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-wine);
}

.modal-owner {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 13.5px;
  color: #5c493b;
}

.modal-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.85fr);
  gap: 26px;
  align-items: start;
}

.modal-main-col {
  min-width: 0;
}

.modal-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--accent-wine);
}

.modal-scent-title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 2.2vw, 26px);
  color: var(--text-dark);
  line-height: 1.2;
  margin: 4px 0 6px;
}

.modal-scent-sub {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 14.5px;
  color: #634f40;
  margin-bottom: 14px;
}

/* Custom Bespoke Scent Naming Box */
.bespoke-naming-box {
  min-width: 0;
  background: linear-gradient(135deg, #2b1d15 0%, #1c130e 100%);
  border: 1.5px solid var(--accent-gold);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 14px;
  color: var(--text-cream);
  box-shadow: 0 10px 26px rgba(36, 25, 18, 0.22);
}

.bespoke-naming-box[hidden] {
  display: none !important;
}

.naming-box-header {
  margin-bottom: 10px;
}

.naming-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent-gold-bright);
  background: rgba(212, 163, 89, 0.16);
  border: 1px solid rgba(212, 163, 89, 0.4);
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 5px;
}

.naming-hint {
  font-size: 12.5px;
  line-height: 1.45;
  color: #e9dcc9;
}

.naming-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 9px;
}

.naming-input {
  flex: 1;
  min-width: 0;
  padding: 9px 13px;
  border-radius: 10px;
  border: 1px solid rgba(212, 163, 89, 0.45);
  background: rgba(255, 255, 255, 0.08);
  color: #fff8ee;
  font-family: var(--font-serif);
  font-size: 14.5px;
  font-weight: 600;
  outline: none;
  transition: all 0.2s ease;
}

.naming-input::placeholder {
  color: rgba(247, 239, 226, 0.45);
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 400;
}

.naming-input:focus {
  border-color: var(--accent-gold-bright);
  background: rgba(255, 255, 255, 0.13);
  box-shadow: 0 0 0 3px rgba(212, 163, 89, 0.22);
}

.naming-save-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--accent-gold-bright);
  background: linear-gradient(135deg, #d4a359 0%, #b58238 100%);
  color: #1c130e;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.naming-save-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.naming-suggestions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.suggest-label {
  font-size: 11px;
  color: var(--text-muted);
}

.suggest-chips {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.suggest-chips::-webkit-scrollbar {
  display: none;
}

.suggest-chip {
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(212, 163, 89, 0.35);
  background: rgba(212, 163, 89, 0.12);
  color: var(--accent-gold-bright);
  font-family: var(--font-serif);
  font-size: 11.5px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.18s ease;
}

.suggest-chip:hover {
  background: var(--accent-gold);
  color: #1a110c;
}

.modal-persona-card {
  background: rgba(118, 37, 31, 0.07);
  border-left: 4px solid var(--accent-wine);
  border-radius: 0 14px 14px 0;
  padding: 12px 16px;
  margin-bottom: 14px;
}

.persona-badge-line span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent-wine);
}

.modal-persona-card h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  color: var(--text-dark);
  margin: 3px 0 6px;
}

.modal-persona-card p {
  font-size: 13.5px;
  line-height: 1.55;
  color: #36271e;
}

.modal-psych-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.modal-psych-item {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(36, 25, 18, 0.1);
  border-radius: 12px;
  padding: 10px 14px;
}

.psych-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  font-size: 13px;
  color: var(--accent-wine);
}

.psych-note-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(212, 163, 89, 0.25);
  color: #4f3514;
}

.modal-psych-item p {
  font-size: 13px;
  line-height: 1.48;
  color: #3b2c22;
}

/* Modal Right Side */
.modal-side-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-radar-box {
  background: #1f1611;
  color: var(--text-cream);
  border-radius: 18px;
  padding: 14px;
  text-align: center;
}

.modal-radar-box h4 {
  font-family: var(--font-serif);
  font-size: 14.5px;
  color: var(--accent-gold-bright);
  margin-bottom: 4px;
}

.radar-svg {
  width: 100%;
  max-width: 230px;
  height: auto;
  margin: 0 auto;
  overflow: visible;
}

.modal-aura-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}

.aura-tag {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(212, 163, 89, 0.18);
  border: 1px solid rgba(212, 163, 89, 0.35);
  color: var(--text-cream);
}

.modal-product-match {
  min-width: 0;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid rgba(118, 37, 31, 0.25);
  border-radius: 18px;
  padding: 14px 15px;
  box-shadow: 0 8px 22px rgba(36, 25, 18, 0.08);
  transition: all 0.25s ease;
}

.modal-product-match.is-exact-match {
  background: linear-gradient(155deg, #fffdf9 0%, #f6ebda 100%);
  border: 2px solid #b58238;
  box-shadow: 0 10px 28px rgba(181, 130, 56, 0.22);
}

.match-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed rgba(36, 25, 18, 0.14);
}

.match-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  color: var(--accent-wine);
  display: block;
}

.match-score-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: #2f6b47;
  color: #fff;
  white-space: nowrap;
}

.match-score-badge.custom-badge {
  background: #76251f;
  color: #fff8ee;
}

.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.match-img {
  width: 68px;
  height: 76px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(36, 25, 18, 0.15);
  background: #f2e8da;
}

.match-meta h4 {
  font-family: var(--font-serif);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1.22;
  margin: 0 0 3px;
}

.match-meta strong {
  display: block;
  font-size: 11px;
  color: #6b5341;
  margin-bottom: 3px;
}

.match-price-range {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent-wine);
}

.match-pyramid {
  background: rgba(36, 25, 18, 0.045);
  border: 1px solid rgba(36, 25, 18, 0.09);
  border-radius: 10px;
  padding: 7px 10px;
  margin-bottom: 8px;
  font-size: 11.5px;
  line-height: 1.42;
  color: #36261b;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.match-pyramid div strong {
  color: #6b241d;
}

.match-volumes {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
  user-select: none;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.match-volumes.is-dragging {
  cursor: grabbing;
}

.match-volumes::-webkit-scrollbar {
  display: none;
}

.volume-pill {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(212, 163, 89, 0.22);
  border: 1px solid rgba(181, 130, 56, 0.4);
  color: #3d2814;
}

.match-text {
  font-size: 12px;
  line-height: 1.45;
  color: #3f3026;
  margin-bottom: 10px;
}

.modal-product-match.is-exact-match .match-volumes {
  margin-bottom: 10px;
}

.modal-product-story-card {
  margin-top: 10px;
  padding: 13px 15px;
  border-radius: 14px;
  background: linear-gradient(155deg, #fffdf9 0%, #f6ebda 100%);
  border: 1.5px solid rgba(181, 130, 56, 0.42);
  border-left: 3.5px solid #b58238;
  box-shadow: 0 4px 14px rgba(181, 130, 56, 0.12);
}

.product-story-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.product-story-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-wine);
}

.product-story-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(181, 130, 56, 0.18);
  border: 1px solid rgba(181, 130, 56, 0.35);
  color: #4a2d13;
}

.product-story-text {
  font-size: 12.6px;
  line-height: 1.55;
  color: #3a2a20;
  margin: 0;
}

.match-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.match-product-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8e2c24 0%, #681d17 100%);
  color: #fff8ee;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 12px rgba(118, 37, 31, 0.28);
  transition: all 0.2s ease;
}

.match-product-btn:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #a6342b 0%, #7d241d 100%);
  box-shadow: 0 6px 16px rgba(118, 37, 31, 0.38);
}

.match-rename-toggle-btn {
  background: none;
  border: none;
  padding: 3px 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #6b4c32;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
}

.match-rename-toggle-btn:hover {
  color: var(--accent-wine);
}

.modal-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(36, 25, 18, 0.14);
  flex-wrap: wrap;
}

.modal-btn-primary {
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--accent-wine);
  color: #fff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.modal-btn-primary:hover {
  background: #571915;
}

.modal-btn-secondary {
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(36, 25, 18, 0.06);
  border: 1px solid rgba(36, 25, 18, 0.25);
  color: var(--text-dark);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.modal-btn-secondary:hover {
  background: rgba(36, 25, 18, 0.14);
}

body.brew-overlay-open {
  overflow: hidden;
}

.mobile-brew-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(
    circle at 50% 45%,
    rgba(68, 43, 24, 0.92) 0%,
    rgba(18, 12, 9, 0.96) 72%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: mobile-brew-fade-in 0.25s ease forwards;
}

.mobile-brew-overlay[hidden] {
  display: none !important;
}

@media (min-width: 1025px) {
  .mobile-brew-overlay {
    display: none !important;
  }
}

@keyframes mobile-brew-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.mobile-brew-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}

.mobile-brew-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--accent-gold-bright);
  text-transform: uppercase;
}

.mobile-brew-stage {
  position: relative;
  width: 260px;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-brew-overlay.brewing-magic .dropzone-watermark-img {
  opacity: 0.2;
  transform: scale(1.15) rotate(8deg);
  filter: brightness(2.2) sepia(0.5)
    drop-shadow(0 0 18px rgba(243, 200, 120, 0.6));
}

.mobile-brew-overlay.brewing-magic .alchemy-magic-stage {
  opacity: 1;
}

.mobile-brew-overlay.brewing-magic .magic-rune-ring {
  width: 248px;
  height: 248px;
  animation: magic-rune-spin 2.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.mobile-brew-overlay.brewing-magic .magic-core-glow {
  animation: magic-core-pulse 2.75s ease-in-out forwards;
}

.mobile-brew-overlay.brewing-magic .magic-shockwave {
  animation: magic-shockwave-burst 2.75s ease-out forwards;
}

.mobile-brew-overlay .mixing-flask-svg {
  width: 175px;
  height: auto;
  position: relative;
  z-index: 3;
}

.mobile-brew-overlay .mixing-flask-svg.flask-shake #mobile-flask-layer-top,
.mobile-brew-overlay .mixing-flask-svg.flask-shake #mobile-flask-layer-heart,
.mobile-brew-overlay .mixing-flask-svg.flask-shake #mobile-flask-layer-base {
  animation: liquid-alchemy-swirl 2.75s ease-in-out forwards;
  transform-origin: center;
}

.mobile-brew-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.mobile-brew-note-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(212, 163, 89, 0.18);
  border: 1px solid rgba(212, 163, 89, 0.42);
  color: var(--text-cream);
}

.mobile-brew-status {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: #fff8ee;
  background: rgba(243, 200, 120, 0.2);
  border: 1px solid rgba(243, 200, 120, 0.65);
  box-shadow: 0 0 18px rgba(243, 200, 120, 0.32);
}

/* ==========================================================================
   WORDLESS VISUAL GESTURE TUTORIALS (STEP 1 & STEP 2)
   ========================================================================== */
.gesture-tutorial-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  overflow: hidden;
}

.gesture-tutorial-overlay[hidden] {
  display: none !important;
}

.gesture-trail-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.gesture-trail-path {
  stroke: rgba(243, 200, 120, 0.82);
  stroke-width: 2.5;
  stroke-dasharray: 6 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px rgba(243, 200, 120, 0.65));
}

.gesture-trail-flow {
  animation: gesture-dash-flow 1.2s linear infinite;
}

@keyframes gesture-dash-flow {
  from {
    stroke-dashoffset: 24;
  }
  to {
    stroke-dashoffset: 0;
  }
}

.gesture-ripple {
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  border: 2.5px solid #ffe2a8;
  box-shadow: 0 0 16px rgba(243, 200, 120, 0.85);
  opacity: 0;
  will-change: transform, opacity;
}

.gesture-hand {
  position: absolute;
  left: 0;
  top: 0;
  width: 42px;
  height: 42px;
  margin: -5px 0 0 -17px;
  filter: drop-shadow(0 0 10px rgba(243, 200, 120, 0.85))
    drop-shadow(0 6px 14px rgba(0, 0, 0, 0.65));
  opacity: 0;
  will-change: transform, opacity;
}

.gesture-hand svg {
  width: 100%;
  height: 100%;
  display: block;
}

.gesture-ghost-vial {
  position: absolute;
  left: 8px;
  top: -20px;
  width: 20px;
  height: 26px;
  border-radius: 4px 4px 9px 9px;
  border: 2px solid #ffe8b8;
  background: linear-gradient(
    to top,
    rgba(243, 200, 120, 0.94) 68%,
    rgba(255, 248, 238, 0.3) 68%
  );
  box-shadow: 0 0 14px rgba(243, 200, 120, 0.8);
  opacity: 0;
  transform-origin: center bottom;
}

.gesture-ghost-vial::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 5px;
  width: 7px;
  height: 4px;
  border-radius: 2px 2px 0 0;
  background: #f3c878;
}

/* Desktop Step-by-Step Subtle Glow Guide (>= 1025px) */
@keyframes guide-col-glow {
  0%,
  100% {
    border-color: rgba(212, 163, 89, 0.42);
    box-shadow:
      0 18px 44px rgba(0, 0, 0, 0.5),
      0 0 0 1px rgba(243, 200, 120, 0.14);
  }
  50% {
    border-color: rgba(243, 200, 120, 0.85);
    box-shadow:
      0 18px 44px rgba(0, 0, 0, 0.5),
      0 0 22px rgba(243, 200, 120, 0.24),
      inset 0 0 24px rgba(243, 200, 120, 0.07);
  }
}

@keyframes guide-target-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(243, 200, 120, 0.16);
  }
  50% {
    box-shadow: 0 0 18px 2px rgba(243, 200, 120, 0.42);
  }
}

@keyframes guide-cta-glow {
  0%,
  100% {
    box-shadow:
      0 8px 24px rgba(118, 37, 31, 0.45),
      0 0 0 1px rgba(243, 200, 120, 0.38);
  }
  50% {
    box-shadow:
      0 10px 30px rgba(118, 37, 31, 0.58),
      0 0 24px rgba(243, 200, 120, 0.65);
  }
}

@media (min-width: 1025px) {
  .col-head {
    position: relative;
    z-index: 15;
    width: fit-content;
    max-width: 100%;
    cursor: default;
  }

  .col-head .col-step-tag::after {
    content: "ⓘ";
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0;
    color: rgba(212, 163, 89, 0.72);
    transition: color 0.2s ease;
  }

  .col-head:hover .col-step-tag::after {
    color: var(--accent-gold-bright);
  }

  .col-head p {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max-content;
    max-width: min(320px, calc(100vw / 3 - 48px));
    margin: 0;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(28, 19, 13, 0.96);
    border: 1px solid rgba(212, 163, 89, 0.45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    color: var(--text-cream);
    line-height: 1.45;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    pointer-events: none;
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s ease;
  }

  .col-head:hover p,
  .col-head:focus-within p {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .arena-col.guide-step-active {
    animation: guide-col-glow 2.6s ease-in-out infinite;
  }

  .arena-col.guide-step-active .col-step-tag {
    color: var(--accent-gold-bright);
    text-shadow: 0 0 12px rgba(243, 200, 120, 0.55);
  }

  .col-wheel.guide-step-active .family-shelf {
    border-color: rgba(243, 200, 120, 0.62);
    animation: guide-target-pulse 2.6s ease-in-out infinite;
  }

  .col-wheel.guide-step-active .fragrance-wheel-svg {
    filter: drop-shadow(0 0 14px rgba(243, 200, 120, 0.28));
  }

  .col-alchemy.guide-step-active .sample-vial.ready {
    border-color: rgba(243, 200, 120, 0.85);
    animation: guide-target-pulse 2.2s ease-in-out infinite;
  }

  .col-alchemy.guide-step-active .alchemy-dropzone:not(.brewing-magic) {
    border-color: rgba(243, 200, 120, 0.65);
    box-shadow: inset 0 0 28px rgba(243, 200, 120, 0.14);
  }

  .col-alchemy.guide-step-active .quick-pour-btn:not([hidden]) {
    animation: guide-target-pulse 2.2s ease-in-out infinite;
  }

  .col-bespoke.guide-step-active .formula-cards {
    border-radius: 14px;
    box-shadow: 0 0 16px rgba(243, 200, 120, 0.16);
  }

  .col-bespoke.guide-step-active .craft-submit-btn:not(:disabled) {
    animation: guide-cta-glow 2.2s ease-in-out infinite;
  }

  .quest-step.active {
    animation: guide-target-pulse 2.6s ease-in-out infinite;
  }

  @media (prefers-reduced-motion: reduce) {
    .arena-col.guide-step-active,
    .col-wheel.guide-step-active .family-shelf,
    .col-alchemy.guide-step-active .sample-vial.ready,
    .col-alchemy.guide-step-active .quick-pour-btn:not([hidden]),
    .col-bespoke.guide-step-active .craft-submit-btn:not(:disabled),
    .quest-step.active {
      animation: none;
    }

    .arena-col.guide-step-active {
      border-color: rgba(243, 200, 120, 0.72);
      box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.5),
        0 0 16px rgba(243, 200, 120, 0.2);
    }
  }
}

/* Responsive Fallback for small tablets / mobile phones */
@media (max-width: 1024px) {
  html,
  body,
  .game-viewport {
    height: auto;
    overflow-y: auto;
  }
  .game-hud {
    height: auto;
    padding: 10px 18px;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
  }
  .hud-brand {
    min-width: 0;
  }
  .hud-actions {
    flex-shrink: 0;
  }
  .hud-quests {
    display: none;
  }
  .game-arena {
    grid-template-columns: 1fr;
    overflow: visible;
  }
  .modal-body-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .game-hud {
    position: relative;
    padding: 11px 16px 13px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .hud-brand {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: 100%;
  }
  .hud-brand img {
    height: 30px;
    max-width: calc(100% - 92px);
  }
  .hud-divider {
    display: none;
  }
  .hud-title-wrap {
    width: 100%;
    padding-top: 9px;
    border-top: 1px solid rgba(212, 163, 89, 0.2);
    align-items: center;
    text-align: center;
    gap: 2px;
  }
  .hud-badge {
    font-size: 9px;
    letter-spacing: 0.18em;
  }
  .hud-title-wrap h1 {
    font-size: clamp(14.5px, 4.3vw, 18px);
    line-height: 1.25;
    text-wrap: balance;
  }
  .hud-actions {
    position: absolute;
    top: 9px;
    right: 16px;
    gap: 7px;
    z-index: 2;
  }
  .hud-btn-icon {
    width: 34px;
    height: 34px;
  }
  .hud-btn-icon svg {
    width: 15px;
    height: 15px;
  }
}
