@font-face {
  font-family: 'NostalgicDesertYeonwoo';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2508-2@1.0/Griun_YEONWOO-Rg.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'KyoboHandwriting2020ParkDoYeon';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/noonfonts_2112@1.0/KyoboHandwriting2020A.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --wood-dark: #1a110c;
  --wood-light: #2d1c13;
  --tape-plastic: #222222;
  --tape-label: #e2d5c3;
  --accent-red: #8a3634;
  --accent-gold: #c47f2c;
}

body {
  background-color: var(--wood-dark);
  background-image:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.1) 2px, transparent 2px, transparent 8px),
    radial-gradient(circle at center, var(--wood-light) 0%, #0a0604 100%);
  font-family: 'KyoboHandwriting2020ParkDoYeon', 'Noto Serif KR', serif;
  color: #dcd3c6;
  overflow-x: hidden;
}

.font-digital {
  font-family: 'Courier Prime', monospace;
}

.font-serif-kr {
  font-family: 'Noto Serif KR', serif;
}

.font-nostalgic,
.font-heading {
  font-family: 'NostalgicDesertYeonwoo', 'Noto Serif KR', serif;
}

.font-body {
  font-family: 'KyoboHandwriting2020ParkDoYeon', 'Noto Serif KR', serif;
}

.brushed-metal {
  background: linear-gradient(180deg, #2a2a2a 0%, #1e1e1e 50%, #151515 100%);
  background-image: repeating-linear-gradient(90deg, transparent 0, transparent 1px, rgba(255, 255, 255, 0.02) 1px, rgba(255, 255, 255, 0.02) 2px);
}

.dark-wood {
  background-color: #3e2214;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 4px, rgba(0, 0, 0, 0.1) 4px, rgba(0, 0, 0, 0.1) 8px);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.vfd-glow {
  color: #c47f2c;
  text-shadow: 0 0 5px #c47f2c, 0 0 10px #a86414;
}

.deck-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 14px;
  color: currentColor;
}

.deck-icon::before,
.deck-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.deck-icon-play::before {
  left: 4px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.35));
}

.deck-icon-stop::before {
  left: 4px;
  width: 10px;
  height: 10px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.deck-icon-pause::before,
.deck-icon-pause::after {
  width: 4px;
  height: 11px;
  background: currentColor;
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.deck-icon-pause::before {
  left: 4px;
}

.deck-icon-pause::after {
  left: 10px;
}

.deck-icon-ff::before,
.deck-icon-ff::after,
.deck-icon-rew::before,
.deck-icon-rew::after {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.35));
}

.deck-icon-ff::before {
  left: 1px;
  border-left: 7px solid currentColor;
}

.deck-icon-ff::after {
  left: 8px;
  border-left: 7px solid currentColor;
}

.deck-icon-rew::before {
  left: 1px;
  border-right: 7px solid currentColor;
}

.deck-icon-rew::after {
  left: 8px;
  border-right: 7px solid currentColor;
}

.cassette-body {
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    inset 0 -2px 4px rgba(0, 0, 0, 0.8),
    0 10px 30px rgba(0, 0, 0, 0.8);
}

.cassette-label {
  background-color: var(--tape-label);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.1'/%3E%3C/svg%3E");
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.cassette-window {
  background: linear-gradient(180deg, #050505 0%, #111 100%);
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 1);
}

.liner-notes {
  background-color: var(--tape-label);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E");
  color: #2d1c13;
  box-shadow: -5px 0 20px rgba(0, 0, 0, 0.6);
}

.dotted-leader {
  background-image: radial-gradient(circle, #5a3d2b 1px, transparent 1px);
  background-position: bottom;
  background-size: 8px 2px;
  background-repeat: repeat-x;
}

.side-tab {
  border: 1px solid rgba(45, 28, 19, 0.2);
  background: rgba(255, 255, 255, 0.18);
  color: #5a3d2b;
  transition: all 0.2s ease;
}

.side-tab:hover {
  background: rgba(45, 28, 19, 0.08);
}

.side-tab.active {
  background: #2d1c13;
  color: #e2d5c3;
  border-color: #2d1c13;
  box-shadow: 0 8px 18px rgba(45, 28, 19, 0.18);
}

.side-panel {
  display: none;
}

.side-panel.active {
  display: block;
}

.writing-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.writing-meta-item {
  min-width: 0;
  padding: 0.2rem 0;
}

.writing-copy p {
  margin-bottom: 1rem;
  line-height: 1.9;
}

.writing-copy p:last-child {
  margin-bottom: 0;
}

.writing-figure {
  margin: 1.25rem 0;
}

.writing-figure img {
  display: block;
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(45, 28, 19, 0.15);
  background: rgba(255, 255, 255, 0.5);
}

.writing-figure figcaption {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  color: #6b5647;
  text-align: center;
}

.writing-quote {
  margin: 1.25rem 0;
  padding: 0.95rem 1rem;
  border: 1px solid rgba(45, 28, 19, 0.22);
  background: rgba(255, 255, 255, 0.28);
  color: #4b372b;
}

.writing-quote p {
  margin: 0;
  line-height: 1.8;
}

.writing-quote cite {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.76rem;
  font-style: normal;
  color: #7b6658;
  text-align: right;
}

.generator-launcher {
  display: inline-flex;
  align-items: center;
  padding: 0;
  color: #5a3d2b;
  font-size: 1.1rem;
  line-height: 1;
  background: transparent;
  border: none;
  opacity: 0.72;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.generator-launcher:hover,
.generator-launcher:focus-visible {
  opacity: 1;
  transform: translateY(-1px);
  outline: none;
}

.generator-panel {
  display: none;
}

.generator-panel.active {
  display: block;
}

.generator-input,
.generator-textarea,
.generator-select,
.generator-output {
  width: 100%;
  border-radius: 0.5rem;
  border: 1px solid rgba(45, 28, 19, 0.16);
  background: rgba(255, 255, 255, 0.5);
  color: #3e2b20;
}

.generator-input,
.generator-select {
  padding: 0.55rem 0.7rem;
}

.generator-textarea,
.generator-output {
  padding: 0.7rem;
  resize: vertical;
}

.generator-block + .generator-block {
  margin-top: 0.75rem;
}

.ext-link {
  position: relative;
  overflow: hidden;
}

.ext-link-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  flex-shrink: 0;
}

.ext-link-badge img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ext-link-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0.42;
  mix-blend-mode: multiply;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.ext-link:hover .ext-link-cover,
.ext-link:focus-visible .ext-link-cover {
  opacity: 0.56;
  transform: scale(1.015);
}

.ext-link-content {
  position: relative;
  z-index: 1;
}

.mini-player {
  background: linear-gradient(180deg, rgba(34, 21, 15, 0.98) 0%, rgba(15, 9, 6, 0.98) 100%);
  border: 1px solid rgba(90, 61, 43, 0.75);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 24px rgba(0, 0, 0, 0.28);
}

.player-screen {
  background: linear-gradient(180deg, #080808 0%, #111 100%);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.95);
}

.player-btn {
  background: linear-gradient(180deg, #3a3a3a 0%, #1c1c1c 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 3px solid #090909;
  color: #d6cec2;
  transition: all 0.15s ease;
}

.player-btn:hover {
  background: linear-gradient(180deg, #484848 0%, #242424 100%);
}

.player-btn:active,
.player-btn.active {
  transform: translateY(2px);
  border-bottom-width: 1px;
  background: linear-gradient(180deg, #181818 0%, #111 100%);
  color: #c47f2c;
}

.player-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.player-progress {
  appearance: none;
  background: transparent;
}

.player-progress::-webkit-slider-runnable-track {
  height: 6px;
  background: linear-gradient(90deg, #2d1c13 0%, #5a3d2b 100%);
  border-radius: 999px;
}

.player-progress::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4px;
  border: 2px solid #2d1c13;
  border-radius: 999px;
  background: #d6cec2;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.player-progress::-moz-range-track {
  height: 6px;
  background: linear-gradient(90deg, #2d1c13 0%, #5a3d2b 100%);
  border-radius: 999px;
}

.player-progress::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #2d1c13;
  border-radius: 999px;
  background: #d6cec2;
}

.playlist-item.active {
  background: rgba(196, 127, 44, 0.14);
  border-color: rgba(196, 127, 44, 0.4);
  color: #8a3634;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

.spin-slow {
  animation: spin 3s linear infinite;
}

.spin-fast {
  animation: spin 1s linear infinite;
}

.tape-reel {
  animation-play-state: paused;
}

.tape-reel.is-playing {
  animation-play-state: running;
}

@keyframes eq-height {
  0%,
  100% {
    height: 15%;
  }

  25% {
    height: 85%;
  }

  50% {
    height: 45%;
  }

  75% {
    height: 100%;
  }
}

.eq-bar-inner {
  width: 100%;
  background: linear-gradient(to top, #4ade80, #facc15, #ef4444);
  animation: eq-height 1.2s ease-in-out infinite alternate;
  border-radius: 1px;
  box-shadow: 0 0 2px rgba(250, 204, 21, 0.4);
}

.eq-bar-inner.d1 {
  animation-duration: 0.9s;
  animation-delay: 0.1s;
}

.eq-bar-inner.d2 {
  animation-duration: 1.1s;
  animation-delay: 0.3s;
}

.eq-bar-inner.d3 {
  animation-duration: 0.8s;
  animation-delay: 0.5s;
}

.eq-bar-inner.d4 {
  animation-duration: 1.3s;
  animation-delay: 0.2s;
}

.eq-bar-inner.d5 {
  animation-duration: 1s;
  animation-delay: 0.4s;
}

::selection {
  background: #c47f2c;
  color: #0a0a0a;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #5a3d2b;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-red);
}

@media (max-width: 640px) {
  .writing-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
