@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* ── Design tokens (dark default) ── */
:root,
[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0a0c10;
  --bg-elevated: #12151c;
  --surface: #181c26;
  --surface-hover: #1f2430;
  --code-bg: #0d1017;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f3f7;
  --text-secondary: #9aa3b5;
  --text-muted: #6b7280;
  --accent: #e0456a;
  --accent-hover: #c93a5c;
  --accent-subtle: rgba(224, 69, 106, 0.14);
  --accent-glow: rgba(224, 69, 106, 0.35);
  --info: #5b9fd4;
  --success: #3ecf7a;
  --warning: #e6a23c;
  --danger: #ef4444;
  --topbar-h: 56px;
  --topbar-bg: rgba(18, 21, 28, 0.82);
  --mesh-1: rgba(224, 69, 106, 0.14);
  --mesh-2: rgba(91, 159, 212, 0.1);
  --mesh-3: rgba(124, 58, 237, 0.08);
  --mesh-4: rgba(62, 207, 122, 0.05);
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.55);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --panel: #181c26;
  --panel2: #12151c;
  --line: rgba(255, 255, 255, 0.14);
  --pink: #e0456a;
  --blue: #5b9fd4;
  --green: #3ecf7a;
  --muted: #9aa3b5;
}

[data-theme='light'] {
  color-scheme: light;
  --bg: #eef1f8;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-hover: #f3f6fc;
  --code-bg: #e8edf6;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.15);
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-subtle: rgba(224, 69, 106, 0.1);
  --accent-glow: rgba(224, 69, 106, 0.2);
  --topbar-bg: rgba(255, 255, 255, 0.88);
  --mesh-1: rgba(224, 69, 106, 0.1);
  --mesh-2: rgba(91, 159, 212, 0.14);
  --mesh-3: rgba(124, 58, 237, 0.08);
  --mesh-4: rgba(62, 207, 122, 0.08);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 36px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 28px 64px rgba(15, 23, 42, 0.14);
  --panel: #ffffff;
  --panel2: #f8fafc;
  --line: rgba(15, 23, 42, 0.12);
  --muted: #64748b;
}

/* ── Reset & base ── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
  transition: background-color 0.35s var(--ease-out), color 0.35s var(--ease-out);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 90% 60% at 8% -5%, var(--mesh-1), transparent 55%),
    radial-gradient(ellipse 70% 50% at 95% 0%, var(--mesh-2), transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 105%, var(--mesh-3), transparent 55%),
    radial-gradient(ellipse 40% 30% at 80% 80%, var(--mesh-4), transparent 50%);
  animation: meshDrift 18s ease-in-out infinite alternate;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: radial-gradient(circle at 1px 1px, var(--border) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

@keyframes meshDrift {
  0% {
    transform: scale(1) translate(0, 0);
  }
  100% {
    transform: scale(1.04) translate(-1%, 1%);
  }
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  cursor: pointer;
  font-family: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.brand-crumb {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.brand-crumb b {
  color: var(--text);
  font-weight: 700;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.35s var(--ease-out), background 0.2s, border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  transform: rotate(18deg) scale(1.05);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.theme-toggle:active {
  transform: scale(0.96);
}

.brand-area {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 4px 16px var(--accent-glow);
  animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%,
  100% {
    box-shadow: 0 4px 16px var(--accent-glow);
  }
  50% {
    box-shadow: 0 4px 24px var(--accent-glow), 0 0 0 4px var(--accent-subtle);
  }
}

.search {
  width: 230px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px var(--space-3);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search::placeholder {
  color: var(--text-muted);
}

.search:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  outline: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

#languageSelectorMount {
  flex-shrink: 0;
}

.coin {
  background: rgba(180, 140, 40, 0.14);
  color: #e8c547;
  border: 1px solid rgba(180, 140, 40, 0.28);
  padding: 7px var(--space-3);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
}

.profile-box {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  padding: 6px 10px;
  border-radius: var(--radius-md);
}

.logout {
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.28);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s;
}

.logout:hover {
  background: rgba(239, 68, 68, 0.18);
}

/* ── Buttons ── */
.main-btn {
  background: linear-gradient(135deg, var(--accent), #c93a5c);
  border: 1px solid transparent;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s var(--ease-out);
  box-shadow: 0 4px 14px var(--accent-glow);
}

.main-btn:hover {
  background: linear-gradient(135deg, var(--accent-hover), #b83252);
  box-shadow: 0 6px 20px var(--accent-glow);
  transform: translateY(-1px);
}

.main-btn:active {
  transform: translateY(1px);
}

.dark-btn {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s;
}

.dark-btn:hover {
  background: var(--surface-hover);
  border-color: rgba(255, 255, 255, 0.22);
}

/* ── Layout & sidebar ── */
.layout {
  display: flex;
  min-height: calc(100vh - var(--topbar-h));
  position: relative;
  z-index: 1;
}

.side {
  width: 72px;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: var(--space-3) 7px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  transition: background-color 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  min-height: 58px;
  padding: 7px var(--space-1);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 10px;
  text-align: center;
  line-height: 1.15;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.22s var(--ease-out), color 0.22s, border-color 0.22s, transform 0.22s var(--ease-out);
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text);
  transform: translateY(-1px);
}

.nav-item.active {
  background: var(--accent-subtle);
  color: var(--text);
  font-weight: 700;
  border-left-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(224, 69, 106, 0.12);
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.15s, border-color 0.15s;
}

.nav-item.active .nav-icon {
  background: rgba(224, 69, 106, 0.15);
  border-color: rgba(224, 69, 106, 0.35);
}

.nav-badge {
  display: none;
}

.badge-live,
.badge-soon {
  display: none;
}

.main {
  flex: 1;
  padding: var(--space-7) var(--space-8);
  max-width: 100%;
}

.page-hero {
  margin-bottom: var(--space-6);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elevated) 100%);
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  animation: heroIn 0.65s var(--ease-out) both;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent-subtle), transparent);
  transform: translateX(-100%);
  animation: heroShine 6s ease-in-out infinite;
}

.page-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid rgba(224, 69, 106, 0.22);
  margin-bottom: var(--space-3);
}

.page-hero .page-title {
  margin-bottom: var(--space-2);
}

.page-hero .subtitle {
  margin-bottom: 0;
}

.page-title {
  font-size: 28px;
  color: var(--text);
  margin-bottom: var(--space-3);
  font-weight: 700;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text) 20%, var(--info) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme='light'] .page-title {
  background: linear-gradient(135deg, #0f172a 20%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-title + .subtitle,
.subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  max-width: 980px;
  line-height: 1.6;
}

.content {
  display: none;
}

.content.active {
  display: block;
}

.content.active.page-enter {
  animation: pageIn 0.5s var(--ease-out) both;
}

.page-enter .card,
.page-enter .settings-grid,
.page-enter .overlay-layout,
.page-enter .ae-head {
  animation: blockIn 0.55s var(--ease-out) both;
}

.page-enter .card:nth-of-type(1) {
  animation-delay: 0.04s;
}

.page-enter .card:nth-of-type(2) {
  animation-delay: 0.08s;
}

.page-enter .card:nth-of-type(3) {
  animation-delay: 0.12s;
}

.home-grid .mini-card {
  animation: cardIn 0.55s var(--ease-out) both;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s, border-color 0.25s;
}

.home-grid .mini-card:nth-child(1) {
  animation-delay: 0.06s;
}

.home-grid .mini-card:nth-child(2) {
  animation-delay: 0.1s;
}

.home-grid .mini-card:nth-child(3) {
  animation-delay: 0.14s;
}

.home-grid .mini-card:nth-child(4) {
  animation-delay: 0.18s;
}

.home-grid .mini-card:nth-child(5) {
  animation-delay: 0.22s;
}

.home-grid .mini-card:nth-child(6) {
  animation-delay: 0.26s;
}

.home-grid .mini-card:nth-child(7) {
  animation-delay: 0.3s;
}

.home-grid .mini-card:nth-child(8) {
  animation-delay: 0.34s;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes blockIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes heroIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroShine {
  0%,
  70%,
  100% {
    transform: translateX(-100%);
  }
  85% {
    transform: translateX(100%);
  }
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm), var(--shadow-md);
  transition: background-color 0.35s var(--ease-out), border-color 0.35s, box-shadow 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card h3 {
  color: var(--text);
  margin-bottom: var(--space-5);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.pro-soft {
  background: var(--accent-subtle);
  border-color: rgba(224, 69, 106, 0.28);
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: var(--space-5);
}

.mini-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  min-height: 125px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--ease-out), border-color 0.25s, background 0.25s, box-shadow 0.25s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.mini-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent-subtle), transparent 55%);
  opacity: 0;
  transition: opacity 0.25s;
  pointer-events: none;
}

.mini-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--shadow-md);
}

.mini-card:hover::after {
  opacity: 1;
}

.mini-card h4 {
  margin-bottom: 10px;
  font-weight: 600;
  color: var(--text);
}

.mini-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.badge {
  display: inline-block;
  margin-top: 14px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(224, 69, 106, 0.25);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* ── Forms ── */
.form-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: var(--space-5);
  align-items: center;
  margin-bottom: var(--space-4);
}

label {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

input,
select,
textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px var(--space-3);
  width: 100%;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.35s var(--ease-out);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
  outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239aa3b5' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}

.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

.check-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.range-row {
  display: grid;
  grid-template-columns: 180px 1fr 60px;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}

.range-row input[type='range'] {
  padding: 0;
  height: 6px;
  accent-color: var(--accent);
  background: transparent;
  border: none;
}

.range-row input[type='range']::-webkit-slider-runnable-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.range-row input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: -6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.range-row input[type='range']::-moz-range-track {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.range-row input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
}

.range-row span,
.world-slider-row span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.small-note {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: var(--space-2);
}

/* ── Overlay layout ── */
.overlay-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--space-5);
}

.category-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.cat-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: var(--text-secondary);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: var(--space-1);
  transition: background 0.15s, color 0.15s;
}

.cat-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.cat-btn.active {
  background: var(--accent-subtle);
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 9px;
}

.overlay-section {
  display: none;
}

.overlay-section.active {
  display: block;
}

/* ── OBS link boxes ── */
.code-box {
  margin-top: 14px;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px var(--space-4);
  color: #5a9fd4;
  font-family: ui-monospace, 'SF Mono', 'Cascadia Code', Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  word-break: break-all;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-out);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  position: relative;
}

[data-theme='light'] .code-box {
  color: #2563eb;
}

.code-box:hover {
  border-color: rgba(224, 69, 106, 0.4);
  box-shadow: inset 0 0 0 1px var(--accent-subtle), 0 8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.preview-box {
  background: linear-gradient(135deg, #1a1510, #2a2015);
  border: 1px solid rgba(183, 135, 54, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  margin-top: 15px;
}

.pp {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #111;
  border: 3px solid #c9a84a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #c9a84a;
}

.chat-preview {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.chat-user {
  color: #c9a84a;
  font-weight: 700;
  margin-bottom: 6px;
}

.chat-text {
  color: var(--text);
  font-size: 15px;
  line-height: 1.4;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

.tts-log {
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-4);
  min-height: 90px;
  color: var(--text-secondary);
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 12.5px;
  white-space: pre-wrap;
  line-height: 1.55;
}

/* ── Tables ── */
.table-like {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.table-like th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 12px 14px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  text-align: left;
}

.table-like td {
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  text-align: left;
  color: var(--text-secondary);
  vertical-align: middle;
}

.table-like tbody tr:hover td {
  background: var(--surface-hover);
}

/* ── Actions & Events ── */
.ae-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

.ae-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ae-actions .main-btn,
.ae-actions .dark-btn {
  min-width: 170px;
}

.ae-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ae-empty {
  color: var(--text-muted);
  text-align: center;
  padding: var(--space-5) !important;
}

.ae-muted {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.45;
}

.ae-pill {
  display: inline-block;
  background: var(--accent-subtle);
  color: var(--text);
  border: 1px solid rgba(224, 69, 106, 0.22);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
}

.ae-file {
  max-width: 360px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--info);
}

.ae-mini-row {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.ae-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.ae-toolbar-title {
  font-size: 16px;
  color: var(--text);
  font-weight: 600;
}

.ae-count {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.ae-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
}

body.ae-modal-open {
  overflow: hidden;
}

.ae-modal.hidden {
  display: none !important;
}

.ae-modal-bg {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ae-modal-box {
  position: relative;
  z-index: 1;
  width: 560px;
  max-width: 96vw;
  max-height: min(92vh, 880px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transition: background-color 0.35s var(--ease-out), border-color 0.35s;
}

.ae-modal-box--form {
  width: min(660px, 96vw);
}

.ae-modal:not(.hidden) .ae-modal-box {
  animation: modalIn 0.35s var(--ease-out) both;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

#authModal .ae-modal-box {
  width: 430px;
  max-height: 92vh;
}

.ae-modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--surface);
}

.ae-modal-head-text {
  min-width: 0;
}

.ae-modal-kicker {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 4px;
}

.ae-modal-title {
  font-size: 18px;
  color: var(--text);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.ae-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.ae-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.ae-modal-body {
  padding: var(--space-5);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.ae-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-shrink: 0;
}

.ae-modal-foot .main-btn,
.ae-modal-foot .dark-btn {
  min-width: 120px;
}

.ae-modal-body .form-row,
.ae-modal-body .ae-form-row {
  grid-template-columns: 150px 1fr;
}

/* ── Auth & account ── */
.auth-card-clean {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
}

.auth-choice-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.account-connected {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: var(--space-5);
}

.account-avatar {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
}

.account-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.account-sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 3px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-1);
  margin-bottom: var(--space-5);
}

.auth-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.auth-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.auth-modal-note {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  margin: -4px 0 var(--space-4);
  text-align: center;
}

/* ── Mini games & arena ── */
.game-card {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.game-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.game-card.active {
  border-color: var(--success);
  box-shadow: 0 0 0 1px rgba(62, 207, 122, 0.25);
}

.game-open-btn {
  margin-top: 14px;
  background: var(--accent);
  border: 0;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s;
}

.game-open-btn:hover {
  background: var(--accent-hover);
}

.game-panel {
  display: none;
}

.game-panel.active {
  display: block;
}

.arena-theme-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.theme-card {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  background: var(--bg-elevated);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.theme-card:hover {
  background: var(--surface-hover);
}

.theme-card.active {
  border-color: var(--success);
  background: rgba(62, 207, 122, 0.08);
  box-shadow: none;
}

.theme-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  margin: 0 auto 8px;
}

.gift-picker-wrap {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: var(--space-3);
  align-items: center;
}

.gift-preview-img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--code-bg);
  border: 1px solid var(--border-strong);
}

.effect-info {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  margin-top: var(--space-2);
  color: var(--text-secondary);
}

.effect-stars {
  letter-spacing: 1px;
  color: #d4a843;
  font-weight: 700;
}

.effect-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 6px 9px;
}

.effect-icon {
  font-size: 20px;
}

.arena-status-note {
  margin-top: 10px;
  color: var(--success);
  font-size: 12px;
}

.arena-warning {
  color: var(--warning);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
}

.arena-visual-status {
  color: var(--success);
  font-size: 12px;
  margin-top: var(--space-2);
}

#arenaPanel .card.arena-fold {
  padding: 0;
  overflow: hidden;
}

#arenaPanel .card.arena-fold > h3 {
  margin: 0;
  padding: var(--space-4) 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid transparent;
}

#arenaPanel .card.arena-fold > h3::after {
  content: '▾';
  font-size: 16px;
  color: var(--text-muted);
  transition: transform 0.18s;
}

#arenaPanel .card.arena-fold.open > h3 {
  border-bottom-color: var(--border);
}

#arenaPanel .card.arena-fold.open > h3::after {
  transform: rotate(180deg);
  color: var(--success);
}

#arenaPanel .card.arena-fold:not(.open) > :not(h3) {
  display: none !important;
}

#arenaPanel .card.arena-fold.open > :not(h3) {
  padding-left: 22px;
  padding-right: 22px;
}

#arenaPanel .card.arena-fold.open > h3 + * {
  margin-top: var(--space-5);
}

.mini-game-card-list.hidden {
  display: none !important;
}

.arena-panel-head {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.arena-panel-head.active {
  display: flex;
}

.back-game-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.15s;
}

.back-game-btn:hover {
  background: var(--surface-hover);
}

.gift-custom-picker {
  position: relative;
}

.gift-picker-selected {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.gift-picker-selected:hover {
  border-color: rgba(255, 255, 255, 0.22);
}

.gift-picker-selected img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--code-bg);
}

.gift-picker-menu {
  position: absolute;
  z-index: 120;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  max-height: 330px;
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: var(--space-2);
}

.gift-picker-search {
  margin-bottom: var(--space-2);
}

.gift-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text);
  text-align: left;
  padding: 9px;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
}

.gift-picker-item:hover {
  background: var(--surface-hover);
}

.gift-picker-item.active {
  background: var(--accent-subtle);
  border: 1px solid rgba(224, 69, 106, 0.35);
}

.gift-picker-item img {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--code-bg);
  flex-shrink: 0;
}

.gift-picker-item img.is-placeholder,
.gift-picker-selected img.is-placeholder {
  object-fit: contain;
  padding: 6px;
  opacity: 0.75;
}

.gift-picker-empty {
  padding: 12px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.gift-picker-item-meta,
.gift-picker-selected-meta {
  min-width: 0;
  flex: 1;
}

.gift-country-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(36, 196, 255, 0.12);
  border: 1px solid rgba(36, 196, 255, 0.35);
  color: #8adfff;
  margin-top: 8px;
}

.gift-country-badge.is-global {
  background: rgba(255, 193, 7, 0.1);
  border-color: rgba(255, 193, 7, 0.35);
  color: #ffd56a;
}

.gift-country-source {
  opacity: 0.75;
  font-size: 11px;
}

.gift-picker-name {
  font-weight: 700;
}

.gift-picker-coin {
  font-size: 12px;
  color: #d4a843;
  margin-top: 3px;
}

.gift-preview-line {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px;
}

.gift-preview-line img {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--code-bg);
}

.rarity-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.rarity-stars {
  display: inline-flex;
  gap: 2px;
}

.rarity-star {
  font-size: 14px;
  color: var(--text-muted);
  filter: grayscale(1);
  opacity: 0.55;
}

.rarity-star.on {
  color: #d4a843;
  filter: none;
  opacity: 1;
}

.rarity-chip {
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 7px;
  border: 1px solid var(--border-strong);
}

.rarity-common {
  color: #cbd5e1;
  border-color: #64748b;
  background: rgba(100, 116, 139, 0.14);
}

.rarity-rare {
  color: #60a5fa;
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.13);
}

.rarity-epic {
  color: #c084fc;
  border-color: #9333ea;
  background: rgba(147, 51, 234, 0.14);
}

.rarity-legendary {
  color: #facc15;
  border-color: #ca8a04;
  background: rgba(202, 138, 4, 0.13);
}

.rarity-mythic {
  color: #ff5b7e;
  border-color: #ff0050;
  background: rgba(255, 0, 80, 0.12);
  box-shadow: none;
}

.arena-sound-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 10px;
}

.arena-feed-row {
  display: grid;
  grid-template-columns: 28px 180px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: var(--space-3);
}

.arena-feed-row input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.arena-feed-row .feed-label {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13px;
}

.arena-feed-row .feed-prefix {
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Pets ── */
.pet-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  min-height: 150px;
}

.pet-card::before {
  content: '';
  position: absolute;
  right: -55px;
  top: -55px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124, 58, 237, 0.12), transparent 70%);
  filter: blur(3px);
  pointer-events: none;
}

.pet-card h4 {
  position: relative;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 9px;
  font-weight: 600;
}

.pet-card p {
  position: relative;
  color: var(--text-secondary);
  line-height: 1.55;
}

.pet-open-btn {
  position: relative;
  margin-top: 14px;
  background: var(--accent);
  border: 0;
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-weight: 700;
  font-size: 13px;
}

.pet-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.pet-back-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-weight: 700;
  font-size: 13px;
}

.pet-preview-box {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.pet-avatar {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  background: radial-gradient(circle at 35% 25%, #6f35a8, #191122 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  box-shadow: var(--shadow-sm);
}

.pet-title {
  font-size: 21px;
  font-weight: 700;
  color: var(--text);
}

.pet-sub {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: var(--space-1);
}

.pet-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pet-stat {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3);
}

.pet-stat b {
  display: block;
  color: var(--text);
  font-size: 18px;
  margin-top: var(--space-1);
  font-weight: 700;
}

.pet-stat span {
  color: var(--text-muted);
  font-size: 12px;
}

.pet-status-note {
  margin-top: 10px;
  color: var(--success);
  font-size: 12px;
}

.pet-warning {
  color: var(--warning);
  font-size: 12px;
  line-height: 1.45;
  margin-top: 6px;
}

/* ── Overlay preview dots ── */
.overlay-pro-preview {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(5, 42px);
  gap: 9px;
  align-items: end;
}

.overlay-pro-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--code-bg);
  border: 2px solid rgba(224, 69, 106, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.overlay-pro-dot:first-child {
  width: 58px;
  height: 58px;
  border-color: rgba(201, 168, 74, 0.65);
}

/* ── World 3D panel ── */
.world-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1812 0%, #161922 55%, #0f1117 100%);
  border-color: rgba(183, 135, 54, 0.35);
}

.world-hero::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 74, 0.1), transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}

.world-hero > * {
  position: relative;
}

.world-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.world-preview {
  height: 210px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(183, 135, 54, 0.22);
  background: linear-gradient(180deg, #1e2838, #141c18);
  position: relative;
  overflow: hidden;
  margin-top: var(--space-4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.world-preview .iso-ground {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 420px;
  height: 230px;
  background: linear-gradient(135deg, #2c7b3f, #174c2b);
  transform: translate(-50%, -50%) rotateX(58deg) rotateZ(45deg);
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

.world-preview .iso-castle {
  position: absolute;
  left: 50%;
  top: 38%;
  width: 100px;
  height: 98px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 20px 16px rgba(0, 0, 0, 0.3));
}

.world-preview .iso-castle::before {
  content: '';
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 0;
  height: 72px;
  background: linear-gradient(180deg, #d7d7d7, #8f8f8f);
  border: 2px solid rgba(0, 0, 0, 0.16);
  clip-path: polygon(0 24%, 20% 24%, 20% 0, 36% 0, 36% 24%, 64% 24%, 64% 0, 80% 0, 80% 24%, 100% 24%, 100% 100%, 0 100%);
}

.world-preview .iso-castle::after {
  content: '👑';
  position: absolute;
  left: 34px;
  top: -22px;
  font-size: 32px;
}

.world-preview .iso-house {
  position: absolute;
  width: 44px;
  height: 38px;
  background: #c78945;
  border-radius: var(--radius-sm);
  box-shadow: 0 12px 14px rgba(0, 0, 0, 0.25);
}

.world-preview .iso-house::before {
  content: '';
  position: absolute;
  left: -5px;
  right: -5px;
  top: -18px;
  height: 24px;
  background: #7b2b2b;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.world-preview .h1 {
  left: 385px;
  top: 128px;
}

.world-preview .h2 {
  left: 720px;
  top: 132px;
}

.world-preview .h3 {
  left: 282px;
  top: 92px;
}

.world-preview .worker {
  position: absolute;
  font-size: 22px;
  animation: worldWorker 4.5s ease-in-out infinite;
}

.world-preview .w1 {
  left: 412px;
  top: 92px;
}

.world-preview .w2 {
  left: 660px;
  top: 106px;
  animation-delay: 1s;
}

.world-preview .tree {
  position: absolute;
  font-size: 28px;
  filter: drop-shadow(0 6px 4px rgba(0, 0, 0, 0.25));
}

.world-preview .t1 {
  left: 260px;
  top: 132px;
}

.world-preview .t2 {
  left: 790px;
  top: 88px;
}

.world-preview .t3 {
  left: 498px;
  top: 150px;
}

.world-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.world-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.world-rule-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.world-rule-card h4 {
  margin-bottom: 10px;
  color: #c9a84a;
  font-weight: 600;
}

.world-rule-card .form-row {
  grid-template-columns: 120px 1fr;
  margin-bottom: 10px;
}

.world-mini-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 7px;
}

.world-pill {
  display: inline-block;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  margin: 2px;
}

.world-status-note {
  color: var(--success);
  font-size: 12px;
  margin-top: 10px;
  white-space: pre-wrap;
}

.world-danger-note {
  color: var(--warning);
  font-size: 12px;
  margin-top: var(--space-2);
  line-height: 1.45;
}

.world-toggle-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.world-toggle-list .check-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px;
  margin: 0;
}

.world-slider-row {
  display: grid;
  grid-template-columns: 180px 1fr 70px;
  gap: var(--space-3);
  align-items: center;
  margin-bottom: var(--space-3);
}

.world-slider-row input {
  padding: 0;
}

@keyframes worldWorker {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(42px, 16px);
  }
}

/* ── AI Host panel ── */
.ai-host-preview {
  position: relative;
  min-height: 230px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: linear-gradient(135deg, #161922, #0f1117);
  overflow: hidden;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-host-face {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.15);
  position: relative;
  box-shadow: var(--shadow-md);
}

.ai-host-face::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: -8px;
  height: 42px;
  border-radius: 55px 55px 22px 22px;
}

.ai-host-eye {
  position: absolute;
  top: 58px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
}

.ai-host-eye.l {
  left: 34px;
}

.ai-host-eye.r {
  right: 34px;
}

.ai-host-mouth {
  position: absolute;
  left: 50%;
  top: 92px;
  width: 40px;
  height: 12px;
  transform: translateX(-50%);
  border-radius: 0 0 25px 25px;
}

.ai-host-wave {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  align-items: end;
}

.ai-host-wave span {
  width: 6px;
  border-radius: 99px;
  background: var(--accent);
  animation: aiWave 1s ease-in-out infinite;
}

.ai-host-wave span:nth-child(1) {
  height: 18px;
}

.ai-host-wave span:nth-child(2) {
  height: 34px;
  animation-delay: 0.1s;
}

.ai-host-wave span:nth-child(3) {
  height: 24px;
  animation-delay: 0.2s;
}

.ai-host-wave span:nth-child(4) {
  height: 40px;
  animation-delay: 0.3s;
}

.ai-host-wave span:nth-child(5) {
  height: 20px;
  animation-delay: 0.4s;
}

@keyframes aiWave {
  0%,
  100% {
    transform: scaleY(0.45);
    opacity: 0.55;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.ai-host-preview[data-avatar='isaacgaming'] .ai-host-face {
  background: radial-gradient(circle at 35% 25%, #dbeafe, #8ab4ff 45%, #27344f);
  border-color: rgba(96, 165, 250, 0.55);
  box-shadow: var(--shadow-md);
}

.ai-host-preview[data-avatar='isaacgaming'] .ai-host-face::before {
  background: linear-gradient(180deg, #0f172a, #020617);
}

.ai-host-preview[data-avatar='isaacgaming'] .ai-host-eye {
  background: #38bdf8;
  box-shadow: none;
}

.ai-host-preview[data-avatar='isaacgaming'] .ai-host-mouth {
  background: #0f172a;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.ai-host-preview[data-avatar='lostgaming'] .ai-host-face {
  background: radial-gradient(circle at 35% 25%, #fff1d6, #e0a06e 45%, #87503d);
  border-color: rgba(212, 175, 55, 0.45);
  box-shadow: var(--shadow-md);
}

.ai-host-preview[data-avatar='lostgaming'] .ai-host-face::before {
  background: linear-gradient(180deg, #111, #000);
}

.ai-host-preview[data-avatar='lostgaming'] .ai-host-eye {
  background: #09090b;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.75);
}

.ai-host-preview[data-avatar='hijiki'] .ai-host-face {
  background: radial-gradient(circle at 35% 25%, #2b2b2f, #111 48%, #050505);
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: var(--shadow-md);
}

.ai-host-preview[data-avatar='hijiki'] .ai-host-face::before {
  background: linear-gradient(180deg, #0a0a0a, #000);
}

.ai-host-preview[data-avatar='hijiki'] .ai-host-eye {
  background: #ffd166;
  box-shadow: none;
}

.ai-host-preview[data-avatar='hijiki'] .ai-host-mouth {
  background: #050505;
  border: 1px solid rgba(255, 209, 102, 0.45);
}

.ai-reaction-card {
  grid-column: 1 / -1;
}

.ai-reaction-builder {
  display: grid;
  grid-template-columns: 1.2fr 0.75fr 2fr auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.ai-reaction-builder .form-mini label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 500;
}

.ai-reaction-table-wrap {
  overflow-x: auto;
  margin-top: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  -webkit-overflow-scrolling: touch;
}

.ai-reaction-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 860px;
}

.ai-reaction-table th,
.ai-reaction-table td {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  color: var(--text-secondary);
}

.ai-reaction-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
  position: sticky;
  top: 0;
}

.ai-reaction-table tr:first-child th {
  border-top: 0;
}

.ai-reaction-table tbody tr:hover td {
  background: var(--surface-hover);
}

.ai-reaction-name {
  font-weight: 700;
  color: var(--text);
}

.ai-reaction-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-1);
}

.ai-reaction-text {
  max-width: 520px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
}

.ai-reaction-pill {
  display: inline-block;
  background: var(--accent-subtle);
  border: 1px solid rgba(224, 69, 106, 0.22);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
}

.ai-reaction-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.ai-reaction-empty {
  padding: var(--space-5) !important;
  text-align: center;
  color: var(--text-muted);
}

.ai-reaction-editing {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 1px rgba(62, 207, 122, 0.22) !important;
}

.ai-v2-panel {
  grid-column: 1 / -1;
}

.ai-v2-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
  user-select: none;
  margin-bottom: 0 !important;
}

.ai-v2-head::after {
  content: '▾';
  color: var(--text-muted);
  font-size: 18px;
  transition: transform 0.18s;
}

.ai-v2-panel.collapsed .ai-v2-head::after {
  transform: rotate(-90deg);
}

.ai-v2-body {
  margin-top: var(--space-5);
}

.ai-v2-panel.collapsed .ai-v2-body {
  display: none !important;
}

.ai-v2-builder {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.ai-v2-builder .wide {
  grid-column: span 2;
}

.ai-v2-builder .full {
  grid-column: 1 / -1;
}

.ai-v2-mini label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 6px;
  font-weight: 500;
}

.ai-v2-actions {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.ai-v2-audio-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-2);
  align-items: center;
}

.ai-v2-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 980px;
}

.ai-v2-table th,
.ai-v2-table td {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  text-align: left;
  vertical-align: middle;
  color: var(--text-secondary);
}

.ai-v2-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface);
  position: sticky;
  top: 0;
}

.ai-v2-table-wrap {
  overflow-x: auto;
  margin-top: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  -webkit-overflow-scrolling: touch;
}

.ai-v2-table tbody tr:hover td {
  background: var(--surface-hover);
}

.ai-v2-empty {
  padding: var(--space-5) !important;
  text-align: center;
  color: var(--text-muted);
}

.ai-v2-tag {
  display: inline-block;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.ai-v2-text {
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Overlay Studio (Kaplama) ── */
.overlay-page-hero {
  margin-bottom: var(--space-6);
}

.overlay-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-5);
  align-items: start;
}

.overlay-nav {
  position: sticky;
  top: calc(var(--topbar-h) + var(--space-4));
  padding: var(--space-4);
}

.overlay-nav-head {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  padding: 0 var(--space-1);
}

.overlay-nav .cat-btn {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-3);
  min-height: 0;
  padding: var(--space-3);
  text-align: left;
  border-left: 3px solid transparent;
  margin-bottom: var(--space-2);
}

.overlay-nav .cat-btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.overlay-nav .cat-btn-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.overlay-nav .cat-btn-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.overlay-nav .cat-btn-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.overlay-nav .cat-btn.active .cat-btn-icon {
  background: var(--accent-subtle);
  border-color: rgba(224, 69, 106, 0.35);
}

.overlay-studio-wrap {
  min-width: 0;
}

.overlay-studio {
  display: grid;
  grid-template-columns: minmax(300px, 420px) 1fr;
  gap: var(--space-5);
  animation: pageIn 0.45s var(--ease-out) both;
}

.overlay-studio-config {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm), var(--shadow-md);
}

.overlay-studio-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.overlay-studio-kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.overlay-studio-head h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.overlay-studio-desc {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}

.overlay-studio-pill {
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.overlay-studio-pill.live {
  background: rgba(62, 207, 122, 0.12);
  color: var(--success);
  border: 1px solid rgba(62, 207, 122, 0.28);
}

.overlay-studio-pill.soon {
  background: rgba(230, 162, 60, 0.12);
  color: var(--warning);
  border: 1px solid rgba(230, 162, 60, 0.28);
}

.overlay-pack-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  padding: var(--space-1);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.overlay-pack-tab {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.overlay-pack-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.overlay-field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

.overlay-design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.overlay-design-grid-chat {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overlay-design-swatch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  text-align: left;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease-out);
}

.overlay-design-swatch:hover {
  border-color: var(--border-strong);
  transform: translateY(-1px);
}

.overlay-design-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-subtle);
}

.overlay-design-swatch.hidden-by-pack {
  display: none;
}

.overlay-swatch-chip {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.overlay-swatch-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
}

.overlay-native-select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Actions Events promo overlay controls */
.ae-promo-select {
  width: 100%;
}

.ae-promo-range {
  width: 100%;
  accent-color: var(--accent, #b06bff);
  cursor: pointer;
}

/* Actions Events pack picker grid */
.ae-pack-form-row {
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

.ae-pack-form-row > label {
  margin-bottom: 0;
}

.ae-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.ae-pack-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  text-align: center;
}

.ae-pack-card:hover {
  border-color: rgba(176, 107, 255, 0.45);
  transform: translateY(-1px);
}

.ae-pack-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(224, 69, 106, 0.35), 0 6px 18px rgba(0, 0, 0, 0.2);
  background: var(--accent-subtle);
}

.ae-pack-emoji { font-size: 20px; line-height: 1; }
.ae-pack-name { font-size: 10px; font-weight: 700; color: var(--text); line-height: 1.2; }
.ae-pack-group { font-size: 8px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* Category filter tabs */
.ae-pack-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-pack-cat-btn {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ae-pack-cat-btn:hover { color: var(--text); }
.ae-pack-cat-btn.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--text); }

/* Pack thumbnail mock preview — pure CSS, animates ONLY on :hover (zero idle cost) */
.ae-pack-thumb {
  position: relative; display: block; width: 100%; height: 46px; margin-bottom: 2px;
  border-radius: 6px; overflow: hidden;
  background: linear-gradient(160deg, rgba(176,107,255,0.14), rgba(51,230,240,0.08));
}
.ae-pack-thumb i { position: absolute; display: block; border-radius: 3px; background: linear-gradient(160deg, #b06bff, #6f3ff5); }

/* coverflow */
.ae-pack-thumb .tf-a, .ae-pack-thumb .tf-b, .ae-pack-thumb .tf-c { width: 16px; height: 26px; top: 10px; transition: transform 0.35s ease; }
.ae-pack-thumb .tf-a { left: 14px; opacity: 0.5; transform: rotate(-8deg); }
.ae-pack-thumb .tf-b { left: 32px; opacity: 1; z-index: 2; }
.ae-pack-thumb .tf-c { left: 50px; opacity: 0.5; transform: rotate(8deg); }
.ae-pack-card:hover .ae-pack-thumb .tf-a { transform: translateX(-4px) rotate(-14deg); }
.ae-pack-card:hover .ae-pack-thumb .tf-c { transform: translateX(4px) rotate(14deg); }

/* orbit */
.ae-pack-thumb .tf-core { width: 8px; height: 8px; border-radius: 50%; left: 40px; top: 19px; background: #fff; box-shadow: 0 0 6px #b06bff; }
.ae-pack-thumb .tf-dot { width: 6px; height: 6px; border-radius: 50%; }
.ae-pack-thumb .tf-d1 { left: 12px; top: 19px; } .ae-pack-thumb .tf-d2 { left: 38px; top: 4px; } .ae-pack-thumb .tf-d3 { left: 64px; top: 30px; }
.ae-pack-card:hover .ae-pack-thumb .tf-dot { animation: aeThumbOrbit 1.6s linear infinite; }
@keyframes aeThumbOrbit { from { filter: brightness(1); } 50% { filter: brightness(1.6); } to { filter: brightness(1); } }

/* stack */
.ae-pack-thumb .tf-s1, .ae-pack-thumb .tf-s2, .ae-pack-thumb .tf-s3 { width: 30px; height: 22px; left: 24px; top: 12px; transition: transform 0.3s ease; }
.ae-pack-thumb .tf-s2 { top: 8px; left: 28px; opacity: 0.75; } .ae-pack-thumb .tf-s3 { top: 4px; left: 32px; opacity: 0.5; }
.ae-pack-card:hover .ae-pack-thumb .tf-s3 { transform: translate(6px,-4px) rotate(6deg); }

/* grid */
.ae-pack-thumb .tf-g { width: 12px; height: 10px; }
.ae-pack-thumb .tf-g:nth-child(1){left:14px;top:8px;} .ae-pack-thumb .tf-g:nth-child(2){left:34px;top:8px;} .ae-pack-thumb .tf-g:nth-child(3){left:54px;top:8px;}
.ae-pack-thumb .tf-g:nth-child(4){left:14px;top:26px;} .ae-pack-thumb .tf-g:nth-child(5){left:34px;top:26px;} .ae-pack-thumb .tf-g:nth-child(6){left:54px;top:26px;}
.ae-pack-card:hover .ae-pack-thumb .tf-g { animation: aeThumbPulse 1.2s ease-in-out infinite; }
.ae-pack-thumb .tf-g:nth-child(2n) { animation-delay: 0.15s; }
@keyframes aeThumbPulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

/* bar */
.ae-pack-thumb .tf-bar { width: 64px; height: 12px; left: 8px; top: 17px; border-radius: 999px; }
.ae-pack-card:hover .ae-pack-thumb .tf-bar { animation: aeThumbGlow 1.4s ease-in-out infinite; }
@keyframes aeThumbGlow { 0%,100% { box-shadow: 0 0 2px rgba(176,107,255,0.4); } 50% { box-shadow: 0 0 10px rgba(176,107,255,0.9); } }

/* vertical */
.ae-pack-thumb .tf-vbar { width: 16px; height: 10px; left: 32px; transition: transform 0.3s ease; }
.ae-pack-thumb .tf-v1 { top: 6px; opacity: 0.5; } .ae-pack-thumb .tf-v2 { top: 18px; } .ae-pack-thumb .tf-v3 { top: 30px; opacity: 0.5; }
.ae-pack-card:hover .ae-pack-thumb .tf-v1 { transform: translateY(-3px); } .ae-pack-card:hover .ae-pack-thumb .tf-v3 { transform: translateY(3px); }

/* split */
.ae-pack-thumb .tf-split-l, .ae-pack-thumb .tf-split-r { width: 32px; height: 36px; top: 5px; }
.ae-pack-thumb .tf-split-l { left: 6px; background: linear-gradient(160deg,#33e6f0,#1a8f96); }
.ae-pack-thumb .tf-split-r { left: 40px; }
.ae-pack-card:hover .ae-pack-thumb .tf-split-l { transform: translateX(-3px); }
.ae-pack-card:hover .ae-pack-thumb .tf-split-r { transform: translateX(3px); }

/* badge */
.ae-pack-thumb .tf-badge { width: 26px; height: 26px; left: 27px; top: 10px; border-radius: 50%; background: radial-gradient(circle, #ffd76b, #b8860b); }
.ae-pack-card:hover .ae-pack-thumb .tf-badge { animation: aeThumbPulse 1.3s ease-in-out infinite; }

/* spotlight */
.ae-pack-thumb .tf-beam { width: 40px; height: 46px; left: 20px; top: -20px; background: linear-gradient(180deg, rgba(255,255,255,0.35), transparent); border-radius: 50% 50% 0 0; opacity: 0.6; }
.ae-pack-thumb .tf-spot-card { width: 20px; height: 16px; left: 30px; top: 22px; }
.ae-pack-card:hover .ae-pack-thumb .tf-beam { animation: aeThumbSweep 1.8s ease-in-out infinite; }
@keyframes aeThumbSweep { 0%,100% { transform: translateX(-4px) rotate(-6deg); } 50% { transform: translateX(4px) rotate(6deg); } }

/* minimal */
.ae-pack-thumb .tf-line { width: 50px; height: 1px; left: 13px; top: 18px; background: rgba(255,255,255,0.5); }
.ae-pack-thumb .tf-line2 { top: 26px; width: 30px; }
.ae-pack-card:hover .ae-pack-thumb .tf-line { animation: aeThumbGlow 1.4s ease-in-out infinite; }

/* particle */
.ae-pack-thumb .tf-pcard { width: 26px; height: 20px; left: 27px; top: 13px; }
.ae-pack-thumb .tf-p { width: 3px; height: 3px; border-radius: 50%; background: #00f2ea; }
.ae-pack-thumb .tf-p1 { left: 16px; top: 8px; } .ae-pack-thumb .tf-p2 { left: 60px; top: 30px; } .ae-pack-thumb .tf-p3 { left: 62px; top: 10px; }
.ae-pack-card:hover .ae-pack-thumb .tf-p { animation: aeThumbFloatUp 1.6s ease-in-out infinite; }
@keyframes aeThumbFloatUp { 0% { transform: translateY(0); opacity: 0.4; } 50% { opacity: 1; } 100% { transform: translateY(-10px); opacity: 0; } }

/* float */
.ae-pack-thumb .tf-blob { width: 26px; height: 26px; border-radius: 50%; filter: blur(4px); opacity: 0.6; }
.ae-pack-thumb .tf-b1 { left: 12px; top: 8px; background: #b06bff; } .ae-pack-thumb .tf-b2 { left: 40px; top: 16px; background: #ff5bb0; }
.ae-pack-card:hover .ae-pack-thumb .tf-blob { animation: aeThumbFloatSoft 2.2s ease-in-out infinite; }
@keyframes aeThumbFloatSoft { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* hud */
.ae-pack-thumb .tf-hud { width: 40px; height: 26px; left: 20px; top: 10px; background: rgba(0,242,234,0.12); border: 1px solid rgba(0,242,234,0.6); border-radius: 2px; }
.ae-pack-card:hover .ae-pack-thumb .tf-hud { animation: aeThumbGlow 1.2s ease-in-out infinite; }

/* ice */
.ae-pack-thumb .tf-shard { width: 30px; height: 30px; left: 25px; top: 8px; background: linear-gradient(135deg,#bfe7ff,#4fa9d9); clip-path: polygon(50% 0, 100% 35%, 82% 100%, 18% 100%, 0 35%); }
.ae-pack-card:hover .ae-pack-thumb .tf-shard { animation: aeThumbPulse 1.5s ease-in-out infinite; }

/* Variant chip picker */
.ae-variant-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ae-variant-row-label { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.ae-variant-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ae-variant-chip {
  font-size: 11px; font-weight: 700; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-muted); cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.ae-variant-chip:hover { color: var(--text); }
.ae-variant-chip.active { background: var(--accent-subtle); border-color: var(--accent); color: var(--text); }

/* Toggle switch (Transparent mode) */
.ae-toggle-switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.ae-toggle-switch input { opacity: 0; width: 0; height: 0; }
.ae-toggle-slider {
  position: absolute; inset: 0; cursor: pointer; background: var(--border-strong);
  border-radius: 999px; transition: background 0.2s;
}
.ae-toggle-slider::before {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform 0.2s;
}
.ae-toggle-switch input:checked + .ae-toggle-slider { background: var(--accent); }
.ae-toggle-switch input:checked + .ae-toggle-slider::before { transform: translateX(18px); }

@media (prefers-reduced-motion: reduce) {
  .ae-pack-thumb i { animation: none !important; transition: none !important; }
}

/* Actions Events promo preview stage — transparency checkerboard, theme-aware */
.overlay-preview-stage.ae-promo-preview-stage {
  padding: 0;
  min-height: 0;
  background-color: var(--ae-pv-base, #0e0b18);
  background-image:
    linear-gradient(45deg, var(--ae-pv-sq, #171326) 25%, transparent 25%),
    linear-gradient(-45deg, var(--ae-pv-sq, #171326) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--ae-pv-sq, #171326) 75%),
    linear-gradient(-45deg, transparent 75%, var(--ae-pv-sq, #171326) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

[data-theme='dark'] .overlay-preview-stage.ae-promo-preview-stage {
  --ae-pv-base: #0e0b18;
  --ae-pv-sq: #171326;
}

[data-theme='light'] .overlay-preview-stage.ae-promo-preview-stage {
  --ae-pv-base: #e7ebf5;
  --ae-pv-sq: #d3d9ea;
}

.overlay-pp-chips {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  flex-wrap: wrap;
}

.overlay-pp-chip {
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.overlay-pp-chip.active {
  background: var(--accent-subtle);
  border-color: rgba(224, 69, 106, 0.4);
  color: var(--text);
}

.overlay-link-panel {
  margin-top: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.overlay-link-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.overlay-link-hint {
  font-weight: 500;
  color: var(--text-muted);
}

.overlay-link-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.overlay-studio-preview {
  min-width: 0;
}

.overlay-live-preview {
  --pv-c1: #ffd56a;
  --pv-c2: #ff7aa8;
  --pv-bg: rgba(10, 12, 18, 0.92);
  --pv-line: rgba(255, 213, 106, 0.55);
  --pv-text: #fff4c2;
  --pv-glow: rgba(255, 213, 106, 0.35);
  height: 100%;
  min-height: 520px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at 50% 0%, var(--accent-subtle), transparent 42%),
    linear-gradient(180deg, var(--surface), var(--bg-elevated));
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.overlay-preview-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.12);
}

.overlay-preview-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 10px rgba(62, 207, 122, 0.8);
  animation: livePulse 1.6s ease-in-out infinite;
}

@keyframes livePulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.85);
  }
}

.overlay-preview-tag {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-muted);
}

.overlay-preview-stage {
  flex: 1;
  position: relative;
  padding: 18px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    radial-gradient(circle at 50% 100%, rgba(0, 0, 0, 0.35), transparent 55%);
  background-size: 18px 18px, 18px 18px, auto;
}

.mock-scene {
  display: none;
  height: 100%;
  animation: mockFade 0.35s var(--ease-out) both;
}

@keyframes mockFade {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.overlay-live-preview[data-pack='classic'] .mock-classic,
.overlay-live-preview[data-pack='premium'] .mock-premium,
.overlay-live-preview[data-pack='hud'] .mock-hud,
.overlay-live-preview[data-mode='chat'] .mock-chat {
  display: block;
}

.overlay-live-preview[data-mode='chat'] .mock-classic,
.overlay-live-preview[data-mode='chat'] .mock-premium,
.overlay-live-preview[data-mode='chat'] .mock-hud {
  display: none !important;
}

/* PP visibility */
.overlay-live-preview[data-pp='1'] .s2,
.overlay-live-preview[data-pp='1'] .s3,
.overlay-live-preview[data-pp='1'] .s4,
.overlay-live-preview[data-pp='1'] .s5,
.overlay-live-preview[data-pp='1'] .mock-premium-top3 .p2,
.overlay-live-preview[data-pp='1'] .mock-premium-top3 .p3,
.overlay-live-preview[data-pp='1'] .mock-premium-rows,
.overlay-live-preview[data-pp='1'] .mock-hud-card:not(.big) {
  display: none !important;
}

.overlay-live-preview[data-pp='3'] .s4,
.overlay-live-preview[data-pp='3'] .s5,
.overlay-live-preview[data-pp='3'] .mock-premium-rows,
.overlay-live-preview[data-pp='3'] .mock-hud-card:nth-child(n + 4) {
  display: none !important;
}

/* Theme tokens on preview */
.overlay-live-preview[data-design='gold'],
.overlay-live-preview[data-design='pubg'] {
  --pv-c1: #ffd56a;
  --pv-c2: #f4c04e;
  --pv-line: rgba(255, 213, 106, 0.65);
  --pv-text: #fff4c2;
  --pv-glow: rgba(255, 213, 106, 0.35);
}

.overlay-live-preview[data-design='neon'] {
  --pv-c1: #00f2ea;
  --pv-c2: #ff0050;
  --pv-line: rgba(0, 242, 234, 0.65);
  --pv-text: #c7fbff;
  --pv-glow: rgba(0, 242, 234, 0.35);
}

.overlay-live-preview[data-design='dark'] {
  --pv-c1: #e5e7eb;
  --pv-c2: #6b7280;
  --pv-line: rgba(255, 255, 255, 0.28);
  --pv-text: #f3f4f6;
  --pv-glow: rgba(255, 255, 255, 0.15);
}

.overlay-live-preview[data-design='pink'] {
  --pv-c1: #ff8ec1;
  --pv-c2: #ff3b8d;
  --pv-line: rgba(255, 59, 141, 0.65);
  --pv-text: #ffe4f3;
  --pv-glow: rgba(255, 59, 141, 0.35);
}

.overlay-live-preview[data-design='simple'] {
  --pv-c1: #ffffff;
  --pv-c2: #8d98a8;
  --pv-line: rgba(255, 255, 255, 0.35);
  --pv-text: #ffffff;
  --pv-glow: rgba(255, 255, 255, 0.12);
}

.overlay-live-preview[data-design='red-neon'] {
  --pv-c1: #ff315b;
  --pv-c2: #8b001d;
  --pv-line: rgba(255, 49, 91, 0.65);
  --pv-text: #ffd7df;
  --pv-glow: rgba(255, 49, 91, 0.35);
}

.overlay-swatch-chip.theme-gold,
.overlay-swatch-chip.theme-pubg {
  background: linear-gradient(135deg, #ffd56a, #8b6914);
}

.overlay-swatch-chip.theme-neon {
  background: linear-gradient(135deg, #00f2ea, #ff0050);
}

.overlay-swatch-chip.theme-dark {
  background: linear-gradient(135deg, #374151, #111827);
}

.overlay-swatch-chip.theme-pink {
  background: linear-gradient(135deg, #ff8ec1, #ff3b8d);
}

.overlay-swatch-chip.theme-simple {
  background: linear-gradient(135deg, #ffffff, #64748b);
}

.overlay-swatch-chip.theme-red-neon {
  background: linear-gradient(135deg, #ff315b, #8b001d);
}

/* Classic mock */
.mock-classic-board {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  height: 220px;
}

.mock-classic-slot {
  position: absolute;
  text-align: center;
  width: 72px;
}

.mock-classic-slot.s1 {
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  width: 96px;
}

.mock-classic-slot.s2 {
  left: 22%;
  bottom: 28px;
}

.mock-classic-slot.s3 {
  right: 22%;
  bottom: 28px;
}

.mock-classic-slot.s4 {
  left: 4%;
  bottom: 8px;
}

.mock-classic-slot.s5 {
  right: 4%;
  bottom: 8px;
}

.mock-av {
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #667085, #111);
  border: 3px solid var(--pv-line);
  box-shadow: 0 0 16px var(--pv-glow);
  position: relative;
}

.mock-classic-slot.s1 .mock-av {
  width: 72px;
  height: 72px;
}

.mock-av.crown::after {
  content: '👑';
  position: absolute;
  margin-top: -18px;
  margin-left: 18px;
  font-size: 20px;
}

.mock-meta {
  background: var(--pv-bg);
  border: 1px solid var(--pv-line);
  border-radius: 12px;
  padding: 6px 8px;
  backdrop-filter: blur(8px);
}

.mock-name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mock-classic-slot.s1 .mock-name {
  font-size: 12px;
  color: var(--pv-text);
}

.mock-score {
  margin-top: 3px;
  font-size: 11px;
  font-weight: 800;
  color: var(--pv-c1);
}

/* Premium mock */
.mock-premium-shell {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 360px;
  border: 1px solid var(--pv-line);
  border-radius: 22px;
  background: linear-gradient(180deg, var(--pv-bg), rgba(0, 0, 0, 0.55));
  box-shadow: 0 0 28px var(--pv-glow);
  overflow: hidden;
}

.mock-premium-title {
  text-align: center;
  padding: 12px;
  font-size: 13px;
  font-weight: 800;
  color: var(--pv-text);
  border-bottom: 1px solid var(--pv-line);
}

.mock-premium-top3 {
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  gap: 8px;
  padding: 16px 12px 10px;
  align-items: end;
}

.mock-premium-slot {
  text-align: center;
}

.mock-premium-slot.p1 {
  transform: translateY(-8px);
}

.mock-ring {
  width: 52px;
  height: 52px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--pv-c1), var(--pv-c2), var(--pv-c1));
  box-shadow: 0 0 18px var(--pv-glow);
  position: relative;
}

.mock-ring.big {
  width: 68px;
  height: 68px;
}

.mock-ring::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #111;
}

.mock-crown {
  font-size: 22px;
  margin-top: -8px;
}

.mock-premium-rows {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mock-premium-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}

.mock-premium-row span:last-child {
  color: var(--pv-c1);
}

/* HUD mock */
.mock-hud-shell {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 340px;
}

.mock-hud-head {
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px 14px 6px 6px;
  border: 1px solid var(--pv-line);
  background: linear-gradient(135deg, var(--pv-bg), rgba(255, 255, 255, 0.04));
  font-size: 12px;
  font-weight: 800;
  color: var(--pv-text);
  box-shadow: 0 0 18px var(--pv-glow);
}

.mock-hud-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.mock-hud-card {
  border: 1px solid var(--pv-line);
  border-radius: 14px;
  background: var(--pv-bg);
  padding: 10px;
  display: grid;
  grid-template-columns: 24px 42px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 72px;
}

.mock-hud-card.big {
  grid-column: 1 / -1;
  min-height: 96px;
  grid-template-columns: 34px 64px 1fr;
}

.mock-rank {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #111;
  background: linear-gradient(180deg, var(--pv-c1), var(--pv-c2));
}

.mock-hud-card.big .mock-rank {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.mock-ring.sm {
  width: 38px;
  height: 38px;
}

.mock-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--pv-text);
  opacity: 0.75;
}

/* Chat mock */
.mock-chat-stack {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: calc(100% - 32px);
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mock-chat-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--pv-bg);
  border: 1px solid var(--pv-line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  animation: chatMockIn 0.45s var(--ease-out) both;
}

.mock-chat-msg:nth-child(2) {
  animation-delay: 0.08s;
}

.mock-chat-msg:nth-child(3) {
  animation-delay: 0.16s;
}

@keyframes chatMockIn {
  from {
    opacity: 0;
    transform: translateX(-12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mock-chat-av {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #667085, #111);
  border: 2px solid var(--pv-line);
  flex-shrink: 0;
}

.mock-chat-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--pv-text);
  margin-bottom: 3px;
}

.mock-chat-text {
  font-size: 12px;
  color: #f3f4f6;
  line-height: 1.35;
}

.overlay-soon-preview {
  min-height: 520px;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-strong);
  background: linear-gradient(180deg, var(--surface), var(--bg-elevated));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-6);
  gap: var(--space-3);
}

.overlay-soon-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: var(--accent-subtle);
  border: 1px solid rgba(224, 69, 106, 0.25);
}

.overlay-soon-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
}

.overlay-soon-text {
  max-width: 320px;
  color: var(--text-secondary);
  line-height: 1.55;
}

@media (max-width: 1100px) {
  .overlay-studio {
    grid-template-columns: 1fr;
  }

  .overlay-live-preview,
  .overlay-soon-preview {
    min-height: 420px;
  }
}

@media (max-width: 1000px) {
  .overlay-layout {
    grid-template-columns: 1fr;
  }

  .overlay-nav {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-2);
  }

  .overlay-nav-head {
    grid-column: 1 / -1;
  }
}

/* ── Theme transition polish ── */
.card,
.mini-card,
.side,
.topbar,
.category-list,
.auth-card-clean,
.ae-modal-box,
input,
select,
textarea {
  transition:
    background-color 0.35s var(--ease-out),
    border-color 0.25s var(--ease-out),
    color 0.25s var(--ease-out),
    box-shadow 0.25s var(--ease-out);
}

[data-theme='light'] .ae-modal-bg {
  background: rgba(15, 23, 42, 0.45);
}

[data-theme='light'] .coin {
  background: rgba(180, 140, 40, 0.12);
  color: #a67c00;
  border-color: rgba(180, 140, 40, 0.25);
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Responsive ── */
@media (max-width: 1000px) {
  .layout {
    flex-direction: column;
  }

  .side {
    width: 100%;
    height: auto;
    top: var(--topbar-h);
    flex-direction: row;
    overflow-x: auto;
    padding: var(--space-2);
  }

  .nav-item {
    min-width: 70px;
  }

  .grid,
  .overlay-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }

  .search {
    display: none;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .range-row,
  .world-slider-row {
    grid-template-columns: 1fr;
  }

  .world-grid-3,
  .world-grid-2,
  .world-toggle-list {
    grid-template-columns: 1fr;
  }

  .world-preview {
    height: 180px;
  }

  .world-preview .iso-ground {
    width: 310px;
    height: 170px;
  }

  .ai-v2-builder {
    grid-template-columns: 1fr;
  }

  .ai-v2-builder .wide {
    grid-column: 1;
  }

  .ai-v2-table {
    min-width: 860px;
  }

  .ai-reaction-builder {
    grid-template-columns: 1fr;
  }

  .ai-reaction-table {
    min-width: 760px;
  }

  .arena-theme-grid {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }

  .pet-stat-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .main {
    padding: var(--space-5);
  }
}

@media (max-width: 768px) {
  .page-title {
    font-size: 22px;
  }

  .ae-head {
    flex-direction: column;
  }

  .ae-actions .main-btn,
  .ae-actions .dark-btn {
    min-width: 0;
    width: 100%;
  }

  .ae-modal {
    padding: var(--space-3);
    align-items: flex-end;
  }

  .ae-modal-box,
  .ae-modal-box--form {
    width: 100%;
    max-width: 100%;
    max-height: 94vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .ae-modal:not(.hidden) .ae-modal-box {
    animation: modalSheetIn 0.32s var(--ease-out) both;
  }

  @keyframes modalSheetIn {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .ae-modal-body .form-row,
  .ae-modal-body .ae-form-row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }

  .ae-modal-foot {
    flex-direction: column-reverse;
  }

  .ae-modal-foot .main-btn,
  .ae-modal-foot .dark-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .coin {
    display: none;
  }

  .arena-theme-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }

  .pet-stat-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    padding: 0 var(--space-3);
  }
}
