/* ============================================================
   Variables & theme
   ============================================================ */
:root {
  --bg-deep: #0a1628;
  --bg-mid: #0f2744;
  --bg-accent: #1e3a5f;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --gold: #facc15;
  --gold-dim: #ca8a04;
  --red: #ef4444;
  --red-dark: #b91c1c;
  --blue: #3b82f6;
  --blue-bright: #60a5fa;
  --green: #22c55e;
  --header-h: 72px;
  --left-w: 350px;
  --radius: 20px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  --glow-gold: 0 0 30px rgba(250, 204, 21, 0.45);
  --glow-red: 0 0 25px rgba(239, 68, 68, 0.5);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-deep: #e8eef7;
  --bg-mid: #dbeafe;
  --bg-accent: #bfdbfe;
  --glass: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(15, 23, 42, 0.1);
  --glass-strong: rgba(255, 255, 255, 0.9);
  --text: #0f172a;
  --text-muted: #475569;
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Be Vietnam Pro", system-ui, sans-serif;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, #2563eb55 0%, transparent 50%),
    radial-gradient(circle at 80% 60%, #dc262633 0%, transparent 40%),
    linear-gradient(165deg, var(--bg-mid) 0%, var(--bg-deep) 55%, #050d18 100%);
  color: var(--text);
  overflow-x: hidden;
  padding-top: calc(var(--header-h) + 24px);
  padding-left: 20px;
  padding-right: 20px;
  padding-bottom: 40px;
}

#particles-bg,
#confettiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

#confettiCanvas {
  z-index: 9999;
}

/* ============================================================
   Header (fixed, glass, shrink on scroll)
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition);
  border-bottom: 1px solid transparent;
}

.site-header.scrolled {
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--glass-border);
  box-shadow: var(--shadow);
}

.site-header.compact {
  --header-h: 60px;
}

.site-header.compact .header-inner {
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.site-header.compact .brand-text {
  font-size: 1rem;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: var(--header-h);
  padding: 12px 24px;
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  flex-shrink: 0;
}

.brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  box-shadow: var(--glow-gold);
}

.brand-text {
  font-size: 1.15rem;
  transition: font-size var(--transition);
}

.nav-desktop {
  display: flex;
  gap: 6px;
  flex: 1;
  justify-content: center;
}

.nav-link {
  position: relative;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 10px;
  transition: color var(--transition), text-shadow var(--transition);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transform: scaleX(0);
  transition: transform 0.25s ease;
  border-radius: 2px;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  text-shadow: 0 0 20px rgba(250, 204, 21, 0.4);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-header {
  border: none;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), #6366f1);
  color: #fff;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn-header:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

.btn-icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: var(--glass);
  cursor: pointer;
  font-size: 1.1rem;
  transition: var(--transition);
}

.btn-icon:hover {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.btn-icon.muted {
  opacity: 0.5;
}

.user-menu {
  position: relative;
}

.avatar-btn {
  border: 2px solid var(--gold);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--bg-accent), var(--bg-deep));
  padding: 0;
}

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 800;
  color: var(--gold);
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow);
  z-index: 100;
}

.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
}

.dropdown button:hover {
  background: var(--glass);
}

.dropdown hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 6px 0;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--transition);
}

.hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.open span:nth-child(2) {
  opacity: 0;
}

.hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 16px 24px 24px;
  background: var(--glass-strong);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  animation: slideDown 0.35s ease;
}

.nav-mobile.open {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   Main layout
   ============================================================ */
.main-layout {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: var(--left-w) 1fr;
  gap: 28px;
  align-items: start;
}

.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.glass-inset {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 16px;
  padding: 16px;
  margin-top: 16px;
}

[data-theme="light"] .glass-inset {
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================================
   Left panel
   ============================================================ */
.left-panel {
  padding: 22px;
  position: sticky;
  top: calc(var(--header-h) + 16px);
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
}

.panel-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.input-box {
  width: 100%;
  min-height: 200px;
  max-height: 220px;
  resize: vertical;
  border: 2px solid transparent;
  outline: none;
  padding: 16px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
  transition: border-color var(--transition), box-shadow var(--transition);
}

[data-theme="light"] .input-box {
  background: rgba(255, 255, 255, 0.6);
}

.input-box:focus {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.25);
}

.input-box::placeholder {
  color: var(--text-muted);
}

.options-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.options-meta strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.toolbar,
.undo-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.undo-row {
  margin-top: 10px;
}

.tool-btn {
  border: none;
  border-radius: 14px;
  padding: 12px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  transition: transform 0.2s, opacity 0.2s;
}

.tool-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.tool-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.btn-danger { background: linear-gradient(135deg, #ef4444, #dc2626); }
.btn-success { background: linear-gradient(135deg, #10b981, #059669); }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #ea580c); }
.btn-ghost {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text);
}

/* Options list (drag sort) */
.options-list {
  list-style: none;
  margin-top: 14px;
  max-height: 200px;
  overflow-y: auto;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
  cursor: grab;
  transition: var(--transition);
}

.option-item:hover {
  border-color: var(--glass-border);
}

.option-item.dragging {
  opacity: 0.5;
  cursor: grabbing;
}

.option-item.disabled {
  opacity: 0.45;
}

.option-item .drag-handle {
  color: var(--text-muted);
  font-size: 0.75rem;
  user-select: none;
}

.option-item input[type="checkbox"] {
  accent-color: var(--gold);
  width: 18px;
  height: 18px;
}

.option-color {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.option-label {
  flex: 1;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-weight {
  font-size: 0.75rem;
  color: var(--gold);
  min-width: 36px;
  text-align: right;
}

.option-delete {
  border: none;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  padding: 4px 6px;
  font-size: 1rem;
  opacity: 0.7;
}

.option-delete:hover {
  opacity: 1;
}

.settings-block h3 {
  font-size: 0.9rem;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.toggle-row,
.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 0.85rem;
  cursor: pointer;
}

.switch-row input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch {
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  position: relative;
  flex-shrink: 0;
  transition: background var(--transition);
}

.switch::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform var(--transition);
}

.switch-row input:checked + .switch {
  background: linear-gradient(135deg, var(--gold), var(--red));
}

.switch-row input:checked + .switch::after {
  transform: translateX(20px);
}

/* ============================================================
   Right panel & wheel
   ============================================================ */
.right-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 60vh;
}

.top-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.title-box h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  margin-bottom: 6px;
}

.title-box p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.counter-box {
  padding: 14px 22px;
  border-radius: 18px;
  text-align: center;
  min-width: 140px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
}

.counter-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
}

.counter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wheel-stage {
  display: flex;
  justify-content: center;
  width: 100%;
}

.wheel-wrapper {
  position: relative;
  width: min(680px, 92vw);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-glow {
  position: absolute;
  inset: -8%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(250, 204, 21, 0.25), transparent 65%);
  filter: blur(35px);
  animation: pulseGlow 3s ease-in-out infinite;
}

.wheel-neon {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: linear-gradient(var(--bg-deep), var(--bg-deep)) padding-box,
    linear-gradient(135deg, var(--gold), var(--red), var(--gold)) border-box;
  animation: neonRotate 8s linear infinite;
  opacity: 0.85;
  pointer-events: none;
}

@keyframes neonRotate {
  to { transform: rotate(360deg); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

.pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  width: 0;
  height: 0;
  border-left: 22px solid transparent;
  border-right: 22px solid transparent;
  border-top: 56px solid var(--gold);
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.8))
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
  transition: transform 0.15s;
}

.pointer::after {
  content: "";
  position: absolute;
  top: -52px;
  left: -10px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 28px solid var(--red);
}

.pointer.shake {
  animation: pointerShake 0.5s ease;
}

@keyframes pointerShake {
  0%, 100% { transform: translateX(-50%) rotate(0); }
  25% { transform: translateX(calc(-50% - 4px)) rotate(-8deg); }
  75% { transform: translateX(calc(-50% + 4px)) rotate(8deg); }
}

#wheelCanvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow:
    0 0 0 12px rgba(250, 204, 21, 0.9),
    0 0 0 16px rgba(0, 0, 0, 0.3),
    0 20px 50px rgba(0, 0, 0, 0.45),
    inset 0 0 40px rgba(0, 0, 0, 0.15);
  transition: filter 0.3s;
}

.wheel-wrapper.spinning #wheelCanvas {
  filter: blur(0.5px) brightness(1.08);
}

.wheel-wrapper.spinning .wheel-glow {
  animation: spinGlow 0.4s linear infinite;
}

@keyframes spinGlow {
  0%, 100% { filter: blur(35px) hue-rotate(0deg); }
  50% { filter: blur(40px) hue-rotate(30deg); }
}

.center-button {
  position: absolute;
  width: clamp(100px, 22%, 150px);
  height: clamp(100px, 22%, 150px);
  border-radius: 50%;
  z-index: 40;
  border: 4px solid rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #f87171, var(--red-dark));
  box-shadow:
    var(--glow-red),
    0 10px 30px rgba(0, 0, 0, 0.4),
    inset 0 -6px 0 rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.center-button:hover:not(:disabled) {
  transform: scale(1.06);
}

.center-button:active:not(:disabled) {
  transform: scale(0.94);
}

.center-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.center-label {
  font-size: clamp(1rem, 3vw, 1.5rem);
  letter-spacing: 0.05em;
}

/* Result card */
.result-card {
  width: 100%;
  max-width: 680px;
  margin-top: 24px;
  padding: 24px;
  text-align: center;
}

.result-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.result-text {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--gold);
  min-height: 2.5rem;
  text-shadow: var(--glow-gold);
}

.result-text.win-bounce {
  animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
  0% { transform: scale(0.5); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 18px;
}

.action-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.action-btn:hover {
  transform: translateY(-2px);
}

/* ============================================================
   History drawer
   ============================================================ */
.history-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100vw);
  height: 100vh;
  z-index: 1100;
  background: var(--glass-strong);
  backdrop-filter: blur(24px);
  border-left: 1px solid var(--glass-border);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.3);
}

.history-drawer.open {
  transform: translateX(0);
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.drawer-head h2 {
  font-size: 1.2rem;
}

.btn-close {
  border: none;
  background: var(--glass);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
}

.history-search {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  margin-bottom: 12px;
  outline: none;
}

.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.history-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
}

.history-list li {
  display: flex;
  gap: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.15);
  font-size: 0.88rem;
}

.history-list .hist-num {
  color: var(--gold);
  font-weight: 800;
  min-width: 28px;
}

.history-list .hist-prize {
  flex: 1;
  font-weight: 600;
}

.history-list .hist-time {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
}

/* ============================================================
   Modals
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  max-width: 480px;
  width: 100%;
  padding: 32px;
  text-align: center;
  z-index: 1;
}

.modal-bounce {
  animation: modalPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.modal-sub {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.modal-prize {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 24px;
}

.glow-text {
  text-shadow: 0 0 30px rgba(250, 204, 21, 0.6);
  animation: textPulse 1.5s ease infinite;
}

@keyframes textPulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.2); }
}

.flash-light {
  position: absolute;
  inset: -50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.4), transparent 60%);
  opacity: 0;
  pointer-events: none;
}

.flash-light.active {
  animation: flash 0.6s ease-out;
}

@keyframes flash {
  0% { opacity: 0.8; }
  100% { opacity: 0; }
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 20px 0;
}

.template-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: var(--transition);
}

.template-card:hover {
  border-color: var(--gold);
  box-shadow: var(--glow-gold);
}

.template-card strong {
  display: block;
  margin-bottom: 4px;
}

.template-card span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.guide-content {
  text-align: left;
}

.guide-content ul {
  margin: 16px 0 24px;
  padding-left: 20px;
  line-height: 2;
}

.guide-content kbd {
  background: var(--glass);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.85rem;
}

.guide-content code {
  background: rgba(250, 204, 21, 0.15);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--gold);
}

.modal-close-btn {
  width: 100%;
  margin-top: 8px;
}

/* ============================================================
   Animations utilities
   ============================================================ */
.fade-up {
  animation: fadeUp 0.6s ease backwards;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.pulse-glow {
  animation: pulseBox 2.5s ease-in-out infinite;
}

@keyframes pulseBox {
  0%, 100% { box-shadow: 0 0 0 rgba(250, 204, 21, 0); }
  50% { box-shadow: var(--glow-gold); }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
  .main-layout {
    grid-template-columns: 1fr;
  }

  .left-panel {
    position: relative;
    top: unset;
    max-height: none;
  }

  .nav-desktop {
    display: none;
  }

  .hamburger {
    display: flex;
    margin-left: auto;
  }

  .header-actions .btn-header {
    display: none;
  }
}

@media (max-width: 768px) {
  body {
    padding-left: 12px;
    padding-right: 12px;
  }

  .header-inner {
    padding: 10px 16px;
  }

  .toolbar,
  .undo-row {
    grid-template-columns: 1fr 1fr;
  }

  .tool-btn,
  .center-button {
    min-height: 48px;
  }

  .result-actions {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
  }
}
