@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Outfit:wght@500;600&display=swap');

* {
  box-sizing: border-box;
}

/* Class rules like .cya-cheats { display: flex } can override the UA [hidden] rule; force [hidden] to win. */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: #050608;
  color: #c4d0dc;
  font-family: 'Outfit', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.cya {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.cya-hd {
  text-align: center;
  margin-bottom: 20px;
}

.cya-title {
  font-size: clamp(1.2rem, 4vw, 1.5rem);
  font-weight: 600;
  color: #6ee0ff;
  text-shadow: 0 0 20px rgba(60, 200, 255, 0.3);
  margin: 0 0 6px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cya-sub {
  margin: 0;
  font-size: 0.88rem;
  color: #6a7a8a;
  line-height: 1.4;
}

.cya-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.cya-panel {
  background: linear-gradient(165deg, #12151c 0%, #0d1015 100%);
  border: 1px solid rgba(80, 140, 180, 0.28);
  border-radius: 10px;
  padding: 16px 16px 18px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4), 0 8px 28px rgba(0, 0, 0, 0.35);
}

.cya-panel--readout {
  border-color: rgba(120, 40, 50, 0.35);
  background: linear-gradient(165deg, #120808 0%, #080606 100%);
  animation: cya-pulse 4s ease-in-out infinite;
}

@keyframes cya-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(80, 20, 30, 0.2); }
  50% { box-shadow: 0 0 18px rgba(120, 20, 30, 0.25); }
}

.cya-readout-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #5a6a7a;
  margin: 0 0 8px;
}

.cya-readout {
  font-size: 0.95rem;
  line-height: 1.45;
  margin: 0;
  min-height: 0;
  color: #e0e8f0;
}

.cya-panel--gate {
  position: relative;
  z-index: 2;
  border-color: rgba(180, 120, 80, 0.35);
  background: linear-gradient(165deg, #151210 0%, #0d0e0c 100%);
}

.cya-cheat-gate-lab {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #7a6a5a;
  margin: 0 0 4px;
}

.cya-cheat-gate-hint {
  font-size: 0.8rem;
  color: #6a5a4a;
  margin: 0 0 8px;
  line-height: 1.35;
}

.cya-cheat-pw-lab {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9aacbc;
  margin: 0 0 8px;
}

.cya-cheat-gate-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.cya-cheat-pw {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.3;
  color: #e8e0d8;
  background: #0a0c0e;
  border: 1px solid rgba(120, 90, 60, 0.45);
  border-radius: 8px;
  outline: none;
  position: relative;
  z-index: 1;
  -webkit-user-select: text;
  user-select: text;
  touch-action: manipulation;
}

.cya-cheat-pw:hover {
  border-color: rgba(160, 120, 80, 0.5);
}

.cya-cheat-pw:focus {
  border-color: rgba(220, 160, 80, 0.55);
  box-shadow: 0 0 0 1px rgba(200, 120, 40, 0.2);
}

.cya-cheat-err {
  font-size: 0.8rem;
  color: #e8a0a0;
  margin: 8px 0 0;
  min-height: 1.2em;
}

.cya-cheat-err:empty,
.cya-cheat-err[hidden] {
  display: none;
}

.cya-btn--unlock {
  width: auto;
  flex-shrink: 0;
  min-width: 5.2em;
  padding: 10px 14px;
}

.cya-cheats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cya-cheat {
  display: block;
  width: 100%;
  max-width: 120px;
  margin: 0 auto 0 0;
  padding: 10px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  color: #e8a85c;
  background: #140f0a;
  border: 1px dashed rgba(220, 140, 60, 0.55);
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.12s, border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.cya-cheat:hover,
.cya-cheat:focus-visible {
  color: #ffc878;
  border-color: rgba(255, 180, 100, 0.75);
  background: #1a120c;
  box-shadow: 0 0 14px rgba(200, 120, 40, 0.2);
  outline: none;
}

.cya-writing {
  margin: 0;
  padding: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: #6a7a8a;
  border: 1px solid rgba(80, 100, 120, 0.35);
  border-radius: 8px;
  background: rgba(8, 10, 14, 0.6);
}

.cya-writing-sum {
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  color: #7a8a9a;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

.cya-writing summary::-webkit-details-marker {
  display: none;
}

.cya-writing-sum::before {
  content: "▶ ";
  font-size: 0.65em;
  opacity: 0.7;
}

.cya-writing[open] .cya-writing-sum::before {
  content: "▼ ";
}

.cya-writing-body {
  padding: 0 12px 12px 14px;
  border-top: 1px solid rgba(60, 80, 100, 0.35);
  margin: 0;
}

.cya-writing-body p {
  margin: 0 0 8px;
}

.cya-writing-body p:last-of-type {
  margin-bottom: 0;
}

.cya-writing-body ul {
  margin: 0 0 8px 1.1em;
  padding: 0;
}

.cya-writing-body li {
  margin-bottom: 4px;
}

.cya-writing kbd {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid rgba(100, 120, 140, 0.5);
  background: #0a0e12;
  color: #9ab;
}

.cya-panel--ask {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cya-ask-prompt {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #9aacbc;
  margin: 0 0 8px;
}

.cya-ask {
  width: 100%;
  min-height: 4.2em;
  margin: 0 0 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.4;
  color: #e0e8f0;
  background: #0a0e12;
  border: 1px solid rgba(80, 130, 170, 0.45);
  border-radius: 8px;
  resize: vertical;
  outline: none;
}

.cya-ask::placeholder {
  color: #4a5a6a;
}

.cya-ask:hover {
  border-color: rgba(100, 170, 210, 0.55);
}

.cya-ask:focus {
  border-color: rgba(80, 200, 255, 0.6);
  box-shadow: 0 0 0 1px rgba(50, 160, 220, 0.25);
}

.cya-ask-row {
  margin-bottom: 12px;
}

.cya-btn--ask {
  width: 100%;
}

.cya-answer-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #5a6a7a;
  margin: 0 0 6px;
}

.cya-answer {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #b8e0f0;
  min-height: 2.5em;
}

.cya-btn {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid rgba(60, 180, 220, 0.45);
  background: linear-gradient(180deg, #1a3848 0%, #0f2028 100%);
  color: #d8f0ff;
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
  -webkit-tap-highlight-color: transparent;
}

.cya-btn:hover,
.cya-btn:focus-visible {
  background: linear-gradient(180deg, #224858 0%, #122830 100%);
  border-color: rgba(100, 210, 255, 0.55);
  box-shadow: 0 0 16px rgba(50, 180, 255, 0.15);
  outline: none;
}

.cya-exit {
  display: block;
  text-align: center;
  margin-top: auto;
  padding-top: 20px;
  text-decoration: none;
  color: #6a8a9c;
  font-size: 0.88rem;
  border: 1px solid rgba(80, 120, 140, 0.35);
  border-radius: 8px;
  padding: 10px 16px;
  max-width: 200px;
  margin-left: auto;
  margin-right: auto;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.cya-exit:hover,
.cya-exit:focus-visible {
  color: #9ec8dc;
  border-color: rgba(100, 180, 210, 0.5);
  background: rgba(20, 40, 50, 0.4);
  outline: none;
}

@media (prefers-reduced-motion: reduce) {
  .cya-btn,
  .cya-btn--unlock,
  .cya-cheat,
  .cya-exit {
    transition: none;
  }
}
