/* =============================================
   FONT IMPORTS
   ============================================= */
@font-face {
  font-family: 'AncientGlyphs';
  src: url('https://static1.squarespace.com/static/69b8f0b5cf8c65213f8ec297/t/69ba2a8143749e2059cf3db5/1773808257754/Ancient+Language.ttf') format('truetype');
}

.vt323-regular {
  font-family: 'VT323', monospace;
  font-weight: 400;
  font-style: normal;
}

.copyright-section {
  text-transform: uppercase;
}

/* =============================================
   RESET & BASE
   ============================================= */
html, body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* =============================================
   CUSTOM RETRO CURSORS
   ============================================= */
body, html, * {
  cursor: none !important;
}

.custom-cursor {
  width: 24px;
  height: 24px;
  background-repeat: no-repeat;
  background-size: contain;
  animation: jitter 0.15s infinite step-end;
}
.custom-cursor.default {
  background-image: url('../assets/cursor.svg');
}
.custom-cursor.pointer {
  background-image: url('../assets/cursor-pointer.svg');
}

body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

/* =============================================
   TERMINAL CONTAINER
   ============================================= */
#terminal-container {
  background: #060503;
  color: #00bfff;
  padding: 2vw;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  font-size: 20px;
  position: relative;
  overflow: hidden;
  border-radius: 0;
  box-shadow: inset 0 0 80px #000;
  line-height: 1.3;
  user-select: none;
  -webkit-user-select: none;
  cursor: crosshair;
  text-shadow: none;
}

/* Shared text-shadow glow for key elements */
.room,
#telemetry-box,
.signal-box,
.character-slot,
#boot-wait {
  text-shadow: none;
}

/* =============================================
   CRT SCANLINE OVERLAY
   ============================================= */
#crt-scanlines {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 191, 255, 0.03) 0px,
    rgba(0, 191, 255, 0.03) 1px,
    transparent 1px,
    transparent 3px
  );
}

/* =============================================
   AUDIO INDICATOR
   ============================================= */
#audio-indicator {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 14px;
  color: rgba(0, 191, 255, 0.4);
  z-index: 100;
  cursor: pointer;
}

#audio-indicator:hover {
  color: #00bfff;
}

#session-indicator {
  position: absolute;
  top: 10px;
  right: 80px;
  font-size: 14px;
  color: rgba(0, 191, 255, 0.4);
  z-index: 100;
  cursor: pointer;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

#session-indicator:hover {
  color: #00bfff;
}

/* =============================================
   SIGNAL SCREEN
   ============================================= */
.signal-box {
  display: inline-block;
  border: 2px solid #00bfff;
  padding: 8px 40px;
  font-size: 26px;
}

.connecting-text {
  font-size: 22px;
}

.signal-footer {
  position: absolute;
  bottom: 35px;
  right: 35px;
}

.copyright-section {
  text-align: right;
  font-size: 14px;
  opacity: 0.7;
}

/* =============================================
   FACILITY MAP
   ============================================= */
#facility-map {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

/* =============================================
   MAP GRID
   ============================================= */
.map-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr 1fr;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 15px;
  flex-grow: 1;
  min-height: 0;
  min-width: 0;
  margin-bottom: 25px;
  padding-top: 20px;
}

/* =============================================
   ROOMS
   ============================================= */
.room {
  border: 2px solid #00bfff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  font-size: 23px;
  background: rgba(0, 191, 255, 0.03);
  transition: all 0.2s ease;
  cursor: pointer;
}





/* Room grid positions */
.room.archives {
  grid-column: 1;
  grid-row: 1;
  border-width: 3px;
}

.room.core {
  grid-column: 3;
  grid-row: 1 / span 2;
}

.room.vault {
  grid-column: 3;
  grid-row: 3;
  border-style: dashed;
}

/* =============================================
   COMMS CONTAINER
   ============================================= */
.comms-container {
  grid-column: 1;
  grid-row: 2 / span 2;
  border: 2px solid #00bfff;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  padding: 10px;
}

#comms-output {
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* =============================================
   CHARACTER SLOT (Central Display)
   ============================================= */
.character-slot {
  grid-column: 2;
  grid-row: 1 / span 3;
  border: 1px solid rgba(0, 191, 255, 0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* =============================================
   TERMINAL INPUTS
   ============================================= */
.terminal-input {
  background: transparent;
  border: 1px solid #00bfff;
  color: #00bfff;
  font-family: 'VT323', monospace;
  font-size: 22px;
  outline: none;
  caret-color: #00bfff;
}

.terminal-input:focus {
  box-shadow: none;
}

.terminal-input:hover {
  border-color: #00bfff;
}

.terminal-input::placeholder {
  color: rgba(0, 191, 255, 0.3);
}

/* =============================================
   TERMINAL IMAGES
   ============================================= */
.terminal-img {
  object-fit: contain;
  opacity: 0.85;
  filter:
    contrast(1.1)
    brightness(0.95);
}

/* =============================================
   PRIZE ITEMS
   ============================================= */
.prize-item {
  display: block;
  transition: all 0.2s ease;
  cursor: pointer;
}

.prize-item:hover {
  transform: scale(1.15);
  z-index: 10;
  box-shadow: none;
}

/* =============================================
   DERBY BUTTONS (Purchase Options)
   ============================================= */
.derby-btn {
  border: 2px solid #00bfff;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  font-size: 22px;
  font-weight: normal;
  text-shadow: none;
  padding: 10px 15px;
  cursor: pointer;
  background: rgba(0, 191, 255, 0.05);
  color: #00bfff;
  transition: all 0.2s ease;
}

.derby-btn:hover:not([disabled]):not([style*="not-allowed"]) {
  background: rgba(0, 191, 255, 0.15);
  box-shadow: none;
  transform: scale(1.02);
}

.bundle-featured {
  animation: bundleFeaturedFlash 3s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}

/* =============================================
   GATE SUBMIT BUTTON
   ============================================= */
#gate-submit {
  transition: all 0.2s ease;
  cursor: pointer;
}

#gate-submit:hover {
  background: #00bfff;
  color: #000;
}

/* =============================================
   PRIZE DETAIL MODAL
   ============================================= */
.modal-content {
  border: 2px solid #00bfff;
  padding: 30px;
  background: #000;
  text-align: center;
  max-width: 95%;
  width: 750px;
  box-shadow: none;
}

#prize-modal-buy:hover {
  opacity: 0.85;
}

#prize-modal-close:hover {
  color: #00bfff;
}

/* =============================================
   TELEMETRY BAR
   ============================================= */
#telemetry-box {
  border-top: 2px solid #00bfff;
  padding-top: 15px;
  font-size: 20px;
  min-height: 60px;
}

/* =============================================
   INIT / BOOT WRAPPER
   ============================================= */
#init-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 5, 3, 0.98);
  z-index: 150;
  border-radius: 15px;
}

/* Boot sequence elements */
#boot-wait {
  position: absolute;
  top: 35px;
  left: 35px;
  font-family: 'AncientGlyphs', monospace;
  font-size: 16px;
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 0.5s;
}

#boot-localize {
  position: absolute;
  top: 65px;
  left: 35px;
  font-family: 'VT323', monospace;
  font-size: 20px;
  opacity: 0;
  animation: snapVisible 0.1s step-end forwards;
  animation-delay: 1.2s;
}

#wake-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 23px;
  display: none;
  z-index: 200;
  cursor: pointer;
  color: #00bfff;
  border: none;
  background: transparent;
}

#wake-btn:hover {
  background: #00bfff;
  color: #000;
  text-shadow: none;
}

/* =============================================
   MOBILE BACK BUTTON
   ============================================= */
#mobile-back-btn {
  display: none;
  border: 1px dashed rgba(0, 191, 255, 0.5);
  padding: 8px 15px;
  font-size: 18px;
  color: rgba(0, 191, 255, 0.7);
  cursor: pointer;
  text-align: center;
  margin-bottom: 10px;
  transition: all 0.2s ease;
}

#mobile-back-btn:hover {
  color: #00bfff;
  border-color: #00bfff;
}

/* =============================================
   ANSI REVEAL MATRIX
   ============================================= */
#ansi-reveal-matrix {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
  z-index: 500;
  display: none;
}

/* =============================================
   UTILITY CLASSES
   ============================================= */
.vt-subtle-flash {
  animation: phosphorPing 0.3s ease-out forwards;
}

.archive-file-btn {
  cursor: pointer;
  transition: all 0.2s ease;
}

.archive-file-btn:hover {
  background: rgba(0, 191, 255, 0.1);
  text-shadow: none;
}

/* Scrollbar hiding */
#comms-output::-webkit-scrollbar,
#archive-output::-webkit-scrollbar {
  display: none;
}

#comms-output,
#archive-output,
.archive-output {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* =============================================
   ARCHIVE BROWSER
   ============================================= */
.archive-browser {
  flex-direction: column;
  width: 100%;
  height: 100%;
  text-align: left;
  padding: 25px;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 0;
}

.archive-output {
  color: #00bfff;
  text-shadow: none;
  font-size: 20px;
  line-height: 1.4;
  overflow-y: auto;
  overflow-x: auto;
  flex-grow: 1;
  min-height: 0;
  margin-bottom: 15px;
  padding-right: 10px;
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: pre;
  word-break: keep-all;
}

.archive-output::-webkit-scrollbar {
  display: none;
}

/* =============================================
   CRT GLASS OVERLAY
   ============================================= */
#crt-glass {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
  background: radial-gradient(circle, rgba(0,0,0,0) 60%, rgba(0,0,0,0.6) 100%);
  box-shadow: inset 0 0 100px rgba(0,0,0,0.9);
}

.auth-hidden {
  opacity: 0.3;
  cursor: not-allowed;
  position: relative;
}

.auth-hidden:hover {
  opacity: 0.5;
}

/* Lock icon centered inside the folder body */
.auth-hidden .folder-icon::after {
  content: '🔒';
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

/* On hover, keep the same highlight as other folders but swap text */
.auth-hidden:hover .folder-name {
  background: #00bfff;
  color: transparent;
  text-shadow: none;
}

.auth-hidden:hover .folder-name::after {
  content: 'LOCKED';
  color: #000;
  position: absolute;
  left: 4px;
}

/* Custom Terminal Scrollbar */
::-webkit-scrollbar { width: 10px; background: rgba(0,0,0,0.8); border-left: 1px solid rgba(0,191,255,0.2); }
::-webkit-scrollbar-thumb { background: #00bfff; border: 1px solid #000; }
::-webkit-scrollbar-thumb:hover { background: #00bfff; }
::-webkit-scrollbar-corner { background: rgba(0,0,0,0.8); }
