/* ===== Gavin-OS boot screen (Helldivers-style terminal) ===== */

html, body {
  margin: 0;
  padding: 0;
  background: #0a0a08;
}

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

::selection {
  background: var(--acc);
  color: #0a0a08;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ----- color theme + CRT intensity settings ----- */
/* These variables control the glow color and the "old TV screen" effect. */
.hd-root {
  --acc: #ffe606;
  --acc-deep: #c99f00;
  --line: rgba(255, 230, 6, 0.42);
  --acc-amb: rgba(255, 230, 6, 0.05);
  --ink: #0a0a08;
  --panel: #12110a;
  --scan-op: 0.18;
  --vig: 0.58;
  --flick-lo: 0.928;

  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--acc);
  font-family: 'Saira', system-ui, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 20px;
}

/* ----- animations ----- */
@keyframes hd-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: .15; } }
@keyframes hd-dot { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes hd-spin { to { transform: rotate(360deg); } }
@keyframes hd-flick {
  0%, 100% { opacity: var(--flick-lo); }
  6% { opacity: 1; }
  8% { opacity: .9; }
  54% { opacity: 1; }
  56% { opacity: .95; }
}
@keyframes hd-dead {
  0%, 100% { opacity: .14; }
  44% { opacity: .14; }
  46% { opacity: .6; }
  48% { opacity: .1; }
  84% { opacity: .45; }
  86% { opacity: .12; }
}
@keyframes hd-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}

/* ===== BOOT PHASE ===== */
.hd-boot {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: 700px;
  cursor: pointer;
  animation: hd-in .25s ease both;
}

.hd-emblem-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.hd-emblem {
  position: relative;
  width: 44px;
  height: 44px;
  flex: none;
  animation: hd-spin 9s linear infinite;
}
.hd-emblem-outer {
  position: absolute;
  inset: 0;
  transform: rotate(45deg);
  border: 3px solid var(--acc);
}
.hd-emblem-inner {
  position: absolute;
  inset: 11px;
  transform: rotate(45deg);
  background: var(--acc);
}

.hd-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--acc);
}

.hd-subtitle {
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--acc-deep);
  text-transform: uppercase;
  margin-top: 3px;
}

.hd-hazard {
  height: 9px;
  margin-bottom: 18px;
  background: repeating-linear-gradient(-45deg, var(--acc) 0 13px, #0a0a08 13px 26px);
}

.hd-lines {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.85;
  letter-spacing: .8px;
  text-transform: uppercase;
}

.hd-lines div {
  white-space: pre-wrap;
  color: var(--acc);
}

.hd-cursor {
  display: inline-block;
  width: .55em;
  height: 1em;
  vertical-align: -1px;
  background: var(--acc);
  animation: hd-blink 1s steps(1) infinite;
}

.hd-skip {
  margin-top: 30px;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--acc-deep);
  text-transform: uppercase;
  animation: hd-blink 1.4s steps(1) infinite;
}

/* ===== MENU PHASE ===== */
.hd-menu {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: 680px;
  animation: hd-in .38s ease both;
}

.hd-menu .hd-hazard {
  height: 10px;
  margin-bottom: 0;
}

.hd-header {
  position: relative;
  background: var(--panel);
  border: 2px solid var(--acc);
  border-top: none;
  padding: 20px 22px 18px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.hd-crest {
  position: absolute;
  top: 52px;
  right: 20px;
  width: 92px;
  height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hd-crest-ring-outer {
  position: absolute;
  inset: 0;
  border: 2px solid var(--acc);
  border-radius: 50%;
}
.hd-crest-ring-inner {
  position: absolute;
  inset: 8px;
  border: 1px solid var(--acc-deep);
  border-radius: 50%;
}
.hd-crest-diamond {
  position: absolute;
  inset: 22px;
  transform: rotate(45deg);
  border: 2px solid var(--acc);
}
.hd-crest-number {
  position: relative;
  z-index: 1;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  color: var(--acc);
  text-shadow: 0 0 12px var(--acc-amb);
}
.hd-crest-tag {
  position: absolute;
  bottom: -3px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel);
  padding: 0 4px;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--acc-deep);
  white-space: nowrap;
}

.hd-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--acc-deep);
  text-transform: uppercase;
}

.hd-name {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 10vw, 66px);
  line-height: .92;
  letter-spacing: 1px;
  margin: 8px 0 6px;
  color: var(--acc);
  text-transform: uppercase;
}

.hd-console-tag {
  display: inline-block;
  background: var(--acc);
  color: var(--ink);
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 3px 10px;
  text-transform: uppercase;
}

.hd-select-label {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--acc-deep);
  margin: 18px 2px 10px;
  text-transform: uppercase;
}

.hd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 9px;
}

.hd-item {
  display: flex;
  align-items: center;
  gap: 13px;
  background: var(--panel);
  border: 2px solid var(--line);
  color: var(--acc);
  padding: 12px 14px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  transition: background .12s, color .12s, border-color .12s, transform .12s;
}
.hd-item:hover,
.hd-item:focus-visible {
  background: var(--acc);
  color: var(--ink);
  border-color: var(--acc);
  outline: none;
}
.hd-item:hover {
  transform: translateX(3px);
}

.hd-item-num {
  flex: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid currentColor;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 14px;
}

.hd-item-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hd-item-label {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.hd-item-sub {
  font-size: 10.5px;
  letter-spacing: 1.5px;
  opacity: .72;
  text-transform: uppercase;
}

.hd-item-arrow {
  flex: none;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 15px;
}

/* "67" flavor tile that fills the last grid cell */
.hd-flavor-tile {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 10px 14px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.hd-flavor-number {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 46px;
  line-height: .85;
  color: var(--acc);
  text-shadow: 0 0 14px var(--acc-amb);
}

.hd-flavor-body {
  flex: 1;
  min-width: 0;
}

.hd-flavor-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--acc-deep);
  text-transform: uppercase;
}

.hd-flavor-bars {
  display: flex;
  gap: 3px;
  margin-top: 6px;
}
.hd-flavor-bars span {
  flex: 1;
  height: 8px;
  background: var(--acc);
}
.hd-flavor-bars span.hd-bar-off {
  background: var(--acc-deep);
  opacity: .35;
}

.hd-flavor-note {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 600;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--acc-deep);
  text-transform: uppercase;
  margin-top: 6px;
}

.hd-detail-strip {
  margin-top: 18px;
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 11px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--acc-deep);
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.hd-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--acc);
}

.hd-dot {
  width: 8px;
  height: 8px;
  background: var(--acc);
  animation: hd-dot 2.2s ease-in-out infinite;
}

.hd-replay {
  cursor: pointer;
  color: var(--acc);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ===== screen effects (scanlines, vignette, glow) ===== */
.hd-scanlines {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, 0) 0px, rgba(0, 0, 0, 0) 2px, rgba(0, 0, 0, .55) 3px);
  opacity: var(--scan-op);
  mix-blend-mode: multiply;
}

.hd-vignette {
  position: fixed;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, var(--vig)), inset 0 0 60px rgba(0, 0, 0, .4);
  animation: hd-flick 5.5s linear infinite;
}

.hd-ambient {
  position: fixed;
  inset: 0;
  z-index: 19;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, var(--acc-amb), transparent 62%);
}

/* ===== Inner pages (Operator File, etc.) ===== */
.hd-page {
  position: relative;
  z-index: 6;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  animation: hd-in .3s ease both;
}

.hd-panel {
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 18px 20px;
  margin-top: 14px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%);
}

.hd-panel-label {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--acc-deep);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.hd-panel-sublabel {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2.5px;
  color: var(--acc-deep);
  text-transform: uppercase;
  margin: 16px 0 8px;
}
.hd-panel-sublabel:first-of-type {
  margin-top: 0;
}

.hd-bio-text {
  font-size: 14px;
  line-height: 1.7;
  color: var(--acc);
  opacity: .85;
}

.hd-bio-text.hd-placeholder {
  font-style: italic;
  opacity: .55;
}

.hd-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.hd-stat-row:last-child { border-bottom: none; }

.hd-stat-key { color: var(--acc-deep); }
.hd-stat-val { color: var(--acc); opacity: .85; }

.hd-photo-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--acc-deep);
  text-transform: uppercase;
  padding: 20px;
}

.hd-photo {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 2px solid var(--line);
}

.hd-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--acc-deep);
  text-transform: uppercase;
  transition: color .12s;
}
.hd-back-link:hover,
.hd-back-link:focus-visible {
  color: var(--acc);
}

/* ----- simple inner-page header (used by pages that aren't the operator dossier) ----- */
.hd-page-header {
  background: var(--panel);
  border: 2px solid var(--acc);
  border-top: none;
  padding: 18px 22px 16px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 18px 100%, 0 calc(100% - 18px));
}

.hd-page-eyebrow {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--acc-deep);
  text-transform: uppercase;
}

.hd-page-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(32px, 8vw, 48px);
  line-height: .95;
  letter-spacing: 1px;
  margin: 6px 0 4px;
  color: var(--acc);
  text-transform: uppercase;
}

.hd-page-sub {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--acc-deep);
  text-transform: uppercase;
}

/* ----- gallery grid of photo tiles ----- */
.hd-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.hd-gallery-tile {
  aspect-ratio: 1 / 1;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--acc-deep);
  text-transform: uppercase;
  padding: 10px;
}

.hd-gallery-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

/* ----- lightbox: fullscreen view when a gallery photo is clicked ----- */
.hd-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 10, 8, .92);
  padding: 40px;
  cursor: zoom-out;
  animation: hd-in .15s ease both;
}

.hd-lightbox[hidden] {
  display: none;
}

.hd-lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border: 2px solid var(--acc);
  box-shadow: 0 0 40px var(--acc-amb);
}

.hd-67-popup-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
}

.hd-67-popup-caption {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 6vw, 40px);
  letter-spacing: 3px;
  color: var(--acc);
  text-shadow: 0 0 14px var(--acc-amb);
  text-align: center;
}

.hd-lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 51;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--acc);
  cursor: pointer;
  background: var(--panel);
  border: 2px solid var(--acc);
  padding: 6px 12px;
}

/* ----- ranked list (Cartridge Rack top games, etc.) ----- */
.hd-rank-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.hd-rank-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel);
  border: 2px solid var(--line);
  padding: 12px 14px;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}

.hd-rank-num {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--acc);
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: var(--acc);
}

.hd-rank-thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border: 2px dashed var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 1px;
  color: var(--acc-deep);
  text-transform: uppercase;
  padding: 4px;
}

.hd-rank-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hd-rank-body {
  flex: 1;
  min-width: 0;
}

.hd-rank-title {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--acc);
}

.hd-rank-review {
  font-size: 13px;
  line-height: 1.5;
  color: var(--acc);
  opacity: .8;
  margin-top: 3px;
}

/* ----- System Frequency: 67 page (photo background) ----- */
.hd-root-freq {
  background-image: url('images/67_kid.jpg');
  background-size: cover;
  background-position: center;
}

.hd-freq-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: rgba(10, 10, 8, .6);
}

.hd-freq-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.hd-freq-num {
  font-family: 'Saira Condensed', sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--acc);
  text-shadow: 0 0 10px var(--acc-amb);
  padding: 2px 7px;
  border: 1px solid var(--line);
}

/* Hidden "dead pixel" easter egg, bottom-right corner */
.hd-vault {
  position: fixed;
  right: 11px;
  bottom: 10px;
  z-index: 30;
  width: 9px;
  height: 9px;
  background: var(--acc-deep);
  animation: hd-dead 6.5s ease-in-out infinite;
  transition: transform .18s, box-shadow .18s, opacity .18s;
}
.hd-vault:hover {
  opacity: 1;
  transform: scale(1.9) rotate(45deg);
  box-shadow: 0 0 14px var(--acc);
}
