/* -------------------------------------------------------------------------- */
/* Theme: PC-98 (NEC PC-9801 / MS-DOS Japanese 16-Bit Tiling Window Manager) */
/* Layout: Cyan/Magenta Double-Box Drawing Filer & Interactive DOS Prompt     */
/* Contrast: WCAG AA Pass (Text on Console 20.5:1, Text on DOS Blue 15.7:1)   */
/* -------------------------------------------------------------------------- */

body[data-theme-layout="pc98"],
:root[data-theme-layout="pc98"] body {
  --sky: #000084;
  --sky-grad: linear-gradient(rgba(0, 0, 0, 0.22) 50%, transparent 50%) 0 0 / 100% 4px,
              linear-gradient(180deg, #000084 0%, #00006b 100%);
  --card: #000020;
  --ink: #ffffff;
  --ink-soft: #55ffff;
  --slot: #000000;
  --shadow-1: #000000;
  --shadow-2: #55ffff;
  --gold: #ffff55;
  --chip-bg: rgba(85, 255, 255, 0.1);
  --dither: rgba(85, 255, 255, 0.05);
  background: var(--sky);
  background-image: var(--sky-grad);
  background-attachment: fixed;
  color: var(--ink);
  font-family: 'Press Start 2P', 'Courier New', monospace;
  letter-spacing: 0.03em;
}

/* Sharp PC-98 Bitmap Geometry */
body[data-theme-layout="pc98"] *,
:root[data-theme-layout="pc98"] * {
  border-radius: 0 !important;
}

/* Hide modern ambient elements */
body[data-theme-layout="pc98"] .bg,
:root[data-theme-layout="pc98"] .bg {
  opacity: 0.2;
}

/* PC-98 Workspace Desktop */
body[data-theme-layout="pc98"] main,
:root[data-theme-layout="pc98"] main {
  max-width: 48rem;
  padding: 1.2rem 1rem 6rem;
}

/* Top System OS Menu Bar */
body[data-theme-layout="pc98"] main::before,
:root[data-theme-layout="pc98"] main::before {
  content: " [SYS] FURPHY-OS v2.41    [640KB RAM OK]    [23:18 JST]    [_][口][X]";
  display: block;
  background: #55ffff;
  color: #000084;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.35rem 0.7rem;
  letter-spacing: 0.08em;
  margin-bottom: 1.4rem;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 0 #000000;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
}

/* User Profile Window */
body[data-theme-layout="pc98"] .player,
:root[data-theme-layout="pc98"] .player {
  position: relative;
  background: #000020;
  border: 2px solid #55ffff;
  box-shadow: inset 0 0 0 1px #ff55ff, 4px 4px 0 #000000;
  padding: 1.6rem 1.2rem 1.4rem;
  margin-bottom: 1.8rem;
  overflow: hidden;
}

/* Window Header Bar */
body[data-theme-layout="pc98"] .player::before,
:root[data-theme-layout="pc98"] .player::before {
  content: "╔═[ USER: FURPHY.EXE ]═════════════════════════════════════[▲][X]═╗";
  position: absolute;
  top: -12px;
  left: 10px;
  background: #000020;
  color: #ffff55;
  font-size: 0.52rem;
  padding: 0.1rem 0.5rem;
  letter-spacing: 0.05em;
  z-index: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 20px);
  box-sizing: border-box;
}

/* Graphic VRAM Buffer Frame */
body[data-theme-layout="pc98"] .avatar-slot,
:root[data-theme-layout="pc98"] .avatar-slot {
  width: 116px;
  height: 116px;
  background: #000000;
  border: 2px solid #55ffff;
  box-shadow: 3px 3px 0 #000000;
  animation: none;
  margin-bottom: 0.9rem;
}

body[data-theme-layout="pc98"] .avatar-slot img,
:root[data-theme-layout="pc98"] .avatar-slot img {
  image-rendering: pixelated;
}

/* PC-98 Typography */
body[data-theme-layout="pc98"] h1,
:root[data-theme-layout="pc98"] h1 {
  color: #ffffff;
  font-size: clamp(1.4rem, 6vw, 1.85rem);
  text-shadow: 2px 2px 0 #000084;
  margin-bottom: 0.35rem;
}

body[data-theme-layout="pc98"] .kana,
:root[data-theme-layout="pc98"] .kana {
  color: #ffff55;
  font-size: 0.9rem;
  letter-spacing: 0.35em;
  margin-bottom: 0.4rem;
}

body[data-theme-layout="pc98"] .tagline,
:root[data-theme-layout="pc98"] .tagline {
  color: #55ffff;
  font-size: 0.65rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Serial Comms Port Matrix */
body[data-theme-layout="pc98"] .socials,
:root[data-theme-layout="pc98"] .socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

body[data-theme-layout="pc98"] .slot-btn,
:root[data-theme-layout="pc98"] .slot-btn {
  width: auto;
  min-width: 50px;
  height: 38px;
  padding: 0 0.55rem;
  background: #000020;
  border: 2px solid #55ffff;
  box-shadow: 2px 2px 0 #000000;
  color: #55ffff;
  font-size: 0.52rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

body[data-theme-layout="pc98"] .slot-btn canvas,
:root[data-theme-layout="pc98"] .slot-btn canvas {
  width: 22px;
  height: 22px;
}

/* COM Port Tags */
body[data-theme-layout="pc98"] .slot-btn[href*="github"]::after { content: "COM1"; }
body[data-theme-layout="pc98"] .slot-btn[href*="instagram"]::after { content: "COM2"; }
body[data-theme-layout="pc98"] .slot-btn[data-copy*=".furphy"]::after { content: "IRQ3"; }
body[data-theme-layout="pc98"] .slot-btn[data-copy*="furphy#1270"]::after { content: "IRQ4"; }
body[data-theme-layout="pc98"] .slot-btn[href*="raider.io"]::after { content: "LPT1"; }
body[data-theme-layout="pc98"] .slot-btn[href*="warcraftlogs"]::after { content: "NET0"; }
body[data-theme-layout="pc98"] .slot-btn[href*="mailto:"]::after { content: "SMTP"; }

body[data-theme-layout="pc98"] .slot-btn:hover,
:root[data-theme-layout="pc98"] .slot-btn:hover {
  background: #55ffff;
  color: #000020;
  border-color: #ffffff;
}

/* Divider / Directory Header */
body[data-theme-layout="pc98"] .divider,
:root[data-theme-layout="pc98"] .divider {
  color: #ffff55;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  margin: 1.6rem 0 1rem;
}

body[data-theme-layout="pc98"] .divider::before,
body[data-theme-layout="pc98"] .divider::after,
:root[data-theme-layout="pc98"] .divider::before,
:root[data-theme-layout="pc98"] .divider::after {
  border-top: 2px solid #55ffff;
}

/* Directory Window (C:\PROJECTS\*.*) */
body[data-theme-layout="pc98"] .worlds,
:root[data-theme-layout="pc98"] .worlds {
  position: relative;
  background: #000020;
  border: 2px solid #55ffff;
  box-shadow: inset 0 0 0 1px #ff55ff, 4px 4px 0 #000000;
  padding: 1.2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

/* Directory File Table Header */
body[data-theme-layout="pc98"] .worlds::before,
:root[data-theme-layout="pc98"] .worlds::before {
  content: "╔═[ DIRECTORY: C:\\PROJECTS\\*.* ]═══════════════════════════════[▲][X]═╗\A FILENAME              TYPE      SIZE       DATE     STATUS";
  white-space: pre-wrap;
  display: block;
  color: #ffff55;
  font-size: 0.52rem;
  line-height: 1.6;
  border-bottom: 2px solid #55ffff;
  padding-bottom: 0.5rem;
  margin-bottom: 0.6rem;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

/* World Cards (16-Bit Files) */
body[data-theme-layout="pc98"] .world,
:root[data-theme-layout="pc98"] .world {
  background: #000018;
  border: 1px solid #55ffff;
  box-shadow: none;
  padding: 0.8rem 0.95rem;
  color: #ffffff;
  transition: none;
}

/* Hover Highlight Bar (Norton Commander / Filer Inversion) */
body[data-theme-layout="pc98"] .world:hover,
:root[data-theme-layout="pc98"] .world:hover {
  background: #55ffff;
  color: #000020;
  border-color: #ffffff;
  transform: none;
}

body[data-theme-layout="pc98"] .world:hover .wname,
body[data-theme-layout="pc98"] .world:hover .blurb,
body[data-theme-layout="pc98"] .world:hover .chip,
:root[data-theme-layout="pc98"] .world:hover .wname,
:root[data-theme-layout="pc98"] .world:hover .blurb,
:root[data-theme-layout="pc98"] .world:hover .chip {
  color: #000020;
}

/* File Entry Typography */
body[data-theme-layout="pc98"] .wname,
:root[data-theme-layout="pc98"] .wname {
  color: #ffffff;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

body[data-theme-layout="pc98"] .badge,
:root[data-theme-layout="pc98"] .badge {
  background: #000084;
  color: #ffff55;
  border: 1px solid #55ffff;
  font-size: 0.48rem;
  box-shadow: none;
}

body[data-theme-layout="pc98"] .icon-slot,
:root[data-theme-layout="pc98"] .icon-slot {
  background: #000000;
  border: 1px solid #55ffff;
  width: 52px;
  height: 52px;
}

body[data-theme-layout="pc98"] .blurb,
:root[data-theme-layout="pc98"] .blurb {
  color: #55ffff;
  font-size: 0.62rem;
  line-height: 1.6;
  margin: 0.35rem 0 0.5rem;
}

body[data-theme-layout="pc98"] .chip,
:root[data-theme-layout="pc98"] .chip {
  background: #000000;
  color: #ffff55;
  border: 1px solid #55ffff;
  font-size: 0.5rem;
  box-shadow: none;
}

/* Interactive DOS Command Prompt Footer */
@keyframes pc98-cursor-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

body[data-theme-layout="pc98"] footer,
:root[data-theme-layout="pc98"] footer {
  margin-top: 2.2rem;
  text-align: left;
}

body[data-theme-layout="pc98"] footer::before,
:root[data-theme-layout="pc98"] footer::before {
  content: "C:\\FURPHY> DIR /W\A 6 File(s)   33,648,128 bytes free\A C:\\FURPHY> EXECUTE_ALL.BAT\A C:\\FURPHY> █";
  white-space: pre-wrap;
  display: block;
  background: #000020;
  border: 2px solid #55ffff;
  box-shadow: 4px 4px 0 #000000;
  padding: 0.75rem 1rem;
  color: #55ff55;
  font-family: 'Press Start 2P', monospace;
  font-size: 0.58rem;
  line-height: 1.8;
  margin-bottom: 1.2rem;
  animation: pc98-cursor-blink 1.2s steps(1, end) infinite;
}

body[data-theme-layout="pc98"] .press,
:root[data-theme-layout="pc98"] .press {
  color: #ffff55;
  font-size: 0.6rem;
  text-align: center;
}

/* Accessibility Focus States */
body[data-theme-layout="pc98"] a:focus-visible,
body[data-theme-layout="pc98"] button:focus-visible,
:root[data-theme-layout="pc98"] a:focus-visible,
:root[data-theme-layout="pc98"] button:focus-visible {
  outline: 2px dashed #ffff55;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  body[data-theme-layout="pc98"] *,
  body[data-theme-layout="pc98"] *::before,
  body[data-theme-layout="pc98"] *::after {
    animation: none !important;
    transition: none !important;
  }
}
