@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Noto+Sans+JP:wght@400;500;700;800&display=swap');

:root {
  --bg: #090911;
  --panel: rgba(19, 20, 31, 0.88);
  --panel-strong: rgba(25, 26, 39, 0.96);
  --line: rgba(155, 171, 255, 0.18);
  --line-strong: rgba(168, 139, 255, 0.42);
  --text: #ececf6;
  --muted: #9a9bb4;
  --dim: #5e617c;
  --purple: #bd8cff;
  --pink: #ff7db8;
  --cyan: #7fdfff;
  --green: #82f6a5;
  --yellow: #f2cf7c;
  --red: #ff7c86;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    linear-gradient(rgba(9, 9, 17, 0.72), rgba(9, 9, 17, 0.88)),
    url('/og.png') center / min(56vw, 620px) auto no-repeat,
    linear-gradient(135deg, rgba(127, 223, 255, 0.09), transparent 34%, rgba(189, 140, 255, 0.08) 72%, transparent),
    #090911;
  color: var(--text);
  font-family: Inter, 'Noto Sans JP', system-ui, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 4px),
    linear-gradient(90deg, rgba(127, 223, 255, 0.05), transparent 28%, transparent 72%, rgba(189, 140, 255, 0.05));
  mix-blend-mode: screen;
  opacity: 0.42;
}

a { color: inherit; }

button,
input {
  font: inherit;
}

.desktop {
  position: relative;
  height: 100vh;
  min-height: 640px;
  isolation: isolate;
}

.topbar {
  height: 38px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(9, 9, 17, 0.76);
  backdrop-filter: blur(18px);
  user-select: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(189, 140, 255, 0.52);
  color: var(--purple);
  background: rgba(189, 140, 255, 0.1);
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  box-shadow: 0 0 18px rgba(189, 140, 255, 0.16);
}

.menu {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.menu-button,
.status-pill,
.icon-button,
.dock-button,
.window-control {
  border: 1px solid transparent;
  color: var(--text);
  background: transparent;
}

.menu-button {
  padding: 6px 10px;
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
}

.menu-button:hover,
.menu-button:focus-visible {
  color: var(--text);
  background: rgba(255,255,255,0.08);
  outline: none;
}

.system-status {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border-color: rgba(255,255,255,0.09);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 14px var(--green);
}

.workspace {
  position: absolute;
  inset: 38px 0 72px;
}

.desktop-icons {
  position: absolute;
  inset: 22px auto auto 18px;
  display: grid;
  gap: 10px;
  width: 86px;
  z-index: 4;
}

.desktop-icon {
  width: 76px;
  min-height: 76px;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 5px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
}

.desktop-icon:hover,
.desktop-icon.is-selected,
.desktop-icon:focus-visible {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
  outline: none;
}

.icon-glyph,
.dock-glyph {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(127, 223, 255, 0.18), rgba(189, 140, 255, 0.16)),
    rgba(16, 18, 28, 0.92);
  border: 1px solid rgba(168, 139, 255, 0.3);
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 26px rgba(0,0,0,0.24);
}

.icon-glyph img,
.dock-glyph img,
.social-logo {
  display: block;
  max-width: 72%;
  max-height: 72%;
  object-fit: contain;
}

.icon-glyph {
  width: 38px;
  height: 38px;
  font-size: 16px;
}

.desktop-icon span:last-child {
  max-width: 72px;
  color: #d9daf0;
  font-size: 11px;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 5px rgba(0,0,0,0.9);
  overflow-wrap: anywhere;
}

.windows {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.window {
  position: absolute;
  min-width: 260px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(20px);
  pointer-events: auto;
}

.window.is-hidden {
  display: none;
}

.window.is-maximized {
  left: 104px !important;
  top: 14px !important;
  right: auto !important;
  bottom: auto !important;
  width: calc(100vw - 128px) !important;
  height: calc(100vh - 138px) !important;
}

.window.is-maximized .window-body {
  height: calc(100% - 38px);
  overflow: auto;
}

.window.is-maximized .terminal-screen {
  height: 100%;
}

.window[data-window="about"] {
  left: clamp(108px, 10vw, 156px);
  top: 34px;
  width: min(490px, calc(100vw - 140px));
}

.window[data-window="terminal"] {
  left: clamp(290px, 36vw, 560px);
  top: 100px;
  width: min(620px, calc(100vw - 330px));
}

.window[data-window="social"] {
  right: clamp(24px, 5vw, 72px);
  top: 46px;
  width: min(360px, 34vw);
}

.window[data-window="games"] {
  left: clamp(132px, 18vw, 330px);
  bottom: 34px;
  width: min(470px, calc(100vw - 180px));
}

.window[data-window="now"] {
  right: clamp(22px, 6vw, 86px);
  bottom: 44px;
  width: min(390px, 36vw);
}

.window-bar {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  cursor: grab;
  user-select: none;
}

.window-bar:active {
  cursor: grabbing;
}

.window-controls {
  display: flex;
  gap: 6px;
}

.window-control {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: rgba(16, 18, 28, 0.72);
  font-size: 11px;
  line-height: 1;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 800;
}

.window-control.close { background: #ff6570; }
.window-control.min { background: #f2c86c; }
.window-control.max { background: #70e69a; }

.window-control:hover,
.window-control:focus-visible {
  filter: brightness(1.12);
  outline: none;
}

.window-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #dfe0f4;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.window-title code {
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.window-body {
  padding: 18px;
}

.about-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
}

.avatar {
  width: 86px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(189, 140, 255, 0.4);
  background:
    linear-gradient(145deg, rgba(189, 140, 255, 0.18), rgba(127, 223, 255, 0.08)),
    rgba(255,255,255,0.04);
  color: var(--purple);
  font-family: 'JetBrains Mono', monospace;
  font-size: 34px;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 0 40px rgba(189, 140, 255, 0.15);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

h1,
h2,
p {
  margin-top: 0;
}

.about-copy h1 {
  margin-bottom: 8px;
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: 0;
}

.about-copy p {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric,
.game-row,
.now-row,
.social-link {
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.045);
}

.metric {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
}

.metric b {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 14px;
}

.metric span {
  color: var(--dim);
  font-size: 11px;
}

.terminal-window .window-body {
  padding: 0;
}

.terminal-screen {
  height: 390px;
  display: flex;
  flex-direction: column;
  background: rgba(5, 6, 10, 0.74);
  font-family: 'JetBrains Mono', monospace;
}

.terminal-output {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  color: #d7d9e8;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.terminal-line {
  word-break: break-word;
}

.terminal-input-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}

.prompt {
  flex: 0 0 auto;
  color: var(--green);
  font-weight: 700;
}

.prompt span {
  color: var(--purple);
}

#terminalInput {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.c-purple { color: var(--purple); }
.c-pink { color: var(--pink); }
.c-green { color: var(--green); }
.c-blue { color: #8fb7ff; }
.c-yellow { color: var(--yellow); }
.c-red { color: var(--red); }
.c-dim { color: var(--dim); }
.c-white { color: var(--text); }
.c-cyan { color: var(--cyan); }
.c-bold { font-weight: 700; }

.term-link {
  color: var(--cyan);
  text-decoration: none;
  border-bottom: 1px dotted rgba(127, 223, 255, 0.55);
}

.social-list,
.game-list,
.now-list {
  display: grid;
  gap: 10px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.18s, transform 0.18s, background 0.18s;
}

.social-link-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.social-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.social-logo.is-discord {
  max-width: 30px;
  max-height: 24px;
}

.social-copy {
  min-width: 0;
}

.social-link:hover,
.social-link:focus-visible {
  border-color: var(--line-strong);
  background: rgba(189, 140, 255, 0.08);
  transform: translateY(-1px);
  outline: none;
}

.social-link small,
.game-row small,
.now-row small {
  color: var(--muted);
}

.arrow {
  color: var(--cyan);
  font-family: 'JetBrains Mono', monospace;
}

.game-row,
.now-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 8px;
}

.game-row b,
.now-row b {
  display: block;
  margin-bottom: 3px;
}

.tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(130, 246, 165, 0.1);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
}

.tag.warn {
  background: rgba(242, 207, 124, 0.1);
  color: var(--yellow);
}

.dock {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(14, 15, 24, 0.76);
  box-shadow: 0 20px 60px rgba(0,0,0,0.42);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.dock-button {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  cursor: pointer;
}

.dock-button:hover,
.dock-button:focus-visible,
.dock-button.is-active {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.11);
  outline: none;
}

.dock-glyph {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.dock-separator {
  width: 1px;
  height: 30px;
  background: rgba(255,255,255,0.12);
}

.gui-link {
  width: auto;
  padding: 0 12px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.gui-link:hover,
.gui-link:focus-visible {
  color: var(--text);
  outline: none;
}

.boot-badge {
  position: absolute;
  right: 18px;
  top: 56px;
  z-index: 3;
  padding: 8px 11px;
  border: 1px solid rgba(127, 223, 255, 0.18);
  border-radius: 8px;
  background: rgba(6, 8, 13, 0.5);
  color: var(--dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.context-menu {
  position: fixed;
  z-index: 60;
  min-width: 196px;
  padding: 6px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  background: rgba(17, 18, 28, 0.96);
  box-shadow: 0 18px 54px rgba(0,0,0,0.5);
  backdrop-filter: blur(18px);
}

.context-menu.is-hidden {
  display: none;
}

.context-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
}

.context-item:hover,
.context-item:focus-visible {
  background: rgba(127, 223, 255, 0.1);
  outline: none;
}

.context-item small {
  color: var(--dim);
  font-size: 11px;
}

.context-separator {
  height: 1px;
  margin: 5px 4px;
  background: rgba(255,255,255,0.1);
}

@media (max-width: 900px) {
  body {
    overflow: auto;
    background-size: 720px auto;
    background-position: center 72px;
  }

  .desktop {
    height: auto;
    min-height: 100vh;
    padding-bottom: 86px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 25;
    grid-template-columns: 1fr auto;
  }

  .menu {
    display: none;
  }

  .workspace {
    position: static;
    padding: 14px;
  }

  .desktop-icons {
    position: static;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 12px;
  }

  .desktop-icon {
    width: 100%;
  }

  .windows {
    position: static;
    display: grid;
    gap: 12px;
  }

  .window,
  .window[data-window] {
    position: static;
    width: 100%;
    min-width: 0;
  }

  .window.is-hidden {
    display: block;
  }

  .window-bar {
    cursor: default;
  }

  .window-controls {
    display: none;
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .avatar {
    width: 72px;
  }

  .status-grid {
    grid-template-columns: 1fr;
  }

  .terminal-screen {
    height: 360px;
  }

  .dock {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: 12px;
    transform: none;
    justify-content: center;
    overflow-x: auto;
  }

  .boot-badge {
    display: none;
  }
}

@media (max-width: 520px) {
  .system-status .status-pill:first-child {
    display: none;
  }

  .desktop-icons {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .window-body {
    padding: 14px;
  }

  .about-copy h1 {
    font-size: 25px;
  }

  .terminal-output,
  #terminalInput {
    font-size: 12px;
  }

  .dock-button {
    width: 42px;
    height: 42px;
  }

  .gui-link {
    display: none;
  }
}
