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

:root {
  --dc-orange: #e86a17;
  --dc-orange-bright: #ff7722;
  --dc-blue: #1a6eb5;
  --dc-blue-dark: #0d4a82;
  --dc-white: #f4f4f0;
  --dc-gray: #d8d8d2;
  --dc-gray-dark: #9a9a94;
  --dc-black: #1a1a18;
  --dc-shadow: rgba(0, 0, 0, 0.22);
  --font-ui: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --font-mono: "VT323", "Courier New", monospace;
  --bg-mx: 0.5;
  --bg-my: 0.5;
  --bg-dx: 0;
  --bg-dy: 0;
  --bg-parallax: 72px;
  --bg-bulge-scale: 1;
  --bg-bulge-x: 50;
  --bg-bulge-y: 50;
}

html {
  height: 100%;
}

body {
  min-height: 100%;
  background: var(--dc-white);
  color: var(--dc-black);
  font-family: var(--font-ui);
  line-height: 1.5;
  overflow-x: hidden;
}

.dc-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.dc-bg-inner {
  position: absolute;
  inset: 0;
  transform: scale(var(--bg-bulge-scale));
  transform-origin: calc(var(--bg-bulge-x) * 1%) calc(var(--bg-bulge-y) * 1%);
  will-change: transform;
}

.dc-bg-gradient {
  position: absolute;
  inset: -10%;
  background: linear-gradient(160deg, #f8f8f4 0%, #ece8e0 45%, #e4e0d8 100%);
  background-size: 140% 140%;
  animation: bgBreathe 22s ease-in-out infinite;
}

@keyframes bgBreathe {
  0%, 100% {
    background-position: 0% 20%;
    filter: brightness(1);
  }
  50% {
    background-position: 100% 80%;
    filter: brightness(1.04);
  }
}

.dc-bg-light {
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  will-change: left, top;
}

.dc-bg-light--warm {
  width: 68vmax;
  height: 68vmax;
  left: calc(var(--bg-mx) * 100%);
  top: calc(var(--bg-my) * 100%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(255, 119, 34, 0.16) 0%, transparent 68%);
}

.dc-bg-light--cool {
  width: 52vmax;
  height: 52vmax;
  left: calc((1 - var(--bg-mx)) * 100%);
  top: calc((1 - var(--bg-my)) * 100%);
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(26, 110, 181, 0.12) 0%, transparent 68%);
}

.dc-swirl-wrap {
  position: absolute;
  will-change: transform;
}

.dc-swirl-wrap--orange {
  top: -20vmin;
  right: -15vmin;
  width: 70vmin;
  height: 70vmin;
  transform: translate(
    calc(var(--bg-dx) * var(--bg-parallax)),
    calc(var(--bg-dy) * var(--bg-parallax))
  );
}

.dc-swirl-wrap--blue {
  bottom: -25vmin;
  left: -18vmin;
  width: 58vmin;
  height: 58vmin;
  transform: translate(
    calc(var(--bg-dx) * var(--bg-parallax) * -0.75),
    calc(var(--bg-dy) * var(--bg-parallax) * -0.75)
  );
}

.dc-swirl {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  filter: blur(2px);
  animation: swirlSpin 48s linear infinite;
}

.dc-swirl--orange {
  background: conic-gradient(
    from 200deg,
    transparent 0deg,
    var(--dc-orange) 40deg,
    var(--dc-orange-bright) 120deg,
    #ffb347 200deg,
    var(--dc-orange) 280deg,
    transparent 360deg
  );
  opacity: 0.22;
}

.dc-swirl--blue {
  background: conic-gradient(
    from 120deg,
    transparent 0deg,
    var(--dc-blue) 50deg,
    #3399ff 140deg,
    var(--dc-blue-dark) 220deg,
    var(--dc-blue) 300deg,
    transparent 360deg
  );
  opacity: 0.16;
  animation-duration: 62s;
  animation-direction: reverse;
}

@keyframes swirlSpin {
  to { transform: rotate(360deg); }
}

.dc-bg-specks {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.dc-bg-ripples {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

.dc-bg-ripple {
  position: absolute;
  width: 42vmax;
  height: 42vmax;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(
    circle,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 119, 34, 0.16) 38%,
    rgba(26, 110, 181, 0.08) 58%,
    transparent 72%
  );
  animation: bgRippleExpand 0.72s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes bgRippleExpand {
  0% {
    transform: translate(-50%, -50%) scale(0.12);
    opacity: 0.7;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
  }
}

.dc-bg-grain {
  position: absolute;
  inset: 0;
  z-index: 2;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grainShift 0.45s steps(5) infinite;
}

@keyframes grainShift {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-1.5%, 1%); }
  50% { transform: translate(1%, -1.5%); }
  75% { transform: translate(1.5%, 1.5%); }
}

@media (prefers-reduced-motion: reduce) {
  .dc-bg-inner {
    transform: none;
  }

  .dc-bg-gradient {
    animation: none;
    inset: 0;
    background-size: 100% 100%;
    filter: none;
  }

  .dc-bg-light {
    display: none;
  }

  .dc-swirl-wrap--orange,
  .dc-swirl-wrap--blue {
    transform: none;
  }

  .dc-swirl {
    animation: none;
  }

  .dc-bg-specks,
  .dc-bg-ripples {
    display: none;
  }

  .dc-bg-grain {
    animation: none;
    opacity: 0.03;
  }
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.08);
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 960px;
  margin: 0 auto;
  padding: 16px 16px 32px;
}

.app-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #fff 0%, var(--dc-gray) 100%);
  border: 2px solid #bbb;
  border-radius: 6px;
  box-shadow: 0 3px 0 var(--dc-shadow), inset 0 1px 0 #fff;
}

.site-logo {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: bold;
  text-decoration: none;
  letter-spacing: 0.06em;
  text-transform: lowercase;
  background: linear-gradient(
    90deg,
    #ff3366 0%,
    #ff9933 14%,
    #ffee33 28%,
    #33ee66 42%,
    #3399ff 57%,
    #9933ff 71%,
    #ff66cc 85%,
    #ff3366 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: site-logo-rainbow 3s linear infinite;
}

@keyframes site-logo-rainbow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-logo {
    animation: none;
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--dc-blue-dark);
  }
}

.dc-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 68px;
  padding: 8px 10px 6px;
  background: linear-gradient(180deg, #fafafa 0%, #ddd 100%);
  border: 2px solid #aaa;
  border-radius: 4px;
  box-shadow: 0 2px 0 var(--dc-shadow), inset 0 1px 0 #fff;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--dc-black);
  text-transform: lowercase;
  transition: transform 0.1s, border-color 0.15s;
}

.nav-tile:hover {
  border-color: var(--dc-orange);
  transform: translateY(-1px);
}

.nav-tile.active {
  border-color: var(--dc-blue);
  background: linear-gradient(180deg, #e8f0fa 0%, #c8d8ec 100%);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
  transform: translateY(1px);
}

.tile-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.app-view {
  flex: 1;
  min-height: 0;
}

/* Home: fit header + console + greeting + fish in one screen */
.app-shell:has(.view-home) {
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-bottom: 10px;
}

.app-shell:has(.view-home) .app-header {
  margin-bottom: 12px;
  flex-shrink: 0;
}

.app-view.view-home {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: visible;
}

.view-loading,
.empty-state {
  color: var(--dc-gray-dark);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  text-align: center;
  padding: 24px;
}

.view-error {
  color: #b33;
  font-family: var(--font-mono);
  text-align: center;
  padding: 16px;
}

/* ── Home / Dreamcast console ── */

.home-view {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1vh, 10px);
  width: 100%;
  padding: 0;
}

.dc-unit {
  flex: 0 0 auto;
  width: 100%;
  user-select: none;
  overflow: visible;
}

.dc-stage {
  position: relative;
  width: min(94vw, calc((100dvh - 11rem) * 1.12), 540px);
  margin: 0 auto;
}

.home-bottom {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.dc-console {
  width: 100%;
  background: linear-gradient(160deg, #fafafa 0%, #e8e8e4 50%, #d4d4d0 100%);
  border: 3px solid #b8b8b4;
  border-radius: 12px 12px 16px 16px;
  padding: 14px 14px 16px;
  box-shadow:
    0 8px 24px var(--dc-shadow),
    inset 0 2px 0 #fff,
    inset 0 -2px 0 #ccc;
}

.dc-screen {
  aspect-ratio: 4 / 3;
  background: radial-gradient(ellipse at center, #1a2840 0%, #0a1020 70%);
  border: 3px inset #888;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  perspective: 720px;
  perspective-origin: center 68%;
  transition: box-shadow 0.2s ease;
}

.dc-screen--hover {
  box-shadow:
    inset 0 0 28px rgba(255, 140, 60, 0.22),
    inset 0 0 0 2px rgba(255, 140, 60, 0.18);
}

.dc-static {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: staticShift 0.15s steps(3) infinite;
}

@keyframes staticShift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(-1%, 1%); }
  100% { transform: translate(1%, -1%); }
}

/* ── Empty TV screen (no disc inserted) ── */

.dc-no-disc {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.25s ease;
}

.dc-screen--inserted .dc-no-disc {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.dc-disc-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.35);
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.15), transparent 60%);
  position: relative;
}

.dc-disc-icon::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.dc-msg {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: #8ab4e8;
  letter-spacing: 0.2em;
  text-shadow: 0 0 12px rgba(138, 180, 232, 0.6);
}

/* ── Disc tray (outside TV) ── */

.dc-tray {
  position: absolute;
  left: calc(100% + clamp(8px, 1.5vw, 14px));
  top: 14px;
  width: clamp(68px, 18vw, 104px);
  height: clamp(76px, 19vw, 112px);
  perspective: 520px;
  perspective-origin: center 72%;
}

.dc-tray-surface {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(180deg, #c8c8c4 0%, #a8a8a4 55%, #888884 100%);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  transition: box-shadow 0.2s ease;
}

.dc-tray--hover .dc-tray-surface {
  box-shadow:
    0 0 12px rgba(255, 140, 60, 0.45),
    0 2px 4px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.dc-disc-source {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 5px;
  z-index: 2;
  width: 100%;
  line-height: 0;
  cursor: grab;
  touch-action: none;
  transform-style: preserve-3d;
  transform-origin: center bottom;
  transform: rotateX(68deg) rotateZ(4deg);
  transition:
    transform 0.38s cubic-bezier(0.33, 1, 0.52, 1),
    opacity 0.25s ease,
    filter 0.2s ease;
  outline: none;
}

@media (hover: hover) {
  .dc-disc-source:hover:not(.is-dragging):not(.is-hidden) {
    transform: rotateX(22deg) rotateZ(0deg) translateY(-12px) scale(1.06);
  }
}

.dc-disc-source:focus-visible:not(.is-dragging):not(.is-hidden) {
  transform: rotateX(22deg) rotateZ(0deg) translateY(-12px) scale(1.06);
}

.dc-disc-source.is-dragging {
  cursor: grabbing;
}

.dc-disc-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  line-height: 0;
  transform: rotate(-4deg) scale(1.05);
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.35));
}

.dc-disc-ghost img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

.dc-disc-source.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.dc-disc--tray {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.28));
}

/* ── Disc in TV screen ── */

.dc-disc-link {
  position: relative;
  z-index: 1;
  display: block;
  width: clamp(72px, 38%, 168px);
  line-height: 0;
  cursor: pointer;
  transition: filter 0.2s ease;
  transform-style: preserve-3d;
}

.dc-disc-link--hidden {
  display: none;
}

.dc-disc-link--inserting,
.dc-disc-link--inserted {
  display: block;
}

.dc-disc-link--inserting {
  pointer-events: none;
  animation: discInsert 1.2s cubic-bezier(0.33, 1.12, 0.52, 1) both;
}

.dc-disc-link--inserted {
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
}

.dc-disc-link.is-dragging {
  cursor: grabbing;
}

@keyframes discInsert {
  0% {
    opacity: 0;
    transform: translate3d(0, 120%, 0) rotateX(70deg) scale(0.84);
  }
  20% {
    opacity: 1;
  }
  52% {
    transform: translate3d(0, -7%, 10px) rotateX(14deg) scale(1.03);
  }
  70% {
    transform: translate3d(0, 4%, 0) rotateX(-5deg) scale(0.98);
  }
  84% {
    transform: translate3d(0, -2%, 0) rotateX(2deg) scale(1.01);
  }
  100% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateX(0deg) scale(1);
  }
}

.dc-disc-link:hover .dc-disc--screen,
.dc-disc-link:focus-visible .dc-disc--screen {
  filter: drop-shadow(0 0 16px rgba(255, 140, 60, 0.75));
}

.dc-disc {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
}

.dc-disc--screen {
  filter: drop-shadow(0 0 10px rgba(255, 120, 40, 0.45));
}

.dc-disc-link--inserted .dc-disc--screen {
  animation: discSpin 12s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .dc-disc-source {
    transition: none;
  }

  .dc-disc-source:hover:not(.is-dragging):not(.is-hidden),
  .dc-disc-source:focus-visible:not(.is-dragging):not(.is-hidden) {
    transform: rotateX(26deg) rotateZ(0deg) translateY(-8px);
  }

  .dc-disc-link--inserting {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .dc-disc-link--inserted .dc-disc--screen {
    animation: none;
  }
}

@media (max-width: 520px) {
  .dc-tray {
    left: calc(100% - 6px);
    width: clamp(52px, 16vw, 76px);
    height: clamp(64px, 17vw, 88px);
  }
}

.dc-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding: 0 4px;
}

.dc-power {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8a2020;
  border: 2px solid #666;
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

/* Easier to hit than the 14px LED alone */
.dc-power::before {
  content: "";
  position: absolute;
  inset: -10px;
}

.dc-power:hover {
  background: #aa2828;
}

.dc-power.lit {
  background: #ff3333;
  box-shadow: 0 0 8px #ff4444, 0 0 16px rgba(255, 60, 60, 0.5);
}

.dc-readout {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--dc-blue);
  letter-spacing: 0.15em;
}

.dc-ports {
  display: flex;
  gap: 6px;
}

.dc-port {
  width: 14px;
  height: 8px;
  background: #333;
  border-radius: 2px;
  border: 1px solid #222;
}

.greeting {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  color: var(--dc-gray-dark);
  letter-spacing: 0.06em;
}

.home-footer {
  flex-shrink: 0;
}

.home-footer .fish {
  display: inline-block;
  font-size: 1.1rem;
  cursor: default;
  transition: transform 0.2s;
  user-select: none;
  opacity: 0.45;
}

.home-footer .fish:hover {
  transform: scale(1.15);
  opacity: 0.7;
}

/* ── Static burst (KitTV secret) ── */

.static-burst {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  background: #111;
}

.static-burst.active {
  animation: burstFlash 0.6s ease forwards;
}

.static-burst canvas {
  width: 100%;
  height: 100%;
  display: block;
}

@keyframes burstFlash {
  0% { opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { opacity: 0; }
}

/* ── Content pages ── */

.content-page {
  background: linear-gradient(180deg, #fff 0%, var(--dc-gray) 100%);
  border: 2px solid #bbb;
  border-radius: 6px;
  padding: 20px 20px 28px;
  box-shadow: 0 3px 0 var(--dc-shadow), inset 0 1px 0 #fff;
}

.page-header {
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--dc-orange);
}

.page-title {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  color: var(--dc-blue-dark);
  text-transform: lowercase;
  letter-spacing: 0.04em;
}

.page-sub {
  font-family: var(--font-mono);
  color: var(--dc-gray-dark);
  font-size: 1rem;
  margin-top: 4px;
}

/* ── Journal ── */

.journal-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.journal-entry {
  position: relative;
  padding: 16px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  border-left: 4px solid var(--dc-blue);
}

.journal-entry.pinned {
  border-left-color: var(--dc-orange);
}

.pin-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--dc-orange);
  margin-bottom: 8px;
  text-transform: lowercase;
}

.entry-cover {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: 3px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
}

.entry-title {
  font-family: var(--font-mono);
  font-size: 1.4rem;
  color: var(--dc-blue-dark);
  margin-bottom: 4px;
}

.entry-date {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--dc-gray-dark);
  margin-bottom: 12px;
}

.markdown-body {
  font-size: 0.95rem;
  line-height: 1.65;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  font-family: var(--font-mono);
  color: var(--dc-blue-dark);
  margin: 1em 0 0.5em;
}

.markdown-body p {
  margin-bottom: 0.75em;
}

.markdown-body a {
  color: var(--dc-orange);
}

.markdown-body img {
  max-width: 100%;
  border-radius: 3px;
}

.markdown-body pre {
  background: #f0f0ec;
  padding: 12px;
  border-radius: 3px;
  overflow-x: auto;
  font-size: 0.85rem;
}

.markdown-body blockquote {
  border-left: 3px solid var(--dc-orange);
  padding-left: 12px;
  color: #555;
  margin: 0.75em 0;
}

.markdown-body ul,
.markdown-body ol {
  padding-left: 1.4em;
  margin-bottom: 0.75em;
}

/* ── Art ── */

.art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.art-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0;
  border: 2px solid #bbb;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s;
}

.art-card:hover {
  border-color: var(--dc-orange);
  transform: translateY(-2px);
}

.art-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.art-placeholder {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  font-family: var(--font-mono);
  color: #999;
  font-size: 0.85rem;
}

.art-card-title {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0 8px 8px;
  color: var(--dc-black);
}

.art-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.art-lightbox.hidden {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: min(92vw, 720px);
  max-height: 90vh;
  overflow: auto;
  background: var(--dc-white);
  border: 3px solid var(--dc-orange);
  border-radius: 6px;
  padding: 16px;
}

.lightbox-panel img {
  width: 100%;
  display: block;
  border-radius: 3px;
}

.lightbox-meta {
  margin-top: 12px;
}

.lightbox-meta h2 {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  color: var(--dc-blue-dark);
}

.lightbox-meta p {
  margin-top: 6px;
  color: #444;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: none;
  background: var(--dc-orange);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
}

/* ── Music ── */

.music-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.music-item {
  padding: 16px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.music-title {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  color: var(--dc-blue-dark);
  margin-bottom: 12px;
}

.music-embed iframe {
  width: 100%;
  min-height: 120px;
  border: none;
  border-radius: 3px;
}

.music-link {
  color: var(--dc-orange);
  word-break: break-all;
}

/* ── Admin ── */

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.admin-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.admin-tab {
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 1rem;
  background: #eee;
  border: 2px solid #aaa;
  border-radius: 4px;
  cursor: pointer;
  text-transform: lowercase;
}

.admin-tab.active {
  background: var(--dc-blue);
  color: #fff;
  border-color: var(--dc-blue-dark);
}

.admin-split {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 700px) {
  .admin-split {
    grid-template-columns: 1fr;
  }
}

.admin-section-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--dc-blue-dark);
  margin-bottom: 10px;
  text-transform: lowercase;
}

.admin-item-list {
  list-style: none;
  margin-bottom: 12px;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
}

.admin-list-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  border: none;
  border-bottom: 1px solid #eee;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  cursor: pointer;
}

.admin-list-btn:hover {
  background: #f0f4fa;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-form.hidden {
  display: none;
}

.admin-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #444;
}

.admin-label input,
.admin-label textarea,
.admin-label select {
  padding: 8px 10px;
  border: 2px solid #bbb;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}

.admin-label textarea {
  resize: vertical;
  font-family: "Courier New", monospace;
  font-size: 0.88rem;
}

.admin-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.admin-preview {
  max-width: 200px;
  max-height: 160px;
  object-fit: contain;
  border: 1px solid #ccc;
  border-radius: 3px;
}

.admin-preview.hidden {
  display: none;
}

.admin-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.admin-hint {
  font-size: 0.8rem;
  color: var(--dc-gray-dark);
}

.admin-status {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  color: var(--dc-blue);
}

.admin-error {
  color: #b33 !important;
}

.admin-error.hidden {
  display: none;
}

.admin-login {
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dc-btn {
  padding: 8px 18px;
  font-family: var(--font-mono);
  font-size: 1rem;
  text-transform: lowercase;
  background: linear-gradient(180deg, var(--dc-orange-bright) 0%, var(--dc-orange) 100%);
  color: #fff;
  border: 2px solid #c55a10;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--dc-shadow);
  transition: transform 0.1s;
}

.dc-btn:hover {
  transform: translateY(-1px);
}

.dc-btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.dc-btn-ghost {
  background: transparent;
  color: var(--dc-blue-dark);
  border-color: var(--dc-blue);
  box-shadow: none;
}

.dc-btn-danger {
  background: linear-gradient(180deg, #e44 0%, #c22 100%);
  border-color: #a11;
}

/* ── Responsive ── */

@media (max-width: 480px) {
  .app-header {
    flex-direction: column;
    align-items: stretch;
  }

  .dc-nav {
    justify-content: center;
  }

  .nav-tile {
    min-width: 60px;
    flex: 1;
  }

  .dc-unit {
    width: min(94vw, calc((100dvh - 14rem) * 1.05), 560px);
  }

  .content-page {
    padding: 14px;
  }

  .page-title {
    font-size: 1.5rem;
  }
}
