:root {
  --wood-dark: #3a230f;
  --wood: #5c3a1e;
  --wood-light: #7a4e28;
  --cream: #f4e4c1;
  --amber: #e8a020;
  --amber-glow: #ffcb52;
  --teal: #2f7a6f;
  --bg1: #1a0f08;
  --bg2: #2a1810;
}

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

body {
  font-family: 'Vazirmatn', sans-serif;
  background:
    radial-gradient(ellipse at 50% 0%, #35201180 0%, transparent 60%),
    linear-gradient(160deg, var(--bg1), var(--bg2) 60%, #120a05);
  color: var(--cream);
  min-height: 100vh;
  overflow-x: hidden;
}

.app-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 14px 40px;
  position: relative;
}

/* Film grain overlay */
.noise-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: 0.06; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== RADIO UNIT ===== */
.radio-unit {
  position: relative;
  border-radius: 26px;
  padding: 20px 22px 24px;
  background:
    repeating-linear-gradient(90deg, #5c3a1e 0px, #6a4525 2px, #4f3319 5px, #5c3a1e 8px),
    linear-gradient(180deg, var(--wood-light), var(--wood) 40%, var(--wood-dark));
  box-shadow:
    0 20px 50px rgba(0,0,0,0.6),
    inset 0 2px 6px rgba(255,210,140,0.25),
    inset 0 -6px 16px rgba(0,0,0,0.55);
  border: 3px solid #2a1808;
  overflow: hidden;
  transition: filter 0.3s;
}
.radio-unit.tuning { animation: shake 0.4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-3px); filter: brightness(1.15); }
  75% { transform: translateX(3px); filter: brightness(0.92); }
}
.radio-top-glow {
  position: absolute; top: 0; left: 10%; right: 10%; height: 40%;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,220,150,0.18), transparent 70%);
  pointer-events: none;
}

.radio-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px; margin-bottom: 14px; position: relative;
}
.brand {
  font-family: 'Lalezar', cursive;
  font-size: clamp(22px, 5vw, 38px);
  color: var(--amber-glow);
  text-shadow: 0 0 12px rgba(255,180,60,0.5), 0 2px 0 #3a2000;
  letter-spacing: 0.5px;
}
.onair {
  font-family: 'Vazirmatn'; font-weight: 900; font-size: 11px;
  letter-spacing: 2px; padding: 4px 9px; border-radius: 6px;
  background: #3a0a0a; color: #ff5555; border: 1px solid #661515;
}
.onair.on {
  background: #7a0f0f; color: #ffdada;
  box-shadow: 0 0 14px #ff3b3b, inset 0 0 6px #ff8080;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 6px #ff3b3b; opacity: 0.75; } }

.mute-btn, .mem-btn {
  font-family: 'Vazirmatn'; font-weight: 700; cursor: pointer;
  border-radius: 10px; border: 2px solid #2a1808;
  background: linear-gradient(180deg, #7a4e28, #4f3319);
  color: var(--cream); padding: 6px 12px; font-size: 14px;
  box-shadow: 0 3px 0 #2a1808, inset 0 1px 2px rgba(255,220,160,0.3);
  transition: transform 0.1s;
}
.mute-btn:active, .mem-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #2a1808; }
.mute-btn.muted { opacity: 0.6; }
.mem-btn.active { background: linear-gradient(180deg, #a03050, #6a1030); box-shadow: 0 3px 0 #2a1808, 0 0 12px rgba(200,60,100,0.5); }
.mem-count {
  display: inline-block; margin-inline-start: 6px; background: #c94b6b;
  color: #fff; border-radius: 20px; padding: 0 7px; font-size: 11px;
}

/* LCD */
.lcd {
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
  background: linear-gradient(180deg, #0d1a12, #051007);
  border: 3px solid #1a1008; position: relative; overflow: hidden;
  box-shadow: inset 0 0 24px rgba(0,0,0,0.8);
}
.lcd::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 2px, rgba(0,0,0,0.15) 2px 4px);
}
.lcd-freq {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  color: var(--tint, #6dffb0);
  text-shadow: 0 0 8px var(--tint, #6dffb0);
}
.freq-num { font-family: 'JetBrains Mono', monospace; font-size: clamp(28px, 7vw, 46px); font-weight: 900; letter-spacing: 2px; }
.freq-unit { font-size: 14px; font-weight: 700; opacity: 0.8; }
.freq-label { margin-inline-start: auto; font-size: clamp(12px, 3vw, 16px); font-family: 'Lalezar', cursive; }

.tuning-band {
  margin-top: 10px; position: relative; height: 26px;
  display: flex; align-items: flex-end; justify-content: space-between;
  padding: 0 4px;
}
.tick { width: 1px; height: 8px; background: rgba(180,255,200,0.35); }
.tick.major { height: 16px; width: 2px; background: rgba(180,255,200,0.6); }
.needle {
  position: absolute; top: -2px; bottom: 0; width: 3px;
  background: #ff4b4b; box-shadow: 0 0 10px #ff4b4b, 0 0 20px #ff2020;
  border-radius: 2px; transform: translateX(-50%);
  transition: left 0.5s cubic-bezier(.5,1.6,.4,.9);
}
.needle::before {
  content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%; background: #ff5b5b;
  box-shadow: 0 0 10px #ff4040;
}

/* Radio controls row */
.radio-controls { display: flex; gap: 14px; align-items: stretch; }
.speaker-grille {
  flex: 0 0 60px; border-radius: 10px;
  background:
    radial-gradient(circle, #1a0f06 1px, transparent 1.6px) 0 0 / 8px 8px,
    linear-gradient(180deg, #4a2e15, #2e1c0c);
  border: 2px solid #1a1008;
  box-shadow: inset 0 0 14px rgba(0,0,0,0.6);
}
@media (max-width: 640px) { .speaker-grille { flex-basis: 34px; } }

.preset-zone { flex: 1; display: flex; flex-direction: column; gap: 14px; }
.preset-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 640px) { .preset-buttons { grid-template-columns: repeat(6, 1fr); } }
.preset {
  font-family: 'Vazirmatn'; font-weight: 700; cursor: pointer;
  padding: 10px 4px; border-radius: 9px; font-size: 13px;
  color: #f0dcb0; border: 2px solid #1a1008;
  background: linear-gradient(180deg, #6a4525, #3f2814);
  box-shadow: 0 4px 0 #1a1008, inset 0 1px 2px rgba(255,220,160,0.25);
  transition: all 0.12s; white-space: nowrap;
}
.preset:hover { filter: brightness(1.12); }
.preset.pressed {
  color: #fff8e6;
  background: linear-gradient(180deg, var(--pc), color-mix(in srgb, var(--pc) 60%, #000));
  box-shadow: 0 1px 0 #1a1008, inset 0 2px 6px rgba(0,0,0,0.5), 0 0 16px color-mix(in srgb, var(--pc) 70%, transparent);
  transform: translateY(3px);
}

.knob-row { display: flex; align-items: center; justify-content: space-around; gap: 12px; }
.knob {
  width: 46px; height: 46px; border-radius: 50%; position: relative;
  background: radial-gradient(circle at 35% 30%, #8a5c30, #3a2410 70%);
  border: 2px solid #1a1008;
  box-shadow: 0 3px 6px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,220,160,0.3);
}
.knob-indicator {
  position: absolute; left: 50%; top: 5px; width: 3px; height: 40%;
  background: var(--amber-glow); border-radius: 2px; transform-origin: bottom center;
  box-shadow: 0 0 6px var(--amber);
  transition: transform 0.5s ease;
}
.surprise-knob {
  cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 58px; height: 58px; border-radius: 50%; color: #fff8e6; font-size: 20px;
  background: radial-gradient(circle at 35% 30%, #d4922b, #8a4a10 75%);
  border: 3px solid #1a1008;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,230,170,0.4), 0 0 14px rgba(212,146,43,0.5);
  transition: transform 0.15s;
}
.surprise-knob:hover { transform: rotate(20deg) scale(1.05); }
.surprise-knob:active { transform: rotate(180deg) scale(0.95); }

/* ===== CONTENT ===== */
.content-area { margin-top: 26px; }

.tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 24px; }
.tab {
  font-family: 'Vazirmatn'; cursor: pointer; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 10px 20px; border-radius: 4px; position: relative;
  color: #4a3010; background: linear-gradient(180deg, #f4e4c1, #ddc79a);
  border: none; transform: rotate(-1.2deg);
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
  transition: all 0.18s;
}
.tab:nth-child(2) { transform: rotate(0.8deg); }
.tab:nth-child(3) { transform: rotate(-0.6deg); }
.tab::before {
  content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%) rotate(-4deg);
  width: 44px; height: 16px; background: rgba(230,200,140,0.55);
  border: 1px dashed rgba(120,80,30,0.4);
}
.tab:hover { transform: rotate(0deg) translateY(-3px); }
.tab.active {
  color: #fff8e6; transform: rotate(0deg) scale(1.06);
  background: linear-gradient(180deg, var(--tc), color-mix(in srgb, var(--tc) 65%, #000));
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tc) 55%, transparent);
}
.tab-emoji { font-size: 20px; }
.tab-note { font-size: 10px; opacity: 0.7; font-weight: 500; }

.grid-media {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .grid-media { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 860px) { .grid-media { grid-template-columns: repeat(3, 1fr); } }

/* ===== MEDIA CARD (polaroid/VHS) ===== */
.media-card {
  background: linear-gradient(180deg, #fdf6e3, #f0e2bf);
  padding: 12px 12px 6px; border-radius: 6px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(120,80,30,0.15);
  transform: rotate(-0.8deg);
  transition: transform 0.25s, box-shadow 0.25s;
  opacity: 0; animation: cardIn 0.5s forwards;
}
.media-card:nth-child(even) { transform: rotate(0.9deg); }
.media-card:nth-child(3n) { transform: rotate(-1.4deg); }
@keyframes cardIn { to { opacity: 1; transform: rotate(var(--r, -0.6deg)); } }
.media-card:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.02);
  box-shadow: 0 18px 40px rgba(0,0,0,0.55), 0 0 30px rgba(232,160,32,0.25);
  z-index: 5;
}

.card-photo {
  position: relative; aspect-ratio: 1; border-radius: 3px; overflow: hidden;
  background: #2a1a0c;
}
.card-img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  filter: sepia(0.18) contrast(1.05) saturate(1.05);
}
.card-grain {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(120deg, rgba(255,180,80,0.08), transparent 40%, rgba(60,30,10,0.15));
  mix-blend-mode: multiply;
}
.card-skeleton {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, #2a1a0c, #2a1a0c 10px, #33200f 10px, #33200f 20px);
}
.skeleton-dial {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(232,160,32,0.3); border-top-color: var(--amber);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.origin-badge {
  position: absolute; top: 8px; inset-inline-start: 8px;
  font-size: 10px; font-weight: 700; color: #fff;
  padding: 3px 8px; border-radius: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.fav-btn {
  position: absolute; top: 6px; inset-inline-end: 6px;
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: none; font-size: 16px; line-height: 1;
  background: rgba(20,10,4,0.55); backdrop-filter: blur(2px);
  transition: transform 0.15s;
}
.fav-btn:hover { transform: scale(1.2); }
.fav-btn.fav-on { animation: pop 0.3s; }
@keyframes pop { 50% { transform: scale(1.4); } }

.play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(20,10,4,0.35); opacity: 0; transition: opacity 0.25s;
  text-decoration: none;
}
.card-photo:hover .play-overlay { opacity: 1; }
.play-tri {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(232,160,32,0.92); color: #2a1500; font-size: 22px;
  padding-inline-start: 4px;
  box-shadow: 0 0 20px rgba(255,200,80,0.7);
  transform: scale(0.8); transition: transform 0.25s;
}
.card-photo:hover .play-tri { transform: scale(1); }

.card-info { padding: 8px 2px 4px; }
.card-title {
  font-family: 'Lalezar', cursive; font-size: 18px; color: #3a2410;
  line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.date-stamp {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700;
  color: #b04525; border: 1.5px solid #b04525; padding: 1px 6px; border-radius: 3px;
  transform: rotate(3deg); flex-shrink: 0; opacity: 0.85;
}
.card-artist { font-size: 13px; color: #6a4a20; margin-top: 2px; font-weight: 500; }

/* Favorites */
.fav-heading { font-family: 'Lalezar', cursive; font-size: 30px; color: var(--amber-glow); text-align: center; margin-bottom: 24px; text-shadow: 0 0 14px rgba(255,180,60,0.4); }
.fav-empty {
  text-align: center; padding: 50px 20px; color: var(--cream);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 2px dashed rgba(232,160,32,0.3); border-radius: 16px;
  background: rgba(255,210,140,0.03);
}

/* Footer */
.footer {
  margin-top: 44px; padding: 24px 16px 10px; text-align: center;
  border-radius: 18px;
  background: linear-gradient(180deg, var(--wood), var(--wood-dark));
  border: 3px solid #2a1808;
  box-shadow: inset 0 3px 8px rgba(0,0,0,0.5);
}
.footer-tag { font-family: 'Lalezar', cursive; font-size: 20px; color: var(--amber-glow); }
.footer-sub { font-size: 13px; opacity: 0.7; margin-top: 4px; }
.remix-link {
  display: inline-block; margin-top: 14px; color: #2a1500; font-weight: 700;
  background: var(--amber); padding: 7px 18px; border-radius: 8px; text-decoration: none;
  box-shadow: 0 3px 0 #8a5a10; transition: transform 0.1s;
}
.remix-link:active { transform: translateY(3px); box-shadow: 0 0 0 #8a5a10; }
</parameter>