:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --bg-card: #111111;
  --text: #ffffff;
  --text-dim: #888888;
  --border: #1f1f1f;
  --accent: #ffffff;
  --radius: 20px;
  --transition: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  overflow-x: hidden;
  min-height: 100vh;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% -20%, rgba(255,255,255,0.08), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.app {
  position: relative;
  z-index: 2;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 20px 60px;
  animation: appIn 0.6s var(--transition);
}

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

/* ============ HEADER ============ */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.3px;
}

.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s var(--transition);
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.active svg {
  animation: spin 0.6s var(--transition);
}

@keyframes spin {
  from { transform: rotate(0deg) scale(0.5); }
  to { transform: rotate(360deg) scale(1); }
}

/* ============ HERO ============ */
.hero {
  padding: 20px 0 32px;
  animation: fadeUp 0.7s var(--transition) 0.1s both;
}

.hero h1 {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.2px;
}

.accent {
  background: linear-gradient(135deg, #fff, #a0a0a0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-dim);
  font-size: 15px;
  margin-top: 12px;
  line-height: 1.5;
}

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

/* ============ BUTTONS ============ */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.35s var(--transition);
  color: var(--text);
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255,255,255,0.3), transparent 70%);
  opacity: 0;
  transform: scale(0);
  transition: all 0.5s;
}

.btn:active::after {
  opacity: 1;
  transform: scale(2.5);
  transition: 0s;
}

.btn-primary {
  width: 100%;
  background: #ffffff;
  color: #000000;
  border-radius: var(--radius);
  padding: 20px;
  font-size: 16px;
  margin-bottom: 16px;
  animation: fadeUp 0.7s var(--transition) 0.2s both;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary svg {
  stroke: #000;
}

/* Grid cards */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  animation: fadeUp 0.7s var(--transition) 0.3s both;
}

.btn-card {
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  font-size: 14px;
  font-weight: 500;
  gap: 12px;
  aspect-ratio: 1.15;
}

.btn-card:active {
  transform: scale(0.95);
  background: var(--bg-elev);
  border-color: #333;
}

.btn-card svg {
  opacity: 0.9;
  transition: transform 0.4s var(--transition);
}

.btn-card:active svg {
  transform: scale(1.15) rotate(-5deg);
}

/* ============ RECENT ============ */
.recent {
  margin-top: 36px;
  animation: fadeUp 0.7s var(--transition) 0.4s both;
}

.recent h2 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.recent-grid {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  display: flex;
  justify-content: center;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
}

.empty-state p {
  margin-top: 12px;
  font-size: 14px;
}

/* ============ GARLAND ============ */
.garland {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  z-index: 100;
  pointer-events: none;
  display: flex;
  justify-content: space-around;
  padding: 0 10px;
}

.garland.hidden {
  display: none;
}

.garland .wire {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  height: 30px;
  border-bottom: 2px solid rgba(255,255,255,0.15);
  border-radius: 0 0 50% 50%;
}

.garland .bulb {
  position: absolute;
  top: 20px;
  width: 12px;
  height: 16px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  animation: glow 2s ease-in-out infinite;
}

.garland .bulb::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 6px;
  background: rgba(255,255,255,0.3);
}

@keyframes glow {
  0%, 100% { 
    box-shadow: 0 0 8px 2px currentColor, 0 0 20px 4px currentColor;
    opacity: 1;
  }
  50% { 
    box-shadow: 0 0 4px 1px currentColor, 0 0 10px 2px currentColor;
    opacity: 0.7;
  }
}

/* ============ SNOW ============ */
.snow-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.8s;
}

.snow-canvas.active {
  opacity: 1;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: #fff;
  color: #000;
  padding: 14px 24px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  transition: transform 0.5s var(--transition);
  box-shadow: 0 10px 40px rgba(255,255,255,0.15);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ============ NEW YEAR THEME ============ */
body.newyear {
  --bg: #000814;
  --bg-card: #0d1b2a;
  --border: #1b3a5c;
}

body.newyear .accent {
  background: linear-gradient(135deg, #fff, #7ec8ff, #ff6b9d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.newyear .btn-primary {
  background: linear-gradient(135deg, #ffffff, #e0f0ff);
  box-shadow: 0 0 30px rgba(126, 200, 255, 0.3);
}

/* Снежинка вместо иконок в карточках */
body.newyear .btn-card[data-action="gallery"] svg,
body.newyear .btn-card[data-action="random"] svg {
  animation: snowSpin 4s linear infinite;
}

@keyframes snowSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}