/* CyberSafe Treasure Hunt Lab
   Static workshop CTF styles.
   Safe, toy-only, defensive learning.
*/

:root {
  --bg: #050c17;
  --panel: rgba(10, 24, 42, 0.9);
  --panel-strong: rgba(12, 31, 54, 0.98);
  --text: #edf7ff;
  --muted: #a7bbce;
  --line: rgba(140, 210, 255, 0.22);
  --accent: #6ee7ff;
  --accent-2: #9dffb0;
  --danger: #ff8f8f;
  --warning: #ffd166;
  --shadow: 0 24px 100px rgba(0, 0, 0, 0.48);
  --radius: 28px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 20% 15%, rgba(110, 231, 255, 0.16), transparent 30%),
    radial-gradient(circle at 78% 18%, rgba(157, 255, 176, 0.11), transparent 28%),
    radial-gradient(circle at 50% 92%, rgba(135, 95, 255, 0.14), transparent 30%),
    linear-gradient(135deg, #030816, #07192c 50%, #020712);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input {
  font: inherit;
}

.entry-shell,
.lab-shell {
  min-height: 100vh;
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 72px 0;
}

.entry-card,
.lab-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.entry-card {
  max-width: 640px;
  text-align: center;
  padding: clamp(28px, 5vw, 58px);
}

.lab-card {
  padding: clamp(26px, 4vw, 52px);
}

.kicker,
.mission-topline {
  color: var(--accent-2);
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

h1 {
  margin: 10px 0 16px;
  font-size: clamp(2.25rem, 6vw, 5.35rem);
  line-height: 0.95;
  letter-spacing: -0.075em;
}

.lab-card h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
}

.small-explain,
.story {
  color: #c7d9eb;
  line-height: 1.7;
  max-width: 62ch;
  margin: 0 auto 28px;
}

.story {
  margin-left: 0;
}

.password-form,
.flag-form {
  display: grid;
  gap: 10px;
  text-align: left;
  margin-top: 20px;
}

label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.95rem;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 15px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  outline: none;
}

input:focus {
  border-color: rgba(110, 231, 255, 0.76);
  box-shadow: 0 0 0 4px rgba(110, 231, 255, 0.08);
}

.primary-btn,
.tool-btn,
.secondary-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  cursor: pointer;
  transition: 180ms ease;
}

.primary-btn {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.24), rgba(157, 255, 176, 0.18));
  border-color: rgba(110, 231, 255, 0.52);
  font-weight: 850;
}

.secondary-btn,
.tool-btn {
  padding: 10px 13px;
  background: rgba(255, 255, 255, 0.055);
}

.primary-btn:hover,
.secondary-btn:hover,
.tool-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(110, 231, 255, 0.72);
  box-shadow: 0 0 30px rgba(110, 231, 255, 0.12);
}

.corner-tools {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 10;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: min(520px, calc(100% - 36px));
}

.manual-open {
  border-color: rgba(157, 255, 176, 0.38);
}

.result-line {
  min-height: 28px;
  color: var(--muted);
  font-family: var(--mono);
  overflow-wrap: anywhere;
}

.result-line.success {
  color: var(--accent-2);
}

.result-line.error {
  color: var(--danger);
}

.mission-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.playground {
  margin: 28px 0;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(0, 0, 0, 0.22);
  padding: 18px;
}

.terminal {
  border: 1px solid rgba(110, 231, 255, 0.22);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(3, 9, 18, 0.88);
  font-family: var(--mono);
}

.terminal-bar {
  display: flex;
  gap: 7px;
  padding: 11px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
}

.dot:nth-child(2) {
  background: var(--warning);
}

.dot:nth-child(3) {
  background: var(--accent-2);
}

.terminal pre {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  line-height: 1.65;
  color: #bdfecf;
  font-size: 0.92rem;
}

.split-row {
  display: flex;
  gap: 10px;
}

.split-row input {
  flex: 1;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.profile-cell {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px;
  background: rgba(255, 255, 255, 0.045);
}

.profile-cell small {
  display: block;
  color: var(--muted);
  margin-bottom: 5px;
}

.tool-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

code,
.kbd {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  padding: 2px 6px;
}

.modal {
  width: min(520px, calc(100% - 32px));
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 28px;
}

.modal.wide {
  width: min(760px, calc(100% - 32px));
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(6px);
}

.modal h2 {
  margin: 0 34px 12px 0;
  letter-spacing: -0.04em;
}

.modal p,
.modal li {
  color: #d2e3f5;
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
}

.finish-card {
  max-width: 760px;
}

.confetti {
  position: fixed;
  top: -12px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  pointer-events: none;
  animation: fall 2800ms linear forwards;
}

@keyframes fall {
  to {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

@media (max-width: 680px) {
  .corner-tools {
    position: static;
    padding: 14px;
  }

  .entry-shell,
  .lab-shell {
    padding-top: 24px;
    align-items: start;
  }

  .split-row,
  .mission-topline {
    flex-direction: column;
    align-items: stretch;
  }

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


.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px;
}

.lesson-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.lesson-box.full {
  grid-column: 1 / -1;
}

.lesson-box h3 {
  margin: 0 0 8px;
  letter-spacing: -0.03em;
  color: var(--accent);
}

.lesson-box p,
.lesson-box ul {
  margin: 0;
}

.lesson-box li + li {
  margin-top: 8px;
}

.lesson-box.takeaway {
  border-color: rgba(157, 255, 176, 0.38);
  background: rgba(157, 255, 176, 0.08);
}

.assessment-modal .primary-btn {
  width: 100%;
  margin-top: 4px;
}

@media (max-width: 680px) {
  .lesson-grid {
    grid-template-columns: 1fr;
  }
}
