:root {
  --xp-blue-1: #0058e6;
  --xp-blue-2: #3d95ff;
  --xp-blue-3: #2b73 e0;
  --xp-gray: #ece9d8;
  --xp-face: #f4f2e8;
  --term-green: #33ff33;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Tahoma", "Geneva", "IBM Plex Mono", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Bliss-inspired background: green hill under blue sky */
.page-bg {
  background:
    radial-gradient(circle at 70% 20%, rgba(255,255,255,0.35), transparent 40%),
    linear-gradient(to bottom, #4a8fdb 0%, #6fb3ec 35%, #8fce5e 58%, #5fa838 62%, #3f7d2a 100%);
  background-attachment: fixed;
}

/* ---- XP WINDOW ---- */
.xp-window {
  border: 1px solid #003ac7;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45);
  background: var(--xp-gray);
}

.xp-titlebar {
  background: linear-gradient(to bottom, #3d95ff 0%, #2b73e0 8%, #1a5fd6 40%, #0f52c9 88%, #2b73e0 100%);
  color: #fff;
  padding: 5px 6px 5px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
  border-radius: 7px 7px 0 0;
  font-weight: bold;
}

.xp-winbtn {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(to bottom, #4aa3ff, #1a5fd6);
  border: 1px solid #fff6;
  border-radius: 3px;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4);
}
.xp-winbtn:hover { filter: brightness(1.15); }
.xp-close { background: linear-gradient(to bottom, #ff7e6b, #d63a1e); }

.xp-body { background: var(--xp-gray); }

.xp-statusbar {
  background: var(--xp-gray);
  border-top: 1px solid #fff;
  box-shadow: inset 0 1px 0 #b5b1a0;
  padding: 3px 8px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #555;
}
.xp-statusbar span { border: 1px inset #c7c3b3; padding: 1px 6px; border-radius: 2px; background: #f0eee2; }

/* ---- XP BUTTONS ---- */
.xp-btn {
  font-family: "Tahoma", sans-serif;
  font-size: 13px;
  padding: 6px 14px;
  background: linear-gradient(to bottom, #fdfdfb 0%, #f0eee2 45%, #e2dfcf 55%, #ded9c6 100%);
  border: 1px solid #7a7561;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #fff, 0 1px 2px rgba(0,0,0,0.15);
  cursor: pointer;
  color: #1a1a1a;
  font-weight: 600;
  transition: filter 0.1s, transform 0.05s;
}
.xp-btn:hover:not(:disabled) { filter: brightness(1.04); border-color: #f0a000; }
.xp-btn:active:not(:disabled) { transform: translateY(1px); box-shadow: inset 0 2px 3px rgba(0,0,0,0.25); }
.xp-btn:disabled { opacity: 0.65; cursor: wait; }

.gen-btn {
  font-size: 16px !important;
  padding: 12px 16px !important;
  background: linear-gradient(to bottom, #a8e063 0%, #7bc043 45%, #5fa838 55%, #4f9330 100%) !important;
  color: #103200 !important;
  text-shadow: 0 1px 0 rgba(255,255,255,0.4);
  border-color: #3f7d2a !important;
}

/* ---- BANNER / TERMINAL ---- */
.banner-box {
  background: #050805;
  border: 2px inset #333;
  border-radius: 4px;
  padding: 8px 10px;
  overflow: hidden;
}
.banner-art {
  color: var(--term-green);
  font-family: "VT323", monospace;
  font-size: 18px;
  line-height: 1.1;
  margin: 0;
  text-shadow: 0 0 6px rgba(51,255,51,0.6);
  white-space: pre;
  overflow-x: auto;
}
.marquee-wrap { overflow: hidden; margin-top: 4px; border-top: 1px solid #113311; padding-top: 4px; }
.marquee {
  white-space: nowrap;
  color: #66ff66;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  animation: scroll-left 22s linear infinite;
}
@keyframes scroll-left {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

.crt-term {
  background: #030603;
  border: 2px inset #444;
  border-radius: 4px;
  padding: 10px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--term-green);
  max-height: 160px;
  overflow-y: auto;
  position: relative;
  text-shadow: 0 0 4px rgba(51,255,51,0.5);
}
.crt-term::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0px, rgba(0,0,0,0) 2px, rgba(0,0,0,0.15) 3px);
  pointer-events: none;
  border-radius: 4px;
}
.term-line { animation: type-in 0.25s ease-out; line-height: 1.5; }
.term-win { color: #ffe14d; font-weight: bold; text-shadow: 0 0 8px rgba(255,225,77,0.8); }
@keyframes type-in { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: none; } }
.term-cursor { color: var(--term-green); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---- KEY PANEL ---- */
.key-panel {
  background: #fffef8;
  border: 2px inset #b5b1a0;
  border-radius: 4px;
  padding: 12px;
}
.key-value {
  font-family: "IBM Plex Mono", monospace;
  font-size: clamp(16px, 5vw, 26px);
  font-weight: 600;
  letter-spacing: 2px;
  color: #0a3d91;
  background: #f4f6ff;
  border: 1px inset #99a;
  border-radius: 3px;
  padding: 8px 10px;
  text-align: center;
  word-break: break-all;
  animation: pop 0.35s cubic-bezier(0.2,1.4,0.5,1);
}
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.fake-badge {
  font-size: 10px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(to bottom, #e74c3c, #c0392b);
  padding: 4px 8px;
  border-radius: 3px;
  border: 1px solid #922;
  animation: pulse-red 1.6s ease-in-out infinite;
}
@keyframes pulse-red { 0%,100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); } 50% { box-shadow: 0 0 0 4px rgba(231,76,60,0); } }

/* ---- GENUINE ADVANTAGE METER ---- */
.ga-box {
  background: #fffef8;
  border: 1px solid #b5b1a0;
  border-radius: 4px;
  padding: 8px 10px;
}
.ga-track { height: 14px; background: #d8d5c5; border: 1px inset #a9a595; border-radius: 3px; overflow: hidden; }
.ga-fill {
  height: 100%;
  width: 100%;
  background: repeating-linear-gradient(45deg, #2ecc71 0, #2ecc71 10px, #27ae60 10px, #27ae60 20px);
  animation: stripe-move 1s linear infinite;
}
@keyframes stripe-move { from { background-position: 0 0; } to { background-position: 28px 0; } }

/* ---- EDUCATIONAL ---- */
.edu-toggle {
  width: 100%;
  text-align: left;
  background: #dfe8f5;
  border: 1px solid #9db4d0;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #1a3a6b;
  cursor: pointer;
}
.edu-toggle:hover { background: #d0e0f2; }
.edu-body {
  border: 1px solid #9db4d0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  padding: 12px;
  background: #f5f8fd;
}
.callout {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 3px;
  color: #222;
}
.callout-blue { background: #e6efff; border-left: 4px solid #2c6fd8; }
.callout-green { background: #e7f8ec; border-left: 4px solid #27ae60; }

.hex-box {
  background: #050805;
  color: #33ff88;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  padding: 8px;
  border-radius: 3px;
  border: 2px inset #333;
  overflow-x: auto;
  white-space: nowrap;
  line-height: 1.7;
}
.hex-label { color: #ffe14d; font-weight: bold; }

/* ---- HISTORY ---- */
.hist-box {
  background: #fffef8;
  border: 1px inset #b5b1a0;
  border-radius: 4px;
  padding: 8px 10px;
}
.hist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-bottom: 1px dashed #d8d5c5;
  font-size: 12px;
}
.hist-row:last-child { border-bottom: none; }
.hist-key { font-family: "IBM Plex Mono", monospace; color: #0a3d91; flex: 1; word-break: break-all; }
.hist-time { color: #888; font-size: 10px; flex-shrink: 0; }
.hist-copy { background: none; border: none; cursor: pointer; font-size: 13px; }
.hist-copy:hover { transform: scale(1.2); }

/* ---- TOAST ---- */
.toast {
  position: fixed;
  bottom: 20px; left: 50%;
  transform: translateX(-50%);
  background: #1a1a1a;
  color: var(--term-green);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid #33ff33;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 50;
  animation: toast-in 0.25s ease-out;
}
@keyframes toast-in { from { transform: translate(-50%, 20px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

.spin-hg { display: inline-block; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bitseg:hover { filter: brightness(1.1); }