:root {
  --bg: #050607;
  --bg-elevated: #0b0d0f;
  --bg-elevated-2: #101317;
  --bg-hover: #12161a;
  --text: #d7fbe8;
  --text-muted: #7aa28f;
  --accent: #19ff7a;
  --accent-soft: rgba(25, 255, 122, 0.15);
  --success: #19ff7a;
  --warning: #ffd166;
  --danger: #ff4d4d;
  --border: #1f2a24;
  --border-strong: #2e3d35;
  --focus-ring: #19ff7a;
  --scanline: rgba(255, 255, 255, 0.03);
}

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

body {
  font-family: "Share Tech Mono", ui-monospace, monospace;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
  line-height: 1.6;
}

/* CRT Effects */
.scanline-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    var(--scanline) 2px,
    var(--scanline) 4px
  );
  pointer-events: none;
  z-index: 9999;
  animation: scanMove 8s linear infinite;
}

@keyframes scanMove {
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(4px);
  }
}

.crt-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
  z-index: 9998;
}

/* Boot Sequence */
.boot-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  animation: bootFade 1.5s ease-out forwards;
}

@keyframes bootFade {
  0%,
  85% {
    opacity: 1;
    pointer-events: all;
  }
  100% {
    opacity: 0;
    pointer-events: none;
  }
}

.boot-text {
  color: var(--accent);
  font-size: 1.2rem;
  text-align: center;
}

/* Added progress bar container and fill animation */
.progress-container {
  width: 300px;
  height: 20px;
  border: 2px solid var(--accent);
  margin-top: 20px;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  animation: progressFill 1s ease-out forwards;
}

@keyframes progressFill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--bg);
  font-size: 0.9rem;
  font-weight: bold;
  mix-blend-mode: difference;
}

/* Main Container */
.terminal-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  animation: fadeInTerminal 1s ease-out 1.5s both;
}

@keyframes fadeInTerminal {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ASCII Border Frame */
.terminal-frame {
  border: 3px double var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 30px var(--accent-soft), inset 0 0 50px rgba(0, 0, 0, 0.8);
  position: relative;
  padding: 30px;
  margin: 20px 0;
}

.terminal-frame::before,
.terminal-frame::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid var(--accent);
}

.terminal-frame::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.terminal-frame::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

/* Header System */
.system-header {
  background: var(--bg-elevated-2);
  border: 2px solid var(--border-strong);
  padding: 20px;
  margin-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.system-header::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 2px;
  background: var(--accent);
  animation: loadBar 3s ease-out infinite;
}

@keyframes loadBar {
  0% {
    left: -100%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: 100%;
  }
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.sys-title {
  font-size: 2.5rem;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent), 0 0 30px var(--accent);
  letter-spacing: 8px;
  margin-bottom: 10px;
  animation: glitchTitle 5s infinite;
}

@keyframes glitchTitle {
  0%,
  90%,
  100% {
    transform: translate(0);
    text-shadow: 0 0 10px var(--accent), 0 0 20px var(--accent), 0 0 30px var(--accent);
  }
  91% {
    transform: translate(-3px, 2px);
    text-shadow: -3px 0 var(--danger), 3px 0 cyan;
  }
  92% {
    transform: translate(3px, -2px);
    text-shadow: 3px 0 var(--danger), -3px 0 cyan;
  }
  93% {
    transform: translate(-3px, 2px);
    text-shadow: -3px 0 var(--danger), 3px 0 cyan;
  }
}

.sys-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.sys-subtitle::before {
  content: ">> ";
  color: var(--accent);
}

/* Status Bar */
.status-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 15px;
  background: var(--bg-elevated);
  border-left: 4px solid var(--accent);
}

.status-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
}

.status-indicator {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.5;
    transform: scale(0.8);
  }
}

/* Terminal Window */
.terminal-window {
  background: var(--bg-elevated-2);
  border: 2px solid var(--border-strong);
  margin: 30px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.terminal-window:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 30px var(--accent-soft);
}

.terminal-header {
  background: var(--bg-elevated);
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.terminal-title {
  color: var(--warning);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.terminal-title::before {
  content: "[";
  color: var(--accent);
  margin-right: 5px;
}

.terminal-title::after {
  content: "]";
  color: var(--accent);
  margin-left: 5px;
}

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

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

.control-btn {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid var(--border);
}

.control-btn.close {
  background: var(--danger);
}
.control-btn.minimize {
  background: var(--warning);
}
.control-btn.maximize {
  background: var(--accent);
}

.terminal-content {
  padding: 25px;
  color: var(--text);
}

.terminal-content p {
  margin-bottom: 15px;
  line-height: 1.6;
}

/* Command Prompt Style */
.cmd-line {
  display: flex;
  align-items: flex-start;
  margin: 15px 0;
  gap: 10px;
}

.cmd-prompt {
  color: var(--accent);
  font-weight: bold;
  user-select: none;
}

.cmd-text {
  flex: 1;
  color: var(--text);
}

/* Feature List */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 15px;
  margin: 20px 0;
}

.feature-card {
  background: var(--bg-hover);
  border: 1px solid var(--border);
  padding: 15px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.feature-card:hover {
  background: var(--bg-elevated-2);
  border-color: var(--accent);
  transform: translateX(5px);
}

.feature-card:hover::before {
  transform: scaleY(1);
}

.feature-title {
  color: var(--accent);
  font-weight: bold;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.feature-title::before {
  content: "▸ ";
  color: var(--warning);
}

.feature-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Action Buttons */
.action-zone {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
  margin: 40px 0;
  padding: 30px;
  background: var(--bg-elevated-2);
  border: 2px dashed var(--border-strong);
  position: relative;
}

.action-zone::before {
  content: "<<<<";
  position: absolute;
  color: var(--accent);
  font-size: 1.5rem;
  animation: arrowSlide 1.5s ease-in-out infinite;
}
.action-zone::after {
  content: ">>>>";
  position: absolute;
  color: var(--accent);
  font-size: 1.5rem;
  animation: arrowSlide 1.5s ease-in-out infinite;
}

.action-zone::before {
  top: 50%;
  left: 10px;
  transform: translateY(-50%);
}

.action-zone::after {
  top: 50%;
  right: 10px;
  transform: translateY(-50%) rotate(180deg);
}

@keyframes arrowSlide {
  0%,
  100% {
    opacity: 0.3;
    transform: translateY(-50%) translateX(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-50%) translateX(5px);
  }
}

.cmd-button {
  display: inline-block;
  background: var(--bg-elevated);
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 18px 40px;
  font-family: "Share Tech Mono", monospace;
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 3px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
  box-shadow: 0 0 20px var(--accent-soft), inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.cmd-button::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
  transition: left 0.5s ease;
}

.cmd-button:hover::before {
  left: 100%;
}

.cmd-button:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 40px var(--accent), inset 0 0 40px rgba(0, 0, 0, 0.3);
  transform: scale(1.05);
  border-color: var(--text);
}

.cmd-button:active {
  transform: scale(0.98);
}

.cmd-button.primary {
  font-size: 1.4rem;
  padding: 22px 50px;
  animation: primaryPulse 2s infinite;
}

@keyframes primaryPulse {
  0%,
  100% {
    box-shadow: 0 0 20px var(--accent-soft), inset 0 0 20px rgba(0, 0, 0, 0.8);
  }
  50% {
    box-shadow: 0 0 40px var(--accent), inset 0 0 20px rgba(0, 0, 0, 0.8);
  }
}

.button-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 10px;
  font-style: italic;
}

.button-hint::before {
  content: "// ";
  color: var(--accent);
}

/* Link Styles */
.inline-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--accent);
  transition: all 0.3s ease;
}

.inline-link:hover {
  color: var(--text);
  border-bottom-style: solid;
  text-shadow: 0 0 10px var(--accent);
}

/* Info Box */
.info-box {
  background: var(--bg-elevated);
  border-left: 4px solid var(--warning);
  padding: 20px;
  margin: 25px 0;
  position: relative;
}

.info-box::before {
  content: "⚠";
  position: absolute;
  top: 50%;
  left: -20px;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--warning);
  background: var(--bg-elevated);
  padding: 5px;
}

.info-label {
  color: var(--warning);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 10px;
  letter-spacing: 2px;
}

.info-text {
  color: var(--text);
  line-height: 1.6;
}

/* Divider */
.divider {
  margin: 50px 0;
  position: relative;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.divider::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: dividerScan 3s ease-in-out infinite;
}

@keyframes dividerScan {
  0%,
  100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

.divider-symbol {
  background: var(--bg);
  padding: 0 20px;
  color: var(--accent);
  font-size: 1.2rem;
  z-index: 1;
}

/* Contact Section */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 20px;
  transition: all 0.3s ease;
}

.contact-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover);
  transform: translateY(-3px);
}

.contact-label {
  color: var(--warning);
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.contact-value {
  color: var(--text);
  word-break: break-all;
}

/* Footer */
.terminal-footer {
  margin-top: 60px;
  padding: 30px;
  background: var(--bg-elevated-2);
  border-top: 2px solid var(--border-strong);
  text-align: center;
}

.footer-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 15px;
  letter-spacing: 2px;
}

.footer-label::before,
.footer-label::after {
  content: "==";
  color: var(--accent);
  margin: 0 10px;
}

.author-section {
  background: var(--bg-elevated);
  padding: 25px;
  margin-top: 30px;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.author-prompt {
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 15px;
}

.author-text {
  color: var(--text);
  line-height: 1.7;
}

/* Responsive */
@media (max-width: 768px) {
  .terminal-container {
    padding: 10px;
  }
  .terminal-frame {
    padding: 15px;
  }

  .sys-title {
    font-size: 1.5rem;
    letter-spacing: 3px;
    word-break: keep-all;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .status-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 10px;
  }

  .status-item {
    font-size: 0.7rem;
    gap: 5px;
  }

  .terminal-title {
    font-size: 0.75rem;
    letter-spacing: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .cmd-button {
    padding: 15px 25px;
    font-size: 0.85rem;
    letter-spacing: 2px;
    white-space: nowrap;
  }

  .cmd-button.primary {
    font-size: 1rem;
    padding: 16px 30px;
    letter-spacing: 2px;
  }

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

  .action-zone::before,
  .action-zone::after {
    display: none;
  }

  .progress-container {
    width: 250px;
  }

  .boot-text {
    font-size: 1rem;
    padding: 0 20px;
  }
}

@media (max-width: 480px) {
  .sys-title {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }

  .status-bar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .cmd-button {
    padding: 12px 20px;
    font-size: 0.75rem;
    letter-spacing: 1px;
  }

  .cmd-button.primary {
    font-size: 0.9rem;
    padding: 14px 25px;
  }

  .progress-container {
    width: 200px;
  }

  .boot-text {
    font-size: 0.85rem;
  }
}

/* Special text highlighting */
.highlight-text {
  color: var(--accent);
  font-weight: bold;
}

em {
  color: var(--warning);
  font-style: italic;
}

strong {
  color: var(--accent);
  font-weight: bold;
}

/* Adding story selection page specific styles */

/* Story System Subtitle */
.story-system-subtitle {
  min-height: 1.5rem;
}

.story-system-subtitle .cursor {
  display: inline-block;
  width: 10px;
  height: 1em;
  background-color: var(--accent);
  animation: blink 1s infinite;
  vertical-align: bottom;
  margin-left: 2px;
}

/* Story List Container */
.story-list-container {
  margin-top: 30px;
}

/* Story Cards */
.story-card {
  cursor: pointer;
  padding: 0;
  background: var(--bg-elevated);
  margin-bottom: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 2px solid var(--border-strong);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.story-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent-soft);
  transition: left 0.4s ease;
  z-index: 0;
}

.story-card:hover::before {
  left: 0;
}

.story-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-soft);
  transform: translateX(5px);
}

.story-card-header {
  background: var(--bg-elevated-2);
  padding: 10px 20px;
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.story-indicator {
  width: 10px;
  height: 10px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2s infinite;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: 15px;
}

.story-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  letter-spacing: 1px;
}

.story-plays {
    color: var(--warning);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
}

.story-lan {
  font-size: 1.2rem;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.story-card-content {
  padding: 25px;
  position: relative;
  z-index: 1;
}

.story-title {
  font-weight: bold;
  color: var(--warning);
  font-size: 1.4rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 15px;
  text-shadow: 0 0 10px rgba(255, 209, 102, 0.4);
}

.story-title::before {
  content: "▸ ";
  color: var(--accent);
  margin-right: 8px;
}

.story-desc {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.9;
}

.story-author {
  text-align: right;
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-muted);
  margin-top: 20px;
}

/* Story Selection Instruction */
.story-selection-instruction {
  margin-top: 30px;
  padding: 20px;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  text-align: center;
  color: var(--accent);
  font-weight: bold;
  letter-spacing: 2px;
  box-shadow: 0 0 20px var(--accent-soft);
  animation: primaryPulse 2s infinite;
}

/* Responsive adjustments for story cards */
@media (max-width: 768px) {
  .story-title {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }

  .story-card-content {
    padding: 15px;
  }

  .story-desc {
    font-size: 0.85rem;
  }

  .story-selection-instruction {
    font-size: 0.85rem;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .story-title {
    font-size: 1rem;
  }

  .story-card-content {
    padding: 12px;
  }
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 15px;
  background: var(--bg-elevated);
  padding: 15px;
  border: 1px solid var(--border-strong);
  margin-bottom: 20px;
  align-items: center;
  flex-wrap: wrap;
  animation: fadeInTerminal 0.5s ease-out 1s both;
}

.filter-input {
  flex: 2;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 15px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  text-transform: uppercase;
}

.filter-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 10px var(--accent-soft);
}

.filter-select {
  flex: 1;
  min-width: 150px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 15px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  text-transform: uppercase;
  cursor: pointer;
}

.filter-select:focus {
  border-color: var(--accent);
  outline: none;
}

/* Adding CSS for dynamically injected story elements */

/* Story List - Dynamic Container */
.story-list {
  display: block;
  margin: 20px 0;
}

/* Story Item - Individual Story in List */
.story-item {
  cursor: pointer;
  padding: 20px;
  background: var(--bg-elevated);
  margin-bottom: 15px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border: 2px solid var(--border-strong);
  overflow: hidden;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.story-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent-soft);
  transition: left 0.4s ease;
  z-index: 0;
}

.story-item:hover::before {
  left: 0;
}

.story-item:hover {
  border-color: var(--accent);
  box-shadow: 0 0 40px var(--accent-soft);
  transform: translateX(5px);
}

.story-item .story-title {
  position: relative;
  z-index: 1;
}

.story-item .story-desc {
  position: relative;
  z-index: 1;
}

/* Selection Instruction */
.selection-instruction {
  margin-top: 30px;
  padding: 20px;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  text-align: center;
  color: var(--accent);
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  box-shadow: 0 0 20px var(--accent-soft);
  animation: primaryPulse 2s infinite;
}

/* Responsive for dynamically injected story elements */
@media (max-width: 768px) {
  .story-item {
    padding: 15px;
  }

  .story-item .story-title {
    font-size: 1.2rem;
    letter-spacing: 1px;
  }

  .story-item .story-desc {
    font-size: 0.85rem;
  }

  .selection-instruction {
    font-size: 0.85rem;
    padding: 15px;
    letter-spacing: 1px;
  }
}

@media (max-width: 480px) {
  .story-item {
    padding: 12px;
  }

  .story-item .story-title {
    font-size: 1rem;
  }

  .selection-instruction {
    font-size: 0.75rem;
    padding: 12px;
  }
}

/* --- Game Interface Styles (Merged from style.css) --- */

.game-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

.game-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    margin: 0 auto;
    box-sizing: border-box;
    z-index: 2;
    position: relative;
    overflow: hidden; /* contain output */
}

.output-area {
    flex-grow: 1;
    overflow-y: auto;
    white-space: pre-wrap;
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.5;
    padding-right: 10px;
    color: var(--text);
}

.output-area::-webkit-scrollbar {
    width: 8px;
}

.output-area::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 2px;
}

.output-area::-webkit-scrollbar-track {
    background: var(--bg-elevated);
}

.input-area {
    display: flex;
    align-items: center;
    border-top: 1px solid var(--accent);
    padding-top: 15px;
    padding-bottom: 10px;
}

.prompt {
    margin-right: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent);
}

/* Target specifically the game input if possible, or generic */
input[type="text"] {
    background: transparent;
    border: none;
    color: var(--accent);
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.1rem;
    flex-grow: 1;
    outline: none;
    text-shadow: 0 0 2px var(--accent);
}

/* Log Entry Types */
.log-entry.story {
    margin-bottom: 20px;
    color: var(--text);
}

.log-entry.user {
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 10px;
}

.log-entry.error {
    color: var(--danger);
    text-shadow: 0 0 3px var(--danger);
}

.log-entry.system {
    color: #33ffff;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

/* Install Button */
.install-btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    padding: 5px 10px;
    cursor: pointer;
    margin-top: 10px;
    align-self: flex-end;
    text-shadow: 0 0 2px var(--accent);
}

.install-btn:hover {
    background: var(--accent-soft);
    box-shadow: 0 0 5px var(--accent);
}

/* Status Bar in Game Header */
.game-status-bar {
    font-size: 0.8rem;
    color: #33ffff;
    white-space: nowrap;
}

/* Transmission Tag */
.transmission-tag {
    color: var(--text-muted);
    font-size: 0.6rem;
    margin-left: 10px;
    opacity: 0.8;
    display: inline-block;
    font-family: 'Share Tech Mono', monospace;
    text-shadow: none;
}

/* Challenge Button */
.challenge-btn {
    display: inline-block;
    margin-left: 10px;
    cursor: pointer;
    color: var(--warning);
    font-weight: bold;
    text-shadow: 0 0 5px var(--warning);
    transition: all 0.2s;
}

.challenge-btn:hover {
    color: var(--danger);
    text-shadow: 0 0 5px var(--danger);
    transform: scale(1.1);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.modal-content {
    background: var(--bg);
    border: 2px solid var(--accent);
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 20px var(--accent-soft);
    font-family: 'Share Tech Mono', monospace;
    color: var(--text);
}

.modal-header {
    font-size: 1.2rem;
    border-bottom: 1px solid var(--accent);
    padding-bottom: 10px;
    margin-bottom: 15px;
    text-align: center;
    color: #33ffff;
}

.intent-option {
    padding: 10px;
    margin-bottom: 5px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text);
}

.intent-option:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.modal-close {
    margin-top: 15px;
    text-align: center;
    cursor: pointer;
    color: var(--danger);
}

/* Minimal Header */
.minimal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border-strong);
    background: var(--bg-elevated);
    z-index: 20;
    position: relative;
    height: 60px;
    flex-shrink: 0;
}

.back-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    display: flex;
    align-items: center;
}
.back-link:hover {
    text-shadow: 0 0 5px var(--accent);
    text-decoration: underline;
}

.engine-link {
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 2px;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
}
.engine-link:hover {
    color: var(--accent);
    text-shadow: 0 0 8px var(--accent-soft);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cat-icon {
    font-size: 0.7rem;
    white-space: pre;
    color: var(--accent);
    line-height: 1.1;
    font-weight: bold;
    text-align: center;
    cursor: default;
}

.cat-eyes {
    animation: blinkCat 5s infinite;
}

@keyframes blinkCat {
    0%, 96%, 100% { opacity: 1; }
    98% { opacity: 0; }
}

.lock-icon-container {
    display: inline-flex;
    color: #ffcc00; /* Gold/Yellow */
    cursor: help;
    position: relative;
}

.lock-icon-container:hover svg {
    color: #ff3333; /* Red on hover */
}

@media (max-width: 600px) {
    .minimal-header {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    .engine-link {
        font-size: 1rem;
        display: none; /* Hide title on very small screens if crowded, or just shrink */
    }
    .game-container {
        padding: 10px;
    }
    .output-area {
        font-size: 1rem;
    }
}
/* Latency Counter */
.latency-counter {
    text-align: right;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-muted);
    min-height: 1.2em; /* Prevent layout jump */
    margin-bottom: 2px;
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    z-index: 100;
}

.hero-content {
    z-index: 2;
    padding: 20px;
    max-width: 800px;
}

.main-title {
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 1rem;
    color: #cccccc;
    text-shadow: none;
    font-weight: normal;
    transition: opacity 1s ease-in-out;
    margin: 0;
    min-height: auto;
    text-align: left;
}

.hero-dialogue {
    font-size: 1.8rem;
    color: var(--text);
    margin-bottom: 40px;
    min-height: 200px; /* Reserve space */
}

.hero-dialogue .user-line {
    color: var(--text-muted);
    font-style: italic;
}

.hero-dialogue .game-line {
    color: var(--text);
}

.hero-question {
    font-size: 2.5rem;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent);
    margin-bottom: 30px;
    font-weight: bold;
    transition: opacity 0.5s ease-in;
}

#hero-cta {
    transition: opacity 0.5s ease-in 0.5s;
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: opacity 0.5s ease-in 1s;
}

.scroll-indicator span {
    width: 2px;
    height: 40px;
    background: var(--text-muted);
    position: relative;
    overflow: hidden;
}

.scroll-indicator span::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--accent);
    animation: scroll-down 2s ease-in-out infinite;
}

@keyframes scroll-down {
    0% { top: -100%; }
    50%, 100% { top: 100%; }
}

/* Parallax Background Effect */
body {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    background-image: url('https://www.transparenttextures.com/patterns/stardust.png');
}

/* --- Subtitle and Info Button on Play Page --- */
.subtitle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    color: var(--text-muted);
    margin: 10px 0 20px;
    font-size: 1.1rem;
}

.info-button {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.info-button:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.1);
    text-shadow: 0 0 5px var(--accent);
}

@media (max-width: 768px) {
    .hero-dialogue {
        font-size: 1.4rem;
        min-height: 150px;
    }
    .hero-question {
        font-size: 2rem;
    }
}

/* --- New Button Styles --- */
.hero-cta-container {
    display: flex;
    gap: 20px;
    justify-content: center;
    transition: opacity 0.5s ease-in 0.5s;
}

.cmd-button.button-fight {
    --button-color: #FFFFFF;
    border-color: var(--button-color);
    color: var(--button-color);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.cmd-button.button-fight:hover {
    background: var(--button-color);
    color: var(--bg);
    box-shadow: 0 0 40px var(--button-color), inset 0 0 40px rgba(0, 0, 0, 0.3);
}

.cmd-button.button-run {
    --button-color: var(--danger);
    border-color: var(--button-color);
    color: var(--button-color);
    box-shadow: 0 0 20px rgba(255, 77, 77, 0.4), inset 0 0 20px rgba(0, 0, 0, 0.8);
}
.cmd-button.button-run:hover {
    background: var(--button-color);
    color: var(--bg);
    box-shadow: 0 0 40px var(--button-color), inset 0 0 40px rgba(0, 0, 0, 0.3);
}
