/* Y2K Retro Game Boy Portfolio - Pure CSS v8 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Press Start 2P', monospace;
  background: #07051a;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========== 게임보이 뒤쪽 전용 배경 레이어 (UI와 분리) ========== */
.y2k-bg {
  --parallax-x: 0px;
  --parallax-y: 0px;
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(76, 29, 149, 0.35), transparent 55%),
    radial-gradient(ellipse 90% 60% at 20% 10%, rgba(30, 27, 75, 0.9), transparent 50%),
    linear-gradient(165deg, #0d0826 0%, #1a0f3e 42%, #0f1729 100%);
}

.y2k-bg__noise {
  position: absolute;
  inset: 0;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* CRT식 미세 디더(점박이) — conic + 체크 겹침 */
.y2k-bg__dither {
  position: absolute;
  inset: 0;
  opacity: 0.38;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 0;
  background-image:
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      rgba(180, 160, 255, 0.09) 0deg,
      transparent 90deg,
      rgba(40, 20, 80, 0.12) 90deg,
      transparent 180deg,
      rgba(255, 200, 240, 0.06) 180deg,
      transparent 270deg,
      rgba(20, 10, 50, 0.1) 270deg,
      transparent 360deg
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0 1px,
      transparent 1px 3px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.12) 0 1px,
      transparent 1px 3px
    ),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%23ffffff' fill-opacity='0.06' d='M0 0h4v4H0zm4 4h4v4H4z'/%3E%3Cpath fill='%23000000' fill-opacity='0.08' d='M4 0h4v4H4zM0 4h4v4H0z'/%3E%3C/svg%3E");
  background-size:
    100% 100%,
    4px 4px,
    4px 4px,
    8px 8px;
}

/* 트라이벌 패턴: 가시형 각도 + 느린 background-position 드리프트 */
.y2k-bg__tribal {
  position: absolute;
  inset: -8%;
  opacity: 0.22;
  mix-blend-mode: soft-light;
  transform: translate(var(--parallax-x), var(--parallax-y));
  will-change: transform, background-position;
  z-index: 1;
  background-color: transparent;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cpath fill='none' stroke='%23ec4899' stroke-width='0.6' d='M0 60 L30 20 L60 60 L90 20 L120 60 L90 100 L60 60 L30 100 Z'/%3E%3Cpath fill='none' stroke='%2338bdf8' stroke-width='0.5' d='M60 0 L100 30 L60 60 L100 90 L60 120 L20 90 L60 60 L20 30 Z'/%3E%3C/svg%3E"),
    repeating-linear-gradient(
      118deg,
      rgba(236, 72, 153, 0.07) 0 1px,
      transparent 1px 14px
    ),
    repeating-linear-gradient(
      -72deg,
      rgba(56, 189, 248, 0.06) 0 1px,
      transparent 1px 16px
    ),
    repeating-conic-gradient(
      from 0deg at 50% 50%,
      rgba(167, 139, 250, 0.04) 0deg,
      transparent 8deg,
      rgba(236, 72, 153, 0.03) 16deg,
      transparent 24deg
    );
  background-size: 168px 168px, 56px 56px, 60px 60px, 100% 100%;
  background-position: 0 0, 0 0, 0 0, center;
  animation: y2k-tribal-flow 140s linear infinite;
}

/* 배경 비주얼라이저(추후 WebAudio 연동) — 재생 중에만 페이드인 */
.bg-visualizer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.bg-visualizer.bg-visualizer--visible {
  opacity: 1;
}

@keyframes y2k-tribal-flow {
  0% {
    background-position: 0 0, 0 0, 0 0, center;
  }
  100% {
    background-position: 480px 240px, 360px -180px, -220px 320px, center;
  }
}

/* Y2K 스파클 레이어 (패럴랙스는 부모 변수로 미세 이동) */
.y2k-bg__sparkles {
  position: absolute;
  inset: 0;
  z-index: 3;
  transform: translate(
    calc(var(--parallax-x) * -0.82),
    calc(var(--parallax-y) * -0.82)
  );
  will-change: transform;
}

.y2k-spark {
  position: absolute;
  font-size: 15px;
  line-height: 1;
  user-select: none;
  filter: drop-shadow(0 0 6px currentColor);
  text-shadow:
    0 0 10px currentColor,
    0 0 18px currentColor,
    0 0 28px rgba(255, 255, 255, 0.35);
  box-shadow: none;
  animation: y2k-spark-float 18s ease-in-out infinite, y2k-spark-blink 2.8s ease-in-out infinite;
}

.y2k-spark:nth-child(odd) {
  color: #f472b6;
  animation-duration: 22s, 3.4s;
}

.y2k-spark:nth-child(even) {
  color: #7dd3fc;
  animation-duration: 16s, 2.1s;
}

.y2k-spark--1 { left: 8%; top: 18%; animation-delay: 0s, 0.2s; font-size: 18px; }
.y2k-spark--2 { left: 22%; top: 62%; animation-delay: -3s, -0.5s; font-size: 26px; }
.y2k-spark--3 { left: 78%; top: 12%; animation-delay: -6s, -1s; font-size: 14px; }
.y2k-spark--4 { left: 88%; top: 44%; animation-delay: -2s, -1.2s; font-size: 22px; }
.y2k-spark--5 { left: 14%; top: 82%; animation-delay: -8s, 0.4s; font-size: 16px; }
.y2k-spark--6 { left: 52%; top: 8%; animation-delay: -4s, -0.8s; font-size: 30px; }
.y2k-spark--7 { left: 66%; top: 72%; animation-delay: -10s, -1.5s; font-size: 13px; }
.y2k-spark--8 { left: 38%; top: 38%; animation-delay: -5s, 0.1s; font-size: 20px; }
.y2k-spark--9 { left: 92%; top: 78%; animation-delay: -12s, -0.3s; font-size: 17px; }
.y2k-spark--10 { left: 4%; top: 46%; animation-delay: -7s, -1.1s; font-size: 24px; }

@keyframes y2k-spark-float {
  0%, 100% {
    transform: translateY(0) translateX(0);
  }
  50% {
    transform: translateY(-14px) translateX(4px);
  }
}

@keyframes y2k-spark-blink {
  0%, 100% {
    opacity: 0.15;
    filter: brightness(0.9);
  }
  35% {
    opacity: 0.85;
    filter: brightness(1.35);
  }
  55% {
    opacity: 0.35;
  }
}

.hidden { display: none !important; }

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.main-container {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.scanline-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
}

.vignette-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.5) 100%);
}

.content-wrapper {
  position: absolute;
  top: 48%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

@media (min-width: 1024px) {
  .content-wrapper {
    transform: translate(-50%, -50%) scale(1.2);
    transform-origin: center center;
  }
}

.branding {
  margin-bottom: 12px;
  text-align: center;
}

.brand-title {
  font-size: 16px;
  letter-spacing: 0.2em;
  color: rgba(255,255,255,0.8);
  font-weight: bold;
  text-shadow: 0 0 15px rgba(255,255,255,0.4);
}

.brand-subtitle {
  font-size: 7px;
  letter-spacing: 0.3em;
  color: rgba(255,255,255,0.5);
  margin-top: 4px;
}

/* Game Boy Device - Mobile: full width, PC: 1.3x scale */
.gameboy-device {
  position: relative;
  width: 95vw;
  height: min(140vw, 86vh);
  max-width: 340px;
  max-height: 560px;
  background: linear-gradient(180deg, #c5c5c5 0%, #b8b8b8 30%, #a8a8a8 100%);
  border-radius: 12px 12px 50px 50px;
  box-shadow:
    inset 2px 2px 4px rgba(255,255,255,0.6),
    inset -2px -2px 6px rgba(0,0,0,0.2),
    8px 8px 24px rgba(0,0,0,0.4),
    0 0 0 3px #909090;
}

.device-branding {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  text-align: center;
  pointer-events: none;
  z-index: 2;
}

.device-logo {
  font-size: 8px;
  letter-spacing: 0.22em;
  color: rgba(40,40,40,0.92);
  text-shadow: 0 1px 0 rgba(255,255,255,0.35);
  white-space: nowrap;
}

@media (min-width: 768px) {
  .device-logo { font-size: 10px; }
}

@media (min-width: 768px) {
  .branding { margin-bottom: 20px; }
  .brand-title { font-size: 24px; }
  .brand-subtitle { font-size: 10px; }
  .gameboy-device {
    width: 380px;
    height: 620px;
    max-width: none;
    max-height: none;
  }
  .scanline-overlay,
  .vignette-overlay { display: block; }
}

.vent-lines {
  position: absolute;
  top: 6px;
  display: flex;
  gap: 2px;
}
.vent-lines.left { left: 12px; }
.vent-lines.right { right: 12px; }
.vent {
  width: 2px;
  height: 10px;
  background: rgba(0,0,0,0.15);
}

/* Screen Bezel — 절대 배치 유지, LCD 면적 대폭 확보 */
.screen-bezel {
  position: absolute;
  top: 7%;
  left: 50%;
  transform: translateX(-50%);
  width: 94%;
  height: 56%;
  background: linear-gradient(145deg, #555 0%, #3a3a3a 50%, #2a2a2a 100%);
  border-radius: 8px;
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.5), inset -2px -2px 4px rgba(100,100,100,0.2);
  padding: 6px 8px;
}

@media (min-width: 768px) {
  .screen-bezel {
    top: 8%;
    width: 88%;
    height: 46%;
    padding: 8px 10px;
  }
}

.brand-text {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 5px;
  letter-spacing: 0.2em;
  color: #aaa;
}

@media (min-width: 768px) {
  .brand-text { font-size: 7px; }
}

.screen-frame {
  position: relative;
  width: 100%;
  height: calc(100% - 6px);
  margin-top: 3px;
  background: #1a1a1a;
  border-radius: 4px;
  padding: 4px;
  box-shadow: inset 2px 2px 6px rgba(0,0,0,0.8);
}

@media (min-width: 768px) {
  .screen-frame {
    margin-top: 6px;
    padding: 6px;
  }
}

.lcd-screen {
  width: 100%;
  height: 100%;
  background: #9bbc0f;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
  padding: 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.power-off-screen,
.main-menu,
.music-albums,
.music-playlist,
.music-player {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
}

.lcd-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.05) 2px, rgba(0,0,0,0.05) 4px);
  pointer-events: none;
  z-index: 100;
}

.power-led {
  position: absolute;
  bottom: 6px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.led-light {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #400000;
  transition: all 0.3s;
}

.led-light.on {
  background: #ff0000;
  box-shadow: 0 0 8px #ff0000, 0 0 12px #ff0000;
}

.led-label {
  font-size: 4px;
  color: #666;
}

@media (min-width: 768px) {
  .led-light { width: 8px; height: 8px; }
  .led-label { font-size: 6px; }
}

/* Power Off Screen */
.power-off-screen {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.power-on-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
}

.hero-text {
  font-size: 14px;
  color: #9bbc0f;
  filter: brightness(0.6);
  animation: blink 1s infinite;
  text-shadow: 0 0 15px rgba(155,188,15,0.6);
  font-weight: bold;
}

.power-text {
  font-size: 10px;
  color: #9bbc0f;
  filter: brightness(0.6);
  animation: blink 1s infinite 0.5s;
  margin-top: 10px;
}

.click-hint {
  font-size: 6px;
  color: #9bbc0f;
  filter: brightness(0.6);
  opacity: 0.5;
  margin-top: 14px;
}

@media (min-width: 768px) {
  .hero-text { font-size: 18px; }
  .power-text { font-size: 12px; }
  .click-hint { font-size: 8px; }
}

/* Main Menu */
.main-menu {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fade-in 0.5s ease;
}

.menu-header {
  text-align: center;
  font-size: 12px;
  color: #0f380f;
  letter-spacing: 0.1em;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 2px solid #0f380f;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .menu-header { font-size: 14px; }
}

.menu-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  min-height: 0;
}

.menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  background: transparent;
  border: 1px solid #0f380f;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.menu-item:hover,
.menu-item.selected {
  background: rgba(15,56,15,0.4);
  border: 2px solid #0f380f;
  transform: scale(1.02);
}

.menu-icon {
  font-size: 24px;
  color: #0f380f;
}

.menu-label {
  font-size: 9px;
  color: #0f380f;
  margin-top: 4px;
}

@media (min-width: 768px) {
  .menu-icon { font-size: 28px; }
  .menu-label { font-size: 10px; }
}

.menu-cursor {
  font-size: 7px;
  color: #0f380f;
  animation: blink 0.5s infinite;
  display: none;
}

.menu-item.selected .menu-cursor { display: block; }

.menu-hint, .view-hint {
  text-align: center;
  font-size: 7px;
  color: #0f380f;
  opacity: 0.6;
  margin-top: 4px;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .menu-hint, .view-hint { font-size: 8px; }
}

/* View Header */
.view-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4px;
  margin-bottom: 6px;
  border-bottom: 1px solid #0f380f;
  flex-shrink: 0;
}

.back-btn {
  font-size: 9px;
  color: #0f380f;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.back-btn:hover { opacity: 0.7; }

.view-title {
  font-size: 10px;
  color: #0f380f;
  letter-spacing: 0.1em;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spacer { width: 40px; }

@media (min-width: 768px) {
  .back-btn { font-size: 9px; }
  .view-title { font-size: 11px; }
}

/* Music Albums View */
.music-albums {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
  animation: fade-in 0.3s ease;
}

.album-grid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 0;
  padding: 4px 0 8px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.album-grid::-webkit-scrollbar {
  display: none;
}

.album-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 260px;
  flex-shrink: 0;
  padding: 8px 10px;
  margin-bottom: 0;
  background: rgba(15,56,15,0.15);
  border: 1px solid #0f380f;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.album-item:hover:not(.focused) {
  background: rgba(15,56,15,0.35);
  transform: scale(1.01);
}

/* 레트로 포커스: 앨범 목록 커서 */
.album-item.focused {
  position: relative;
  padding-left: 22px;
  background: #0f380f;
  border: 2px solid #9bbc0f;
  box-shadow:
    inset 0 0 0 1px rgba(155, 188, 15, 0.45),
    2px 2px 0 rgba(0, 0, 0, 0.35);
  transform: none;
}

.album-item.focused::before {
  content: '>';
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  line-height: 1;
  color: #9bbc0f;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.album-item.focused .album-title-text {
  color: #9bbc0f;
}

.album-item.focused .album-cover {
  border-color: #9bbc0f;
}

.album-cover {
  width: 55px;
  height: 55px;
  border: 1px solid #0f380f;
  overflow: hidden;
  margin-bottom: 4px;
}

@media (min-width: 768px) {
  .album-cover { width: 70px; height: 70px; }
}

.album-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.album-title-text {
  font-size: 9px;
  color: #0f380f;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .album-title-text { font-size: 10px; }
}

/* Music Playlist View */
.music-playlist {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
  animation: fade-in 0.3s ease;
}

.album-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}

.album-cover-small {
  width: 45px;
  height: 45px;
  border: 1px solid #0f380f;
  overflow: hidden;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .album-cover-small { width: 50px; height: 50px; }
}

.album-cover-small img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.album-details { flex: 1; min-width: 0; }

.album-artist {
  font-size: 9px;
  color: #0f380f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-tracks-count {
  font-size: 8px;
  color: #0f380f;
  opacity: 0.7;
}

/* Track List — 세로 나열만, 스크롤바 숨김 */
.track-list {
  flex: 0 1 auto;
  max-height: 150px;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  border: 1px solid #0f380f;
  background: rgba(15,56,15,0.1);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.track-list::-webkit-scrollbar {
  display: none;
}

.track-item {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(15,56,15,0.2);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  text-align: left;
}

.track-item:last-child { border-bottom: none; }
.track-item:hover:not(.focused) { background: rgba(15,56,15,0.28); }

/* 레트로 포커스: 플레이리스트 트랙 커서 */
.track-item.focused {
  background: #0f380f;
  border-bottom-color: rgba(155, 188, 15, 0.35);
  border-left: 4px solid #9bbc0f;
  padding-left: 10px;
  box-shadow: inset 3px 0 0 rgba(155, 188, 15, 0.25);
}

.track-cursor {
  width: 16px;
  font-size: 10px;
  color: #0f380f;
  flex-shrink: 0;
}

.track-item.focused .track-cursor {
  font-size: 12px;
  font-weight: bold;
  color: #9bbc0f;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
}

.track-title {
  flex: 1;
  font-size: 10px;
  color: #0f380f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-item.focused .track-title {
  color: #9bbc0f;
  font-weight: bold;
}

.track-item.focused .track-duration {
  color: rgba(155, 188, 15, 0.85);
}

@media (min-width: 768px) {
  .track-item { padding: 8px; }
  .track-title { font-size: 11px; }
}

.track-duration {
  font-size: 9px;
  color: #0f380f;
  opacity: 0.7;
  flex-shrink: 0;
}

/* Music Player View */
.music-player {
  width: 100%;
  height: 100%;
  padding: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
  animation: fade-in 0.3s ease;
}

.player-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.player-cover {
  width: 90px;
  height: 90px;
  border: 2px solid #0f380f;
  box-shadow: 0 2px 8px rgba(15,56,15,0.3);
  overflow: hidden;
  margin-bottom: 8px;
}

@media (min-width: 768px) {
  .player-cover { width: 110px; height: 110px; }
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-info {
  text-align: center;
  margin-bottom: 10px;
}

.player-track {
  font-size: 10px;
  color: #0f380f;
  font-weight: bold;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .player-track { font-size: 12px; }
}

.player-artist {
  font-size: 8px;
  color: #0f380f;
  opacity: 0.7;
  margin-top: 2px;
}

@media (min-width: 768px) {
  .player-artist { font-size: 9px; }
}

.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.control-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #0f380f;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s;
}

.control-btn:hover { opacity: 0.7; }

.prev-btn, .next-btn {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.play-pause-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(15,56,15,0.3);
  border: 2px solid #0f380f;
  font-size: 16px;
  transition: all 0.15s;
}

.play-pause-btn:hover { transform: scale(1.05); opacity: 1; }
.play-pause-btn:active { transform: scale(0.95); }
.play-pause-btn.playing { background: rgba(15,56,15,0.5); }

.play-icon { margin-left: 2px; }
.pause-icon { font-weight: bold; }

/* 레트로 직각 재생바 (border-radius 없음) */
.player-progress-wrap {
  width: 100%;
  max-width: 200px;
  margin-top: 8px;
  flex-shrink: 0;
}

.player-progress-track {
  height: 6px;
  background: #051805;
  border: 1px solid #0f380f;
  cursor: pointer;
  position: relative;
  box-sizing: border-box;
}

.player-progress-fill {
  height: 100%;
  width: 0%;
  background: #0a0a0a;
  box-sizing: border-box;
  border-right: 1px solid #9bbc0f;
  pointer-events: none;
}

.player-duration {
  font-size: 7px;
  color: #0f380f;
  opacity: 0.85;
  margin-top: 8px;
  letter-spacing: 0.02em;
}

/* Controls Area - Very compact on mobile */
.controls-area {
  position: absolute;
  bottom: 5%;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

@media (min-width: 768px) {
  .controls-area { bottom: 10%; gap: 20px; }
}

.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
}

@media (min-width: 768px) {
  .controls-row { padding: 0 28px; }
}

/* D-pad */
.dpad {
  position: relative;
  width: 70px;
  height: 70px;
}

@media (min-width: 768px) {
  .dpad { width: 100px; height: 100px; }
}

.dpad::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  clip-path: polygon(33% 0%, 67% 0%, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0% 67%, 0% 33%, 33% 33%);
  transform: translate(2px, 2px);
}

.dpad::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #2d2d2d 0%, #1a1a1a 50%, #0d0d0d 100%);
  clip-path: polygon(33% 0%, 67% 0%, 67% 33%, 100% 33%, 100% 67%, 67% 67%, 67% 100%, 33% 100%, 33% 67%, 0% 67%, 0% 33%, 33% 33%);
}

.dpad-btn {
  position: absolute;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 2;
  transition: all 0.075s;
}

.dpad-btn:active { background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%); }

.dpad-up { top: 0; left: 50%; transform: translateX(-50%); width: 34%; height: 33%; }
.dpad-down { bottom: 0; left: 50%; transform: translateX(-50%); width: 34%; height: 33%; }
.dpad-left { left: 0; top: 50%; transform: translateY(-50%); width: 33%; height: 34%; }
.dpad-right { right: 0; top: 50%; transform: translateY(-50%); width: 33%; height: 34%; }

.dpad-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 34%;
  height: 34%;
  background: linear-gradient(145deg, #1a1a1a 0%, #2a2a2a 100%);
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.6);
  border-radius: 50%;
  z-index: 1;
}

/* A/B Buttons */
.ab-buttons {
  position: relative;
  width: 100px;
  height: 60px;
  transform: rotate(-25deg);
}

@media (min-width: 768px) {
  .ab-buttons { width: 140px; height: 85px; }
}

.ab-wrapper {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}

.b-wrapper { left: 0; top: 0; }
.a-wrapper { right: 0; top: 0; }

.ab-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(145deg, #a01c42 0%, #8b1538 100%);
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 3px 3px 6px rgba(0,0,0,0.5), inset -1px -1px 2px rgba(0,0,0,0.2), inset 1px 1px 2px rgba(200,100,120,0.3);
  transition: all 0.075s;
}

@media (min-width: 768px) {
  .ab-btn { width: 55px; height: 55px; }
}

.ab-btn:active {
  background: linear-gradient(145deg, #8b1538 0%, #a01c42 100%);
  box-shadow: inset 3px 3px 6px rgba(0,0,0,0.6);
  transform: scale(0.95);
}

.ab-label {
  font-size: 7px;
  color: #4a3c58;
  font-weight: bold;
  margin-top: 0;
  line-height: 1;
  transform: rotate(25deg);
}

@media (min-width: 768px) {
  .ab-label { font-size: 10px; margin-top: 4px; }
}

/* Start/Select */
.start-select-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 0;
}

@media (min-width: 768px) {
  .start-select-row { gap: 28px; margin-top: 12px; }
}

.ss-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  min-height: 28px;
}

.ss-label {
  font-size: 5px;
  color: #4a3c58;
  letter-spacing: 0.1em;
  line-height: 1;
  display: block;
  margin-bottom: 1px;
}

@media (min-width: 768px) {
  .ss-label { font-size: 7px; }
}

.ss-btn {
  width: 36px;
  height: 10px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #7a7a7a 0%, #5a5a5a 100%);
  border: none;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  transform: rotate(-25deg);
  transition: all 0.075s;
}

@media (min-width: 768px) {
  .ss-btn { width: 50px; height: 14px; }
}

.ss-btn:active {
  background: linear-gradient(180deg, #5a5a5a 0%, #7a7a7a 100%);
  box-shadow: inset 2px 2px 4px rgba(0,0,0,0.5);
  transform: rotate(-25deg) scale(0.95);
}

/* Speaker Grille */
.speaker-grille {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transform: rotate(-25deg);
}

@media (min-width: 768px) {
  .speaker-grille { bottom: 18px; right: 18px; gap: 3px; }
}

.speaker-row { display: flex; gap: 2px; }

@media (min-width: 768px) {
  .speaker-row { gap: 3px; }
}

.speaker-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: linear-gradient(145deg, #666 0%, #888 100%);
  box-shadow: inset 1px 1px 2px rgba(0,0,0,0.5);
}

@media (min-width: 768px) {
  .speaker-dot { width: 5px; height: 5px; }
}

/* Win98 Popup — 게임보이 셸 내부에만 표시 (기기 크기를 넘지 않음) */
.popup-overlay {
  position: absolute;
  inset: 0;
  border-radius: 12px 12px 50px 50px;
  background: rgba(0,0,0,0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 10px;
  box-sizing: border-box;
}

.win98-window {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.5);
  width: calc(100% - 16px);
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  min-width: 0;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.2s ease;
}

.win98-titlebar {
  background: linear-gradient(90deg, #000080 0%, #1084d0 100%);
  padding: 4px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  flex-shrink: 0;
}

.titlebar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.titlebar-icon { font-size: 14px; flex-shrink: 0; }
.titlebar-text {
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  max-width: 100%;
}

.close-btn {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  flex-shrink: 0;
}

.close-btn:hover { background: #ff0000; color: white; }
.close-btn:active { border-color: #808080 #fff #fff #808080; }

.win98-content {
  padding: 10px;
  min-width: 0;
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.address-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  min-width: 0;
}

.address-label {
  font-size: 9px;
  color: black;
  flex-shrink: 0;
}

.address-input {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  background: white;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  padding: 4px 6px;
  font-size: 9px;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.popup-body {
  background: white;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  padding: 6px;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.popup-description {
  margin-top: 10px;
  font-size: 9px;
  color: black;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.status-bar {
  margin-top: 10px;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  padding: 4px 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.status-count {
  font-size: 9px;
  color: black;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.status-ready {
  font-size: 9px;
  color: black;
  flex-shrink: 0;
}

/* Art Gallery */
.art-gallery {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-width: 0;
}

.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: black;
  overflow: hidden;
  margin-bottom: 8px;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}

.gallery-nav:hover { background: #d0d0d0; }
.gallery-nav.prev { left: 8px; }
.gallery-nav.next { right: 8px; }

.gallery-counter {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 4px 8px;
  font-size: 10px;
}

.gallery-title {
  font-size: 11px;
  font-weight: bold;
  color: black;
  text-align: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-thumbnails {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  justify-content: center;
}

.gallery-thumb {
  width: 44px;
  height: 44px;
  border: 2px solid #808080;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s;
  padding: 0;
  background: none;
}

.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { border-color: #000080; opacity: 1; }

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-hint {
  font-size: 9px;
  color: rgba(0,0,0,0.6);
  margin-top: 8px;
  text-align: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* File List */
.file-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.file-item:hover { background: #000080; color: white; }

.file-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.file-name {
  font-size: 9px;
  color: black;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item:hover .file-name { color: white; }