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

html {
  scroll-behavior: smooth;
}

body {
  background: #000000;
  color: #FFFFFF;
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  line-height: 2;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: unset;
}

#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

#content {
  position: relative;
  z-index: 1;
}

.section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 18px;
}

.section-inner {
  max-width: 540px;
  width: 100%;
}

.section-hero {
  min-height: 100vh;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-bottom: 100px;
}

.hero-title {
  font-size: 27px;
  letter-spacing: 4px;
  margin-bottom: 15px;
  text-transform: uppercase;
}

.hero-title .char {
  display: inline-block;
  opacity: 0;
}

.hero-subtitle {
  font-size: 8px;
  letter-spacing: 2px;
  margin-bottom: 30px;
  opacity: 0.8;
}

.hero-quote {
  margin-bottom: 30px;
  line-height: 2.4;
}

.hero-quote p {
  font-size: 7px;
  opacity: 0.7;
  font-style: italic;
}

.quote-author {
  font-size: 6px;
  opacity: 0.5;
  display: block;
  margin-top: 6px;
}

.hero-meta {
  font-size: 6px;
  opacity: 0.4;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

@keyframes unified-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

.scroll-indicator {
  font-size: 6px;
  opacity: 0.3;
  animation: pulse-scroll-opacity 2s ease-in-out infinite, unified-bounce 2s ease-in-out infinite;
  position: relative;
  z-index: 2;
  margin-bottom: 30px;
}

@keyframes pulse-scroll-opacity {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

#guide-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

#guide-line.visible {
  opacity: 1;
}

#guide-path {
  animation: guide-stroke-breathe 2s ease-in-out infinite;
}

@keyframes guide-stroke-breathe {
  0%, 100% { stroke-opacity: 0.2; stroke-width: 1; }
  50% { stroke-opacity: 0.5; stroke-width: 1.5; }
}

h2 {
  font-size: 14px;
  letter-spacing: 2px;
  margin-bottom: 22px;
  text-transform: uppercase;
}

h2 .char {
  display: inline-block;
  opacity: 0;
}

h3 {
  font-size: 8px;
  letter-spacing: 1px;
  margin-bottom: 12px;
  opacity: 0.8;
}

h4 {
  font-size: 8px;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

p {
  font-size: 8px;
  line-height: 2.2;
  margin-bottom: 12px;
  opacity: 0.85;
}

ul {
  list-style: none;
  padding: 0;
}

ul li {
  font-size: 8px;
  line-height: 2.2;
  padding-left: 15px;
  position: relative;
  opacity: 0.85;
  margin-bottom: 3px;
}

ul li::before {
  content: '>';
  position: absolute;
  left: 0;
  opacity: 0.5;
}

.comparison {
  margin-top: 40px;
}

.comparison h3 {
  opacity: 0.5;
  font-size: 7px;
  margin-bottom: 15px;
}

.compare-grid {
  display: grid;
  gap: 0;
}

.compare-row {
  display: grid;
  grid-template-columns: 75px 1fr 1fr;
  gap: 9px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 7px;
}

.compare-row.compare-header {
  border-bottom: 1px solid rgba(255,255,255,0.15);
  opacity: 0.5;
  font-size: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.compare-row span:first-child {
  opacity: 0.5;
}

.philosophy-block {
  margin-bottom: 40px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.philosophy-block h3 {
  font-size: 8px;
}

.flow-diagram {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding: 24px 0;
}

.flow-node {
  font-size: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  letter-spacing: 1px;
}

.flow-arrow {
  font-size: 11px;
  opacity: 0.4;
}

.how-details p {
  padding-left: 20px;
  position: relative;
}

.how-details p::before {
  content: '>';
  position: absolute;
  left: 0;
  opacity: 0.5;
}

.details-block {
  margin-bottom: 30px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.06);
}

.details-block h3 {
  margin-bottom: 12px;
}

.security-layer {
  margin-bottom: 24px;
  padding-left: 16px;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.security-note {
  font-size: 7px;
  opacity: 0.5;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 15px;
}

.limitations-intro {
  margin-bottom: 18px;
  opacity: 0.6;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.limitations-list li {
  opacity: 0.7;
}

.dev-notice {
  font-size: 6px !important;
  opacity: 0.3 !important;
  margin-top: 20px;
  letter-spacing: 0.5px;
  font-style: italic;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
}

@media (max-width: 600px) {
  .dev-notice {
    font-size: 4px !important;
  }
}

.file-tree {
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.file-tree-line {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  line-height: 2.4;
  white-space: pre;
  opacity: 0;
}

.file-tree-line.is-dir {
  color: #ffffff;
  opacity: 0;
}

.file-tree-line.is-file {
  color: rgba(255,255,255,0.7);
  opacity: 0;
}

.file-tree-line .file-size {
  color: rgba(255,255,255,0.3);
  font-size: 5px;
}

.file-tree-line .file-desc {
  color: rgba(255,255,255,0.25);
  font-size: 5px;
}

.arch-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 20px;
}

.arch-node {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  line-height: 2;
  color: rgba(255,255,255,0.9);
  text-align: center;
  padding: 10px 16px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
}

.arch-node-main {
  font-size: 9px;
  letter-spacing: 2px;
  padding: 14px 30px;
  border-color: rgba(255,255,255,0.25);
}

.arch-node-wide {
  width: 100%;
  max-width: 460px;
}

.arch-sub {
  font-size: 6px;
  opacity: 0.5;
  letter-spacing: 1px;
}

.arch-arrow {
  font-size: 14px;
  color: rgba(255,255,255,0.3);
  line-height: 1.4;
  padding: 2px 0;
}

.arch-row-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 460px;
}

.arch-row-3 {
  grid-template-columns: repeat(3, 1fr);
}

.code-block {
  margin-bottom: 30px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateY(15px);
}

.file-header {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: rgba(255,255,255,0.4);
  padding: 10px 14px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  letter-spacing: 1px;
}

.file-header::before {
  content: '> ';
  opacity: 0.5;
}

.code-block pre {
  margin: 0;
  padding: 12px 14px;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  line-height: 2.2;
  color: rgba(255,255,255,0.75);
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.code-block code {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.stat-item {
  text-align: center;
  padding: 16px 8px;
  border: 1px solid rgba(255,255,255,0.06);
  opacity: 0;
  transform: translateY(15px);
}

.stat-number {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  color: #ffffff;
  display: block;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.stat-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  color: rgba(255,255,255,0.4);
  display: block;
  line-height: 2;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.terminal-output {
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  margin-bottom: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0;
  transform: translateY(15px);
}

.terminal-output pre {
  margin: 0;
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  line-height: 2.4;
  color: rgba(255,255,255,0.75);
  white-space: pre;
}

.terminal-prompt {
  color: rgba(255,255,255,0.5);
}

.terminal-output .term-result {
  color: rgba(255,255,255,0.4);
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.module-card {
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: transparent;
  opacity: 0;
  transform: translateY(15px);
}

.module-card h4 {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.module-card p {
  font-size: 6px;
  opacity: 0.5;
  line-height: 2;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .file-tree {
    padding: 10px;
  }

  .file-tree-line {
    font-size: 4px;
    line-height: 2.2;
  }

  .file-tree-line .file-size,
  .file-tree-line .file-desc {
    font-size: 3px;
  }

  .arch-node {
    font-size: 5px;
    padding: 6px 8px;
  }

  .arch-node-main {
    font-size: 6px;
    padding: 10px 16px;
  }

  .arch-sub {
    font-size: 4px;
  }

  .arch-arrow {
    font-size: 10px;
  }

  .arch-row-grid {
    gap: 4px;
  }

  .code-block pre,
  .code-block code,
  .file-header {
    font-size: 4px;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .stat-number {
    font-size: 10px;
  }

  .stat-label {
    font-size: 4px;
  }

  .stat-item {
    padding: 10px 6px;
  }

  .terminal-output {
    padding: 10px;
  }

  .terminal-output pre {
    font-size: 4px;
  }

  .module-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .module-card {
    padding: 10px;
  }

  .module-card h4 {
    font-size: 5px;
  }

  .module-card p {
    font-size: 4px;
  }
}

.section-inspired {
  text-align: center;
}

.inspired-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 30px;
}

.inspired-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.inspired-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  opacity: 0.7;
  filter: grayscale(100%) brightness(0.8);
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.inspired-img:hover {
  opacity: 1;
  filter: grayscale(0%) brightness(1);
}

.inspired-name {
  font-size: 7px;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: 0.9;
  margin-bottom: 2px;
}

.inspired-desc {
  font-size: 6px;
  opacity: 0.5;
  line-height: 2;
  max-width: 130px;
}

@media (max-width: 600px) {
  .inspired-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .inspired-img {
    width: 48px;
    height: 48px;
  }

  .inspired-name {
    font-size: 5px;
  }

  .inspired-desc {
    font-size: 4px;
    max-width: 100px;
  }
}

.section-footer {
  min-height: 50vh;
  text-align: center;
}

.footer-tagline {
  font-size: 11px;
  letter-spacing: 2px;
  margin-bottom: 18px;
  opacity: 1;
}

.footer-meta {
  font-size: 6px;
  opacity: 0.3;
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.tchar {
  display: inline;
  opacity: 0;
}

[data-animate="fade-up"] {
  opacity: 0;
  transform: translateY(20px);
}

#audio-start {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.5s ease;
}

#audio-start span {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #ffffff;
  opacity: 0.6;
  animation: pulse-enter 2s ease-in-out infinite;
}

.audio-hint {
  display: block;
  font-family: 'Press Start 2P', monospace;
  font-size: 5px !important;
  color: #ffffff;
  opacity: 0.25 !important;
  animation: none !important;
  margin-top: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@keyframes pulse-enter {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

#music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#music-player.visible {
  opacity: 1;
  pointer-events: auto;
}

#music-toggle {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.8);
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease;
  font-family: serif;
  padding: 0;
}

#music-toggle:hover {
  border-color: rgba(255,255,255,0.4);
}

#music-icon {
  display: inline-block;
  line-height: 1;
}

#music-icon.playing {
  animation: pulse-note 2s ease-in-out infinite;
}

@keyframes pulse-note {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

#music-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #ffffff;
  opacity: 0.3;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#volume-bar {
  width: 30px;
  height: 3px;
  background: rgba(255,255,255,0.1);
  overflow: hidden;
}

#volume-fill {
  width: 0%;
  height: 100%;
  background: rgba(255,255,255,0.5);
  transition: width 1s ease;
}

#github-link {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 60;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#github-link.visible {
  opacity: 1;
  pointer-events: auto;
}

#github-logo {
  width: 30px;
  height: 30px;
  filter: invert(1);
  animation:
    github-breathe 3s ease-in-out infinite,
    github-float   3s ease-in-out infinite;
}

@keyframes github-breathe {
  0%, 100% { opacity: 0.35; }
  50%      { opacity: 0.85; }
}

@keyframes github-float {
  0%, 100% { transform: translateY(0px); }
  50%      { transform: translateY(-4px); }
}

.hero-image {
  width: 100%;
  max-width: 320px;
  height: auto;
  margin-bottom: 24px;
  opacity: 0;
  transform: translateY(20px);
  mix-blend-mode: lighten;
}

#mobile-nav {
  display: none;
}

#content {
  overflow-x: hidden;
}

.section-inner {
  overflow-wrap: break-word;
  word-break: break-word;
}

p, li, span, h3, h4 {
  overflow-wrap: break-word;
  word-break: break-word;
}

.compare-grid {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.flow-diagram {
  max-width: 100%;
}

.flow-node {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.details-block {
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

#spiral-nav {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

#spiral-nav.visible {
  opacity: 1;
  pointer-events: auto;
}

.nav-item {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #ffffff;
  opacity: 0.2;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform-origin: right center;
  text-align: right;
  white-space: nowrap;
}

.nav-item.active {
  opacity: 0.9;
  transform: scale(1.1);
}

.nav-item:hover {
  opacity: 0.7;
}

#desktop-nav-arrow-wrap {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-end;
}

#desktop-nav-hint {
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  color: #ffffff;
  opacity: 0.4;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  animation: unified-bounce 2s ease-in-out infinite;
  pointer-events: none;
}

#desktop-nav-arrow {
  width: 24px;
  height: 24px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: #ffffff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.4;
  animation: unified-bounce 2s ease-in-out infinite;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

#desktop-nav-arrow:hover {
  opacity: 0.8;
  border-color: rgba(255,255,255,0.4);
}

#desktop-nav-arrow-wrap:hover #desktop-nav-hint {
  animation: none;
  opacity: 0.7;
  transform: translateX(0);
}

@media (max-width: 600px) {
  #desktop-nav-arrow-wrap {
    display: none;
  }
  #guide-line {
    display: block;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 6px;
  }

  .hero-title {
    font-size: 14px;
    letter-spacing: 2px;
  }

  .hero-subtitle {
    font-size: 6px;
    letter-spacing: 1px;
  }

  .hero-quote p {
    font-size: 5px;
  }

  .quote-author {
    font-size: 5px;
  }

  .hero-meta {
    font-size: 5px;
  }

  .scroll-indicator {
    font-size: 5px;
  }

  h2 {
    font-size: 9px;
    letter-spacing: 1px;
  }

  h3 {
    font-size: 6px;
  }

  h4 {
    font-size: 6px;
  }

  .section {
    padding: 45px 12px;
  }

  .section-inner {
    max-width: 100%;
    overflow: hidden;
  }

  p {
    font-size: 5px;
  }

  ul li {
    font-size: 5px;
    padding-left: 10px;
  }

  .compare-row {
    grid-template-columns: 38px 1fr 1fr;
    font-size: 5px;
    gap: 3px;
    padding: 4px 0;
  }

  .compare-row span {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
  }

  .compare-row.compare-header {
    font-size: 4px;
  }

  .comparison h3 {
    font-size: 5px;
  }

  .flow-diagram {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .flow-arrow {
    transform: rotate(90deg);
    font-size: 8px;
  }

  .flow-node {
    font-size: 5px;
    padding: 5px 8px;
    max-width: 100%;
    box-sizing: border-box;
  }

  .details-block {
    padding: 8px;
    max-width: 100%;
    overflow: hidden;
  }

  .details-block p {
    font-size: 5px;
  }

  .details-block h3 {
    font-size: 6px;
  }

  .philosophy-block {
    padding-left: 8px;
    max-width: 100%;
  }

  .philosophy-block h3 {
    font-size: 6px;
  }

  .security-layer {
    padding-left: 8px;
    max-width: 100%;
  }

  .security-layer h4 {
    font-size: 5px;
  }

  .security-layer p {
    font-size: 5px;
  }

  .security-note {
    font-size: 5px;
  }

  .how-details p {
    font-size: 5px;
  }

  .footer-tagline {
    font-size: 8px;
    letter-spacing: 1px;
  }

  .footer-meta {
    font-size: 5px;
  }

  .limitations-intro {
    font-size: 5px;
  }

  .limitations-list li {
    font-size: 5px;
  }

  #audio-start span {
    font-size: 7px;
  }

  #music-label {
    font-size: 4px;
  }

  #spiral-nav {
    display: none !important;
  }

  #mobile-nav {
    display: flex;
    position: fixed;
    bottom: 16px;
    right: 12px;
    flex-direction: column;
    align-items: flex-end;
    z-index: 70;
    pointer-events: auto;
    gap: 4px;
  }

  #mobile-nav-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 5px;
    color: #ffffff;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: breathe 3s ease-in-out infinite;
  }

  @keyframes breathe {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
  }

  #mobile-nav-arrow {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #ffffff;
    cursor: pointer;
    background: rgba(0,0,0,0.6);
    animation: unified-bounce 2s ease-in-out infinite;
  }
}

body.chat-open-mobile {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  height: 100% !important;
}

#chat-toggle {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(0,0,0,0.85);
  color: #ffffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  animation: chat-pulse 3s ease-in-out infinite;
  opacity: 0;
  pointer-events: none;
}

#chat-toggle.visible {
  opacity: 1;
  pointer-events: auto;
}

#chat-toggle:hover {
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
}

#chat-toggle.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8);
}

@keyframes chat-pulse {
  0%, 100% { border-color: rgba(255,255,255,0.15); }
  50% { border-color: rgba(255,255,255,0.4); }
}

#chat-panel {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 200;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 500px;
  max-height: calc(100vh - 100px);
  background: rgba(0, 0, 0, 0.95);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  overscroll-behavior: contain;
}

#chat-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

#chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

#chat-title {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  color: #ffffff;
  opacity: 0.7;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#chat-close {
  font-size: 18px;
  color: #ffffff;
  opacity: 0.4;
  cursor: pointer;
  transition: opacity 0.2s ease;
  line-height: 1;
}

#chat-close:hover {
  opacity: 0.9;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}

#chat-messages::-webkit-scrollbar {
  width: 3px;
}

#chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
}

.chat-msg {
  font-family: 'Press Start 2P', monospace;
  font-size: 6px;
  line-height: 2;
  padding: 10px 12px;
  max-width: 92%;
  word-break: break-word;
}

.bot-msg {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
  align-self: flex-start;
}

.user-msg {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ffffff;
  align-self: flex-end;
}

.chat-msg strong {
  color: #ffffff;
  opacity: 1;
}

.chat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 5px;
}

.chat-table th,
.chat-table td {
  padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.1);
  text-align: left;
}

.chat-table th {
  background: rgba(255,255,255,0.06);
  font-weight: normal;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.6;
}

#chat-hints {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
  max-height: 120px;
  overflow-y: auto;
  overflow-x: hidden;
}

.hint-label {
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 1px;
  flex-shrink: 0;
}

#hint-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#hint-tags::-webkit-scrollbar {
  display: none;
}

.hint-tag {
  font-family: 'Press Start 2P', monospace;
  font-size: 5px;
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 3px 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.hint-tag:hover {
  color: rgba(255,255,255,0.9);
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.05);
}

#chat-input-area {
  display: none;
}

#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 12px 14px;
  outline: none;
}

#chat-input::placeholder {
  color: rgba(255,255,255,0.25);
}

#chat-send {
  background: transparent;
  border: none;
  border-left: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#chat-send:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.05);
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
}

.typing-indicator .dot {
  animation: typing-blink 1.2s ease-in-out infinite;
  font-size: 10px;
  opacity: 0.4;
}

.typing-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-blink {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 0.8; }
}

@media (max-width: 600px) {
  #chat-toggle {
    bottom: 16px;
    left: 12px;
    width: 28px;
    height: 28px;
    font-size: 12px;
    z-index: 200;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.6);
  }

  #chat-panel {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border: none;
    z-index: 200;
    overscroll-behavior: contain;
    background: #000000;
  }

  .chat-msg {
    font-size: 5px;
    max-width: 95%;
  }

  #chat-hints {
    padding: 8px 10px;
    max-height: 110px;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
    z-index: 10;
  }

  #hint-tags {
    gap: 4px;
  }

  .chat-table {
    font-size: 4px;
  }

  .hint-tag {
    font-size: 5px;
    padding: 4px 7px;
  }

  .hint-label {
    display: none;
  }
}
