/* ============================================================
   BurmaldaDrop — style.css
   Стиль: Pastel Neobrutalism (Светлая и Тёмная темы)
   - Контрастные жирные контуры и жесткие тени (hard-offset shadows)
   - Мягкая пастельная палитра для светлой и тёмной темы
   - Идеальная адаптивность для мобильных и планшетов
   ============================================================ */

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

.hidden {
  display: none !important;
}

:root {
  /* ===== СВЕТЛАЯ ТЕМА (ДЕФОЛТ) ===== */
  --ink:          #18181B;
  --bg-main:      #F5F2EB;
  --bg-card:      #FFFFFF;
  --bg-subtle:    #EFECE4;
  --text-main:    #18181B;
  --text-muted:   #64748B;
  --bg-dots:      #18181B;

  /* Пастельная палитра */
  --pastel-yellow:#FEF08A;
  --pastel-gold:  #FDE047;
  --pastel-purple:#DDD6FE;
  --pastel-purple-dark: #A78BFA;
  --pastel-pink:  #FECDD3;
  --pastel-green: #BBF7D0;
  --pastel-red:   #FECACA;
  --pastel-blue:  #BAE6FD;
  --pastel-orange:#FED7AA;

  /* Редкости */
  --rarity-ordinary-bg:       #F1F5F9;
  --rarity-ordinary-color:    #475569;
  --rarity-rare-bg:           #E0F2FE;
  --rarity-rare-color:        #0284C7;
  --rarity-prost_krut-bg:     #DCFCE7;
  --rarity-prost_krut-color:  #16A34A;
  --rarity-mythical-bg:       #EDE9FE;
  --rarity-mythical-color:    #7C3AED;
  --rarity-burmalda-bg:       #FFE4E6;
  --rarity-burmalda-color:    #E11D48;
  --rarity-super_burmalda-bg: #FEE2E2;
  --rarity-super_burmalda-color:#DC2626;
  --rarity-hammam-bg:         #FEF3C7;
  --rarity-hammam-color:      #B45309;

  /* Колесо */
  --wheel-fail-bg:    #E2E8F0;
  --wheel-success-bg: #4ADE80;
  --wheel-inner-bg:   #FFFFFF;
  --wheel-stroke:     #18181B;
  --spinner-arrow:    #18181B;
  --spinner-dot:      #FDE047;
  --percent-bg:       #FFFFFF;
  --percent-color:    #18181B;

  /* Тени и радиусы */
  --border-width: 2.5px;
  --border:       var(--border-width) solid var(--ink);
  --shadow-sm:    2px 2px 0px var(--ink);
  --shadow-md:    4px 4px 0px var(--ink);
  --shadow-lg:    6px 6px 0px var(--ink);
  --radius-sm:    8px;
  --radius-md:    12px;
  --radius-lg:    18px;
  --radius-pill:  999px;
}

[data-theme="dark"] {
  /* ===== ТЁМНАЯ ТЕМА (DARK NEOBRUTALISM) ===== */
  --ink:          #000000;
  --bg-main:      #121217;
  --bg-card:      #1C1C24;
  --bg-subtle:    #262633;
  --text-main:    #F4F4F5;
  --text-muted:   #94A3B8;
  --bg-dots:      rgba(255, 255, 255, 0.15);

  /* Пастельные акценты в тёмной теме */
  --pastel-yellow:#FDE047;
  --pastel-gold:  #EAB308;
  --pastel-purple:#8B5CF6;
  --pastel-purple-dark: #7C3AED;
  --pastel-pink:  #FB7185;
  --pastel-green: #34D399;
  --pastel-red:   #F87171;
  --pastel-blue:  #38BDF8;
  --pastel-orange:#FB923C;

  /* Редкости в тёмной теме */
  --rarity-ordinary-bg:       #2A2D35;
  --rarity-ordinary-color:    #CBD5E1;
  --rarity-rare-bg:           #1E3A5F;
  --rarity-rare-color:        #7DD3FC;
  --rarity-prost_krut-bg:     #14432A;
  --rarity-prost_krut-color:  #86EFAC;
  --rarity-mythical-bg:       #38245C;
  --rarity-mythical-color:    #D8B4FE;
  --rarity-burmalda-bg:       #4C1628;
  --rarity-burmalda-color:    #FDA4AF;
  --rarity-super_burmalda-bg: #4C1414;
  --rarity-super_burmalda-color:#FCA5A5;
  --rarity-hammam-bg:         #453205;
  --rarity-hammam-color:      #FDE047;

  /* Колесо в тёмной теме */
  --wheel-fail-bg:    #2A2A38;
  --wheel-success-bg: #22C55E;
  --wheel-inner-bg:   #171720;
  --wheel-stroke:     #000000;
  --spinner-arrow:    #FFFFFF;
  --spinner-dot:      #FDE047;
  --percent-bg:       #171720;
  --percent-color:    #FFFFFF;
}

html, body {
  min-height: 100%;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-main);
  background-image: radial-gradient(var(--bg-dots) 0.75px, transparent 0.75px);
  background-size: 20px 20px;
  background-position: 0 0;
  color: var(--text-main);
  overflow-x: hidden;
  line-height: 1.4;
  transition: background-color 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-subtle); border-left: 2px solid var(--ink); }
::-webkit-scrollbar-thumb { 
  background: var(--pastel-purple-dark); 
  border: 2px solid var(--ink); 
  border-radius: var(--radius-pill); 
}
::-webkit-scrollbar-thumb:hover { background: #8B5CF6; }

/* ===== HEADER ===== */
#header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.5rem;
  background: var(--bg-card);
  border-bottom: 3px solid var(--ink);
  box-shadow: 0 4px 0px var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
}

#header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#logo-container {
  display: flex;
  align-items: center;
}

#logo {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  background: var(--pastel-yellow);
  color: #18181B;
  padding: 0.25rem 0.75rem;
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transform: rotate(-1.5deg);
  user-select: none;
}

/* Переключатель темы */
.btn-theme-toggle {
  background: var(--bg-subtle);
  border: var(--border);
  color: var(--text-main);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.35rem 0.65rem;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s;
  user-select: none;
}
.btn-theme-toggle:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--ink);
}
.btn-theme-toggle:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

#header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

#coin-display {
  font-size: 0.95rem;
  font-weight: 800;
  color: #18181B;
  background: var(--pastel-gold);
  border: var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  padding: 0.35rem 0.9rem;
  white-space: nowrap;
  user-select: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-header {
  background: var(--pastel-purple);
  border: var(--border);
  color: #18181B;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: inherit;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
  white-space: nowrap;
}
.btn-header:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--ink);
}
.btn-header:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

#btn-profile {
  background: var(--pastel-orange);
}

/* Кнопка бургер-меню (по умолчанию скрыта на десктопе) */
.btn-burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 38px;
  height: 38px;
  background: var(--pastel-yellow);
  border: var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 8px 6px;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s ease;
  user-select: none;
}
.btn-burger:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--ink);
}
.btn-burger:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

.burger-bar {
  width: 100%;
  height: 3px;
  background-color: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Анимация крестика при открытии */
.btn-burger.active .burger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.btn-burger.active .burger-bar:nth-child(2) {
  opacity: 0;
}
.btn-burger.active .burger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ===== MAIN ===== */
#main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.neo-label {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--text-main);
  text-transform: uppercase;
  background: var(--bg-subtle);
  border: 1.5px solid var(--ink);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-pill);
  box-shadow: 1.5px 1.5px 0px var(--ink);
  display: inline-block;
  user-select: none;
}

/* ===== UPGRADE ZONE ===== */
#upgrade-zone {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto auto;
  gap: 1rem;
  align-items: center;
  justify-items: center;
  background: var(--bg-card);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  position: relative;
}

#source-display, #target-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
}

#source-display { grid-column: 1; grid-row: 1 / 3; }
#target-display { grid-column: 3; grid-row: 1 / 3; }

.clip-slot {
  width: 100%;
  min-height: 140px;
  max-width: 220px;
  background: var(--bg-subtle);
  border: 2.5px dashed var(--ink);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.15s ease;
}

.clip-slot.empty::before {
  content: '+';
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-muted);
  opacity: 0.4;
}

.clip-slot.filled {
  background: var(--bg-card);
  border-style: solid;
  box-shadow: var(--shadow-md);
}

.slot-clip-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 0.2rem;
}

.slot-rarity-label {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  box-shadow: 1.5px 1.5px 0px var(--ink);
  text-transform: uppercase;
}

/* ===== WHEEL ===== */
#wheel-container {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

#wheel-wrapper {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  box-shadow: var(--shadow-md);
}

#wheel-svg {
  width: 200px;
  height: 200px;
  display: block;
}

/* Элементы SVG колеса */
#wheel-fail-bg {
  fill: var(--wheel-fail-bg);
  stroke: var(--wheel-stroke);
  stroke-width: 3;
}

#wheel-success-arc {
  fill: var(--wheel-success-bg);
  stroke: var(--wheel-stroke);
  stroke-width: 1.5;
}

#wheel-outer-ring {
  stroke: var(--wheel-stroke);
  stroke-width: 3;
}

#wheel-inner-circle {
  fill: var(--wheel-inner-bg);
  stroke: var(--wheel-stroke);
  stroke-width: 3;
}

#spinner-arrow {
  fill: var(--spinner-arrow);
  stroke: var(--wheel-stroke);
  stroke-width: 1;
}

#spinner-dot {
  fill: var(--spinner-dot);
  stroke: var(--wheel-stroke);
  stroke-width: 2;
}

#wheel-center-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

#wheel-percent {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--percent-color);
  background: var(--percent-bg);
  border: 2px solid var(--ink);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-sm);
  box-shadow: 2px 2px 0px var(--ink);
  white-space: nowrap;
}

/* ===== UPGRADE BUTTON ===== */
#btn-upgrade {
  grid-column: 2;
  grid-row: 2;
}

.btn-upgrade {
  background: var(--pastel-pink);
  border: 3px solid var(--ink);
  color: #18181B;
  font-size: 1.1rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 0.85rem 2.25rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: var(--shadow-md);
  font-family: inherit;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s;
  white-space: nowrap;
  user-select: none;
}
.btn-upgrade:hover:not(:disabled) {
  background: #FDA4AF;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--ink);
}
.btn-upgrade:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0px var(--ink);
}
.btn-upgrade:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: #475569;
  box-shadow: 2px 2px 0px #475569;
  cursor: not-allowed;
  transform: none;
}

/* ===== CLICKER ===== */
#clicker-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.btn-clicker {
  background: var(--pastel-gold);
  border: 3px solid var(--ink);
  color: #18181B;
  font-size: 1.05rem;
  font-weight: 900;
  padding: 0.75rem 2.5rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-md);
  font-family: inherit;
  letter-spacing: 0.03em;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s;
  user-select: none;
}
.btn-clicker:hover:not(:disabled) {
  background: #FACC15;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0px var(--ink);
}
.btn-clicker:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0px var(--ink);
}
.btn-clicker:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: #475569;
  box-shadow: 2px 2px 0px #475569;
  cursor: not-allowed;
  transform: none;
}

#clicker-info {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1.5px solid var(--ink);
  padding: 0.2rem 0.75rem;
  border-radius: var(--radius-pill);
  box-shadow: 1.5px 1.5px 0px var(--ink);
}

/* ===== BOTTOM PANELS ===== */
#bottom-panels {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.25rem;
  min-height: 340px;
}

/* ===== LEFT PANEL ===== */
#left-panel {
  background: var(--bg-card);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#panel-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-bottom: 3px solid var(--ink);
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0;
}

.tab-btn {
  flex: 1;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 800;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  user-select: none;
}
.tab-btn.active {
  color: #18181B;
  background: var(--pastel-purple);
  box-shadow: inset 0 -3px 0 var(--pastel-purple);
}
.tab-btn:hover:not(.active) {
  color: var(--text-main);
  background: var(--bg-subtle);
}

.tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}
.tab-content.active {
  display: flex;
  flex-direction: column;
}

/* ===== ITEM GRID ===== */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem;
}

/* ===== CLIP CARD ===== */
.clip-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}
.clip-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--ink);
}
.clip-card.selected {
  border-color: var(--ink);
  background: var(--pastel-purple);
  box-shadow: 4px 4px 0px var(--ink);
  transform: translate(-2px, -2px);
}
.clip-card.selected .clip-card-name,
.clip-card.selected .clip-card-price {
  color: #18181B;
}

.clip-card-video {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  object-fit: cover;
  display: block;
  border-bottom: 2px solid var(--ink);
}

.clip-card-info {
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}

.clip-card-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clip-card-rarity {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  align-self: flex-start;
  box-shadow: 1px 1px 0px var(--ink);
}

.clip-card-price {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-main);
}

.clip-card-actions {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.55rem 0.55rem;
}

.btn-buy, .btn-sell, .btn-select {
  flex: 1;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 2px 2px 0px var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  text-align: center;
  user-select: none;
}
.btn-buy:hover:not(:disabled),
.btn-sell:hover,
.btn-select:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--ink);
}
.btn-buy:active:not(:disabled),
.btn-sell:active,
.btn-select:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

.btn-buy {
  background: var(--pastel-green);
  color: #18181B;
}
.btn-buy:disabled {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-color: #475569;
  box-shadow: 1px 1px 0px #475569;
  cursor: not-allowed;
}

.btn-sell {
  background: var(--pastel-red);
  color: #18181B;
}

.btn-select {
  background: var(--pastel-blue);
  color: #18181B;
}

/* ===== RARITY COLORS & BACKGROUNDS ===== */
.rarity-ordinary       { background: var(--rarity-ordinary-bg); color: var(--rarity-ordinary-color); }
.rarity-rare           { background: var(--rarity-rare-bg); color: var(--rarity-rare-color); }
.rarity-prost_krut     { background: var(--rarity-prost_krut-bg); color: var(--rarity-prost_krut-color); }
.rarity-mythical       { background: var(--rarity-mythical-bg); color: var(--rarity-mythical-color); }
.rarity-burmalda       { background: var(--rarity-burmalda-bg); color: var(--rarity-burmalda-color); }
.rarity-super_burmalda { background: var(--rarity-super_burmalda-bg); color: var(--rarity-super_burmalda-color); }
.rarity-hammam         { background: var(--rarity-hammam-bg); color: var(--rarity-hammam-color); }

.border-ordinary       { border-color: var(--ink) !important; background: var(--rarity-ordinary-bg) !important; }
.border-rare           { border-color: var(--ink) !important; background: var(--rarity-rare-bg) !important; }
.border-prost_krut     { border-color: var(--ink) !important; background: var(--rarity-prost_krut-bg) !important; }
.border-mythical       { border-color: var(--ink) !important; background: var(--rarity-mythical-bg) !important; }
.border-burmalda       { border-color: var(--ink) !important; background: var(--rarity-burmalda-bg) !important; }
.border-super_burmalda { border-color: var(--ink) !important; background: var(--rarity-super_burmalda-bg) !important; }
.border-hammam         { border-color: var(--ink) !important; background: var(--rarity-hammam-bg) !important; }

/* Хаммам: специальный стикер-эффект */
.clip-card.rarity-hammam-card {
  background: var(--pastel-gold) !important;
  box-shadow: 4px 4px 0px var(--ink), 0 0 16px rgba(245, 158, 11, 0.4) !important;
}

/* ===== RIGHT PANEL (ЦЕЛЬ АПГРЕЙДА — ВЫБОР ФУТАЖА) ===== */
#right-panel {
  background: var(--bg-card);
  border: 3px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 520px;
  overflow-y: auto;
}

#target-rarity-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.target-clip-card {
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.15s;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  user-select: none;
}
.target-clip-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--ink);
  background: var(--bg-subtle);
}
.target-clip-card.selected {
  background: var(--pastel-purple);
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--ink);
  border-color: var(--ink);
}
.target-clip-card.selected .target-clip-name,
.target-clip-card.selected .clip-card-price {
  color: #18181B;
}

.target-clip-thumb {
  width: 54px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  object-fit: cover;
  background: #000;
  flex-shrink: 0;
}

.target-clip-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  flex: 1;
}

.target-clip-name {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.target-clip-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.target-clip-chance-badge {
  font-size: 0.75rem;
  font-weight: 900;
  background: var(--pastel-green);
  color: #18181B;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  box-shadow: 1px 1px 0px var(--ink);
  margin-left: auto;
  white-space: nowrap;
}

/* ===== EMPTY HINT ===== */
.empty-hint {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  padding: 1.5rem;
  line-height: 1.5;
  background: var(--bg-subtle);
  border: 2px dashed #475569;
  border-radius: var(--radius-md);
  margin: 0.5rem 0;
}

/* ===== MODALS ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-box {
  background: var(--bg-card);
  border: 3.5px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0px var(--ink);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
}

.modal-box-clip {
  max-width: 620px;
}

.modal-box h2 {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.btn-modal-close {
  background: var(--pastel-yellow);
  border: 2.5px solid var(--ink);
  color: #18181B;
  padding: 0.65rem 1.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 900;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  align-self: center;
  margin-top: 0.5rem;
  user-select: none;
}
.btn-modal-close:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0px var(--ink);
}
.btn-modal-close:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

/* ===== RESULT MODAL ===== */
.result-icon {
  font-size: 4.5rem;
  text-align: center;
  line-height: 1;
}
.result-title {
  font-size: 1.75rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: -0.02em;
  color: var(--text-main);
}
.result-desc {
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-main);
  line-height: 1.5;
  background: var(--bg-subtle);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
}

/* ===== PROFILE MODAL ===== */
.profile-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.profile-row label {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-main);
}
.profile-row input {
  flex: 1;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius-md);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  box-shadow: 2px 2px 0px var(--ink);
  min-width: 0;
}
.profile-row input:focus {
  outline: none;
  background: var(--bg-subtle);
}

.profile-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-subtle);
  border: 2px solid var(--ink);
  border-radius: var(--radius-md);
  padding: 0.75rem;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 0.35rem 0;
  border-bottom: 1.5px solid #475569;
}
.stat-row:last-child {
  border-bottom: none;
}
.stat-label { color: var(--text-muted); }
.stat-value { font-weight: 900; color: var(--text-main); }

.profile-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-small {
  background: var(--pastel-blue);
  border: 2px solid var(--ink);
  color: #18181B;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
}
.btn-small:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 3px 0px var(--ink);
}
.btn-small:active {
  transform: translate(2px, 2px);
  box-shadow: 0px 0px 0px var(--ink);
}

.btn-danger {
  background: var(--pastel-pink);
  color: #DC2626;
  width: 100%;
}
.btn-danger:hover {
  background: #FDA4AF;
}

.profile-demo-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

.btn-demo-mode {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
  user-select: none;
}
.btn-demo-mode:hover {
  opacity: 0.9;
  border-color: var(--text-main);
  color: var(--text-main);
}
.btn-demo-mode.active {
  opacity: 1;
  color: #16A34A;
  border-color: #16A34A;
  background: rgba(34, 197, 94, 0.08);
}

/* ===== TOAST NOTIFICATION ===== */
#toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--pastel-yellow);
  border: 3px solid var(--ink);
  border-radius: var(--radius-pill);
  box-shadow: 4px 4px 0px var(--ink);
  padding: 0.75rem 1.75rem;
  font-size: 0.95rem;
  font-weight: 800;
  color: #18181B;
  z-index: 2000;
  transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ===== ERROR SCREEN ===== */
#error-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-main);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1.5rem;
}
#error-box {
  background: var(--bg-card);
  border: 3.5px solid var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: 8px 8px 0px var(--ink);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 440px;
  padding: 2rem;
}

/* ===== RESPONSIVE (МОБИЛКИ И ПЛАНШЕТЫ) ===== */
@media (max-width: 900px) {
  #upgrade-zone {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 1.25rem;
  }
  #source-display { grid-column: 1; grid-row: 1; }
  #wheel-container { grid-column: 1; grid-row: 2; }
  #btn-upgrade { grid-column: 1; grid-row: 3; }
  #target-display { grid-column: 1; grid-row: 4; }
  
  #bottom-panels {
    grid-template-columns: 1fr;
  }
  #right-panel {
    min-height: 220px;
  }
}

@media (max-width: 768px) {
  .btn-burger {
    display: flex;
  }

  .header-actions {
    position: absolute;
    top: calc(100% + 8px);
    right: 0.75rem;
    background: var(--bg-card);
    border: 3.5px solid var(--ink);
    box-shadow: 6px 6px 0px var(--ink);
    border-radius: var(--radius-md);
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-width: 220px;
    z-index: 1200;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .header-actions.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .header-actions .btn-header {
    width: 100%;
    text-align: center;
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    box-sizing: border-box;
  }
}

@media (max-width: 540px) {
  #header {
    padding: 0.6rem 0.75rem;
  }
  #logo {
    font-size: 1rem;
    padding: 0.2rem 0.45rem;
  }
  #header-left {
    gap: 0.4rem;
  }
  .btn-theme-toggle {
    padding: 0.25rem 0.45rem;
    font-size: 0.95rem;
  }
  #header-right {
    gap: 0.5rem;
  }
  #coin-display {
    font-size: 0.85rem;
    padding: 0.3rem 0.65rem;
  }
  #main {
    padding: 0.75rem;
    gap: 0.85rem;
  }
  #upgrade-zone {
    padding: 1rem;
    border-radius: var(--radius-md);
  }
  #wheel-wrapper {
    width: 170px;
    height: 170px;
  }
  #wheel-svg {
    width: 170px;
    height: 170px;
  }
  .btn-upgrade {
    font-size: 0.95rem;
    padding: 0.75rem 1.6rem;
  }
  .btn-clicker {
    font-size: 0.95rem;
    padding: 0.65rem 1.6rem;
  }
  .item-grid {
    grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
    gap: 0.5rem;
  }
  .modal-box {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    box-shadow: 5px 5px 0px var(--ink);
  }
  .result-icon {
    font-size: 3.5rem;
  }
  .result-title {
    font-size: 1.4rem;
  }
}

/* ============================================================
   ХАММАМ: МОДАЛКА И КНОПКА РИТУАЛА
   ============================================================ */
.btn-hammam-trigger {
  background: linear-gradient(135deg, #FDE047, #F59E0B) !important;
  color: #18181B !important;
  font-weight: 900 !important;
  box-shadow: 3px 3px 0px var(--ink) !important;
  animation: pulseGold 2s infinite ease-in-out;
}

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

.modal-box-hammam {
  width: 95vw;
  max-width: 1050px;
  max-height: 90vh;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 4px solid var(--ink);
  box-shadow: 10px 10px 0px var(--ink);
  border-radius: var(--radius-lg);
  position: relative;
  overflow-y: auto;
  box-sizing: border-box;
}

.btn-modal-close-corner {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: var(--pastel-pink);
  border: 2px solid var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--ink);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease;
}
.btn-modal-close-corner:hover {
  transform: scale(1.1);
}

/* Десктопная сетка: 3 колонки (Видео слева | Контент по центру | Видео справа) */
.hammam-layout {
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  align-items: stretch;
  justify-content: center;
  width: 100%;
  min-height: 480px;
  box-sizing: border-box;
}

.hammam-side-col {
  flex: 0 0 175px;
  max-width: 185px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-md);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  background: #000;
}

.hammam-dancer-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hammam-main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.25rem;
  box-sizing: border-box;
}

.hammam-stage-view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hammam-header-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 0.75rem;
  width: 100%;
}

.hammam-badge {
  background: var(--pastel-yellow);
  border: 2px solid var(--ink);
  padding: 0.2rem 0.7rem;
  border-radius: var(--radius-pill);
  font-weight: 900;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 0.35rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.hammam-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}

.hammam-subtitle {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-muted);
}

/* ===== СЕТКА 3 КАРТ (СТРОГО ОДИНАКОВЫЙ РАЗМЕР) ===== */
.hammam-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  width: 100%;
  margin-bottom: 1.25rem;
  align-items: stretch;
  box-sizing: border-box;
}

.hammam-card {
  background: var(--bg-main);
  border: 3px solid var(--ink);
  border-radius: var(--radius-md);
  box-shadow: 4px 4px 0 var(--ink);
  padding: 0.55rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.hammam-card.owned {
  border-color: #15803D !important;
  background: rgba(34, 197, 94, 0.07);
}

.hammam-card.missing {
  opacity: 0.65;
}

.hammam-card-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  overflow: hidden;
  background: #000;
  flex-shrink: 0;
}

.hammam-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hammam-card-name {
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-main);
  text-align: center;
  height: 2.4em;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  overflow: hidden;
  word-break: break-word;
  flex-shrink: 0;
}

.hammam-card-status {
  font-size: 0.75rem;
  font-weight: 800;
  height: 26px;
  padding: 0 0.35rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-owned {
  background: var(--pastel-green);
  color: #15803D;
}

.status-missing {
  background: var(--pastel-pink);
  color: #DC2626;
}

.hammam-action-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
}

.btn-giant-hammam {
  background: linear-gradient(135deg, #FDE047, #F59E0B);
  color: #18181B;
  border: 4px solid var(--ink);
  box-shadow: 5px 5px 0px var(--ink);
  padding: 0.95rem 1.75rem;
  font-size: 1.15rem;
  font-weight: 900;
  font-family: inherit;
  cursor: pointer;
  border-radius: var(--radius-md);
  text-transform: uppercase;
  width: 100%;
  max-width: 460px;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-sizing: border-box;
}

.btn-giant-hammam:hover:not(:disabled) {
  transform: translate(-2px, -2px);
  box-shadow: 7px 7px 0px var(--ink);
  background: linear-gradient(135deg, #FEF08A, #FBBF24);
}

.btn-giant-hammam:disabled {
  background: #CBD5E1;
  color: #64748B;
  cursor: not-allowed;
  box-shadow: 3px 3px 0px var(--ink);
  opacity: 0.7;
}

.hammam-hint-text {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Колесо Хаммама 50% */
.hammam-wheel-heading {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 0.85rem;
}

.hammam-wheel-wrapper {
  width: 240px;
  height: 240px;
  position: relative;
  margin: 0 auto 1rem;
}

#hammam-wheel-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(4px 4px 0px var(--ink));
}

.hammam-wheel-center-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.8rem;
  font-weight: 900;
  color: #18181B;
  pointer-events: none;
}

.hammam-spin-msg {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-main);
}

/* Результат Хаммама */
.hammam-result-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
}

.hammam-result-title {
  font-size: 1.8rem;
  font-weight: 900;
}
.hammam-result-title.win {
  color: #16A34A;
  text-shadow: 2px 2px 0px var(--ink);
}
.hammam-result-title.fail {
  color: #DC2626;
  text-shadow: 2px 2px 0px var(--ink);
}

.hammam-result-desc {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  max-width: 450px;
}

.hammam-result-video-preview {
  width: 220px;
  border-radius: var(--radius-md);
  border: 3px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
  background: #000;
}

.hammam-result-video-preview video {
  width: 100%;
  display: block;
}

/* ============================================================
   МОБИЛЬНАЯ АДАПТАЦИЯ ХАММАМА (<= 768px)
   ============================================================ */
@media (max-width: 768px) {
  .modal-box-hammam {
    width: 95vw;
    max-width: 420px;
    max-height: 92vh;
    padding: 0.75rem 0.6rem;
    border-width: 3px;
    box-shadow: 5px 5px 0px var(--ink);
    border-radius: var(--radius-md);
  }

  .btn-modal-close-corner {
    top: 0.35rem;
    right: 0.35rem;
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }

  /* На мобилках: флекс-колонка со встроенной верхней шапкой */
  .hammam-layout {
    display: flex;
    flex-direction: column;
    min-height: 0;
    gap: 0.5rem;
    width: 100%;
  }

  /* Видео по бокам на мобилках скрываются из боковых рельсов, так как выводятся в компактном заголовке */
  .hammam-side-col {
    display: none;
  }

  .hammam-main-col {
    width: 100%;
    padding: 0;
  }

  .hammam-header-block {
    margin-bottom: 0.4rem;
  }

  .hammam-badge {
    font-size: 0.65rem;
    padding: 0.12rem 0.45rem;
    margin-bottom: 0.15rem;
  }

  .hammam-title {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
    line-height: 1.15;
    letter-spacing: -0.01em;
  }

  .hammam-subtitle {
    font-size: 0.75rem;
  }

  /* Сетка 3 карт занимает 100% ширины мобилки — ровно и одинаково! */
  .hammam-cards-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
    margin-bottom: 0.65rem;
  }

  .hammam-card {
    padding: 0.35rem 0.2rem;
    border-width: 2px;
    border-radius: var(--radius-sm);
    box-shadow: 2px 2px 0 var(--ink);
    gap: 0.25rem;
  }

  .hammam-card-preview {
    border-width: 1.5px;
  }

  .hammam-card-name {
    font-size: 0.68rem;
    height: 2.3em;
    line-height: 1.15;
  }

  .hammam-card-status {
    font-size: 0.65rem;
    height: 22px;
    padding: 0 0.15rem;
    border-width: 1px;
  }

  .btn-giant-hammam {
    padding: 0.75rem 0.6rem;
    font-size: 0.88rem;
    border-width: 3px;
    box-shadow: 3.5px 3.5px 0px var(--ink);
  }

  .hammam-hint-text {
    font-size: 0.72rem;
    margin-top: 0.3rem;
    line-height: 1.2;
  }

  /* Колесо на мобилках */
  .hammam-wheel-heading {
    font-size: 1rem;
    margin-bottom: 0.35rem;
  }

  .hammam-wheel-wrapper {
    width: 170px;
    height: 170px;
    margin: 0.25rem auto 0.6rem;
  }

  .hammam-wheel-center-label {
    font-size: 1.35rem;
  }

  .hammam-spin-msg {
    font-size: 0.88rem;
  }

  /* Результат на мобилках */
  .hammam-result-title {
    font-size: 1.25rem;
  }

  .hammam-result-desc {
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .hammam-result-video-preview {
    width: 140px;
    box-shadow: 3.5px 3.5px 0 var(--ink);
  }
}

@media (max-width: 360px) {
  .hammam-title {
    font-size: 0.95rem;
  }
  .btn-giant-hammam {
    font-size: 0.8rem;
    padding: 0.65rem 0.4rem;
  }
}
