:root {
  --bg: #050505;
  --panel: rgba(13, 13, 13, 0.96);
  --panel-soft: rgba(255, 187, 43, 0.08);
  --line: rgba(255, 199, 65, 0.24);
  --accent: #f6b108;
  --accent-bright: #ffd978;
  --text: #fff4d3;
  --muted: rgba(255, 244, 211, 0.72);
  --ok: #7cf0ab;
  --warn: #ffb938;
  --danger: #ff6955;
  --shadow: 0 34px 100px rgba(0, 0, 0, 0.48);
  --radius-xl: 36px;
  --radius-lg: 26px;
  --radius-md: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  overflow: hidden;
  color: var(--text);
  font-family: "Rajdhani", "Avenir Next", sans-serif;
  background:
    radial-gradient(circle at 16% 14%, rgba(246, 177, 8, 0.18), transparent 20%),
    radial-gradient(circle at 88% 20%, rgba(246, 177, 8, 0.12), transparent 18%),
    linear-gradient(180deg, #030303 0%, #111111 52%, #080808 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.16;
}

body::after {
  background:
    linear-gradient(90deg, #f6b108 0 18px, transparent 18px calc(100% - 18px), #f6b108 calc(100% - 18px)),
    linear-gradient(180deg, transparent 0 82%, rgba(255, 191, 49, 0.06) 82% 100%);
  mix-blend-mode: screen;
  opacity: 0.24;
}

.scene {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
}

.scene-stripe {
  position: fixed;
  top: 0;
  bottom: 0;
  width: 34px;
  background: linear-gradient(180deg, #f6b108, #cc8800);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.stripe-left {
  left: 0;
}

.stripe-right {
  right: 0;
}

.tablet-shell {
  width: min(100%, 820px);
  height: min(100vh - 40px, 1180px);
  position: relative;
}

.tablet-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 42px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 189, 34, 0.16), rgba(255, 189, 34, 0.03)),
    linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(7, 7, 7, 0.99));
  border: 1px solid rgba(255, 209, 101, 0.22);
  box-shadow: var(--shadow);
}

.tablet-frame::before {
  content: "";
  position: absolute;
  inset: 12px;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.tablet-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(130deg, transparent 0%, rgba(255, 255, 255, 0.08) 24%, transparent 42%);
  transform: translateX(-130%);
  animation: sweep 7s linear infinite;
  pointer-events: none;
}

.frame-bolt {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff7d6, #7a5f15 58%, #251d07 100%);
  box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.28);
  z-index: 4;
}

.bolt-a { top: 18px; left: 18px; }
.bolt-b { top: 18px; right: 18px; }
.bolt-c { bottom: 18px; left: 18px; }
.bolt-d { bottom: 18px; right: 18px; }

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 24px 28px 18px;
}

.topbar-brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.topbar-label,
.step-chip,
.code-window-label,
.topbar-status {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.76rem;
}

.topbar-label,
.step-chip,
.code-window-label {
  color: rgba(255, 208, 99, 0.86);
}

.topbar-year {
  font-family: "Orbitron", "Avenir Next", sans-serif;
  font-size: 1.35rem;
}

.topbar-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 16px rgba(124, 240, 171, 0.9);
}

.screen-layer {
  position: relative;
  height: calc(100% - 88px);
  padding: 0 28px 28px;
}

.screen {
  position: absolute;
  inset: 0 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(34px) scale(0.98);
  transition: opacity 220ms ease, transform 220ms ease;
}

.screen.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.screen-panel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 187, 43, 0.12), rgba(255, 187, 43, 0.02)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  padding: 32px 28px;
}

.screen-panel::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.hero-panel {
  min-height: 62%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(circle at top, rgba(255, 187, 43, 0.14), transparent 44%),
    linear-gradient(180deg, rgba(255, 187, 43, 0.12), rgba(255, 187, 43, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.hero-code,
.code-window-value {
  font-family: "Orbitron", "Avenir Next", sans-serif;
}

.hero-code {
  font-size: clamp(4.6rem, 13vw, 7.8rem);
  line-height: 0.92;
  color: var(--accent-bright);
  text-shadow: 0 0 34px rgba(246, 177, 8, 0.28);
}

h1,
h2 {
  margin: 18px 0 0;
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  line-height: 0.96;
}

.screen-copy,
.hero-panel p,
.screen-panel p {
  margin: 16px 0 0;
  font-size: 1.2rem;
  line-height: 1.42;
  color: var(--muted);
}

.screen-footer {
  display: flex;
  gap: 16px;
}

.two-actions > * {
  flex: 1;
}

.primary-button,
.secondary-button,
.keypad-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
}

.primary-button,
.secondary-button {
  min-height: 78px;
  border-radius: 22px;
  padding: 0 28px;
  font-size: 1.22rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: transform 140ms ease, opacity 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  color: #2d1d00;
  background: linear-gradient(180deg, #ffe39b, #f6b108);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    0 18px 36px rgba(246, 177, 8, 0.24);
}

.secondary-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.giant-button {
  width: 100%;
}

.primary-button:hover,
.secondary-button:hover,
.keypad-button:hover {
  transform: translateY(-2px);
}

.primary-button:active,
.secondary-button:active,
.keypad-button:active {
  transform: translateY(1px) scale(0.99);
}

.primary-button[disabled],
.secondary-button[disabled],
.keypad-button[disabled] {
  opacity: 0.44;
  cursor: default;
  transform: none;
}

.input-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 24px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 187, 43, 0.08), rgba(255, 187, 43, 0.02)),
    rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 199, 65, 0.18);
  color: rgba(255, 208, 99, 0.86);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.9rem;
}

.input-card input {
  width: 100%;
  border: 0;
  outline: none;
  border-radius: 18px;
  padding: 20px 22px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45), rgba(255, 255, 255, 0.04));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 1.55rem;
  text-transform: none;
  letter-spacing: normal;
}

.message-card {
  min-height: 74px;
  margin-top: 20px;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.04);
  color: transparent;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.message-card.is-visible {
  color: var(--text);
  border-color: rgba(255, 105, 85, 0.4);
  background: rgba(255, 105, 85, 0.14);
}

.keypad-panel {
  padding-bottom: 26px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.attempt-meter {
  display: inline-flex;
  gap: 10px;
  padding-top: 8px;
}

.attempt-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.attempt-dot.is-on {
  background: linear-gradient(180deg, #ffe39b, #f6b108);
  box-shadow: 0 0 18px rgba(246, 177, 8, 0.44);
}

.attempt-copy {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1.1rem;
}

.code-window {
  margin-top: 24px;
  padding: 22px 22px 24px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.54), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 199, 65, 0.16);
}

.code-window-value {
  margin-top: 12px;
  text-align: center;
  font-size: clamp(3.4rem, 8vw, 5.2rem);
  letter-spacing: 0.28em;
  color: #dffff0;
  text-shadow: 0 0 24px rgba(84, 255, 186, 0.2);
}

.keypad-grid {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.keypad-button {
  min-height: 94px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.02)),
    linear-gradient(180deg, #433615, #17120b);
  border: 1px solid rgba(255, 208, 99, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    0 16px 32px rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-family: "Orbitron", "Avenir Next", sans-serif;
  font-size: 2rem;
}

.utility-button {
  color: var(--accent-bright);
}

.result-panel {
  min-height: 72%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.result-panel-warn {
  background:
    radial-gradient(circle at top, rgba(255, 185, 56, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(255, 185, 56, 0.1), rgba(255, 185, 56, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.result-panel-ok {
  background:
    radial-gradient(circle at top, rgba(124, 240, 171, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(124, 240, 171, 0.1), rgba(124, 240, 171, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.result-panel-fail {
  background:
    radial-gradient(circle at top, rgba(255, 105, 85, 0.15), transparent 38%),
    linear-gradient(180deg, rgba(255, 105, 85, 0.1), rgba(255, 105, 85, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.result-mark {
  width: 138px;
  height: 138px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.12);
  font-family: "Orbitron", "Avenir Next", sans-serif;
  font-size: 4rem;
  margin-bottom: 24px;
}

.result-panel-ok .result-mark {
  border-color: rgba(124, 240, 171, 0.36);
  color: var(--ok);
  box-shadow: 0 0 40px rgba(124, 240, 171, 0.14);
}

.result-panel-warn .result-mark {
  border-color: rgba(255, 185, 56, 0.36);
  color: var(--warn);
  box-shadow: 0 0 40px rgba(255, 185, 56, 0.14);
}

.result-panel-fail .result-mark {
  border-color: rgba(255, 105, 85, 0.36);
  color: var(--danger);
  box-shadow: 0 0 40px rgba(255, 105, 85, 0.14);
}

@keyframes sweep {
  0% { transform: translateX(-130%); }
  18%, 100% { transform: translateX(130%); }
}

@media (max-width: 900px) {
  .scene {
    padding: 10px;
  }

  .tablet-shell {
    width: 100%;
    height: calc(100vh - 20px);
  }

  .screen {
    inset: 0 18px 18px;
  }

  .screen-layer {
    padding: 0 18px 18px;
  }

  .topbar {
    padding: 20px 20px 14px;
  }
}

@media (max-width: 620px) {
  .scene-stripe {
    width: 18px;
  }

  .screen-panel {
    padding: 24px 20px;
  }

  .screen-footer,
  .two-actions {
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .keypad-button {
    min-height: 76px;
    font-size: 1.7rem;
  }

  .code-window-value {
    font-size: 3rem;
  }

  .result-mark {
    width: 116px;
    height: 116px;
    font-size: 3.2rem;
  }
}
