/* ============================================================
   KeyKES.com — "The Vault" theme
   Dark premium · glass panels · per-mode neon accents
   ============================================================ */

@property --accent {
  syntax: '<color>';
  inherits: true;
  initial-value: #8b96a8;
}

:root {
  --bg: #0a0e14;
  --panel: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #f2f5f8;
  --muted: #8b96a8;
  --accent: #8b96a8;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-glow: color-mix(in srgb, var(--accent) 32%, transparent);
  --danger: #ff5c5c;
  --ok: #4ade80;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

/* Per-mode accent — set via body[data-mode] in script.js */
body[data-mode="xor"]         { --accent: #22d3ee; } /* Key Translator  → cyan   */
body[data-mode="emoji"]       { --accent: #fbbf24; } /* Emoji Code      → amber  */
body[data-mode="wordspinner"] { --accent: #4ade80; } /* Word Spinner    → green  */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px 40px;
  font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  /* Whole-page ambience follows the active mode's accent (neutral gray when none). */
  background:
    radial-gradient(1100px 560px at 50% -10%, color-mix(in srgb, var(--accent) 13%, transparent), transparent 60%),
    radial-gradient(900px 500px at 88% 112%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 60%),
    var(--bg);
  /* NOTE: no `transition: --accent` here — transitioning a registered custom
     property on body can wedge the value (Chromium quirk); per-element
     transitions on color/border/box-shadow already animate the accent shift. */
}

/* Faint blueprint grid */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
  z-index: 0;
}

/* ---------- Main glass container ---------- */
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  padding: 28px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 22px;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}
/* Whole-page mode cue: with a mode active, the container frame + top edge light up in the accent */
body[data-mode] .container {
  border-color: color-mix(in srgb, var(--accent) 38%, transparent);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 44px -8px var(--accent-glow);
}
body[data-mode] .container::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 28px;
  right: 28px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* ---------- Header / brand ---------- */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-size: 2.3rem;
  line-height: 1;
  filter: drop-shadow(0 0 16px var(--accent-glow));
  transition: filter 0.35s ease;
}
.brand-lockup h1 {
  margin: 0;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-subtitle {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.07em;
  font-family: var(--mono);
  text-transform: uppercase;
}
.icon-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--panel-border);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.25s ease;
}
.icon-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 18px var(--accent-glow);
  transform: rotate(12deg);
}

/* ---------- Mode instruction ---------- */
.mode-instruction {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: center;
}
.mode-instruction i { color: var(--accent); font-size: 1.1em; transition: color 0.35s ease; }
/* fa-hand-pointer aims up-right by default — rotate 135° so the finger points down at the mode buttons */
.mode-instruction .fa-hand-pointer { transform: rotate(135deg); }
body[data-mode] .mode-instruction {
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
}

/* ---------- Mode selector (segmented) ---------- */
.mode-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.mode-btn {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.25s ease, background 0.25s ease,
              transform 0.2s ease, box-shadow 0.3s ease;
}
.mode-btn i {
  color: var(--muted);
  font-size: 1.15rem;
  margin-top: 3px;
  transition: color 0.3s ease;
}
.mode-btn span { display: flex; flex-direction: column; gap: 3px; }
.mode-btn strong { font-size: 0.95rem; font-weight: 600; }
.mode-btn small { font-size: 0.72rem; color: var(--muted); line-height: 1.35; }
.mode-btn:hover:not(.active) {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}
.mode-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 28px var(--accent-glow);
}
.mode-btn.active i { color: var(--accent); }

/* ---------- Keyword row (Key Translator only) ---------- */
.keyword-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
}
.keyword-section label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}
.keyword-section label i { color: var(--accent); transition: color 0.35s ease; }
.keyword-section input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--mono);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.keyword-section input::placeholder { color: #5b6675; }
.keyword-section input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ---------- Input / Output panels ---------- */
.io-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
.text-panel { width: 100%; position: relative; }
.text-panel > label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 0 2px 7px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  font-family: var(--mono);
  text-transform: uppercase;
}
.text-panel > label small {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #5b6675;
}
textarea {
  display: block;
  width: 100%;
  height: 140px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
textarea::placeholder { color: #5b6675; }
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.output-panel textarea { padding-bottom: 52px; background: rgba(0, 0, 0, 0.25); }
/* Subtle accent tint on the text fields while a mode is active */
body[data-mode] .text-panel textarea {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--panel-border));
}

.transform-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #5b6675;
  font-size: 0.7rem;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.transform-arrow i {
  color: var(--accent);
  animation: arrowPulse 2s ease-in-out infinite;
  transition: color 0.35s ease;
}
@keyframes arrowPulse {
  0%, 100% { opacity: 0.45; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(3px); }
}

.inline-copy {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: var(--accent);
  color: #0a0e14;
  border: none;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.35s ease;
}
.inline-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--accent-glow);
}
.inline-copy:active { transform: scale(0.96); }

/* ---------- Action buttons ---------- */
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: transparent;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.ghost-btn:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.28);
  transform: translateY(-1px);
}
.ghost-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: 0 0 16px rgba(255, 92, 92, 0.2);
}
.ghost-btn:active { transform: scale(0.96); }

/* ---------- Support trigger ---------- */
.support-trigger {
  display: table;
  margin: 0 auto;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.25s ease;
}
.support-trigger:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px var(--accent-glow);
  transform: translateY(-1px);
}
.support-trigger .support-text { margin: 0 8px; font-size: 0.95rem; vertical-align: middle; }
.support-trigger span { font-size: 1.1rem; vertical-align: middle; }

/* ---------- Status bar ---------- */
.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--panel-border);
  padding-top: 14px;
  color: var(--muted);
  font-size: 0.76rem;
  font-family: var(--mono);
}
.status-bar i {
  color: var(--accent);
  font-size: 0.5rem;
  vertical-align: middle;
  margin-right: 6px;
  transition: color 0.35s ease;
}
.status-bar strong { color: var(--accent); font-weight: 700; transition: color 0.35s ease; }

/* ---------- Video link ---------- */
.video-link { text-align: center; font-size: 0.9rem; }
.video-link a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.35s ease;
}
.video-link a:hover { text-decoration: underline; }

/* ---------- Modals ---------- */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow: auto;
  background: rgba(4, 7, 11, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}
.modal-content {
  position: relative;
  margin: 8% auto;
  padding: 28px 30px;
  width: 90%;
  max-width: 520px;
  background: #10161f;
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  animation: slideIn 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.modal-content h2 {
  margin: 0 0 22px;
  padding-right: 30px;
  text-align: center;
  font-size: 1.3rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: color 0.35s ease;
}
.close-btn {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 28px;
  font-weight: bold;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}
.close-btn:hover, .close-btn:focus {
  color: var(--danger);
  transform: scale(1.1) rotate(90deg);
}

/* Help modal content */
#helpContent div {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--panel-border);
}
#helpContent div:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
#helpContent h3 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
#helpContent h3 i { color: var(--accent); transition: color 0.35s ease; }
#helpContent p {
  margin: 0;
  line-height: 1.65;
  font-size: 0.92rem;
  color: var(--muted);
}
#helpContent code {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
}

/* Donate modal */
.dynamic-amount-wrapper {
  display: flex;
  gap: 10px;
  justify-content: center;
  width: 100%;
  max-width: 340px;
  margin: 18px auto 22px;
}
.dynamic-amount-wrapper input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  text-align: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  font-family: var(--mono);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.dynamic-amount-wrapper input::placeholder { color: #5b6675; }
.dynamic-amount-wrapper input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.dynamic-amount-wrapper button {
  padding: 12px 18px;
  background: var(--accent);
  color: #0a0e14;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.25s ease, background 0.35s ease;
}
.dynamic-amount-wrapper button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 22px var(--accent-glow);
}

.qr-result-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}
.qr-top-logo { max-width: 170px; height: auto; }
.qr-code-image {
  width: 100%;
  max-width: 220px;
  height: auto;
  display: block;
  border-radius: 10px;
  background: #fff;
  padding: 8px;
}
.qr-info-text { text-align: center; line-height: 1.4; }
.qr-phone-number, .qr-amount {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
}
.qr-instruction {
  text-align: center;
  color: var(--muted);
  margin-top: 16px;
  font-style: italic;
  font-size: 0.9rem;
}
.hidden { display: none !important; }

/* ---------- Toast ---------- */
.toast-notification {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: #10161f;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-left: 3px solid var(--accent);
  padding: 13px 22px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10000;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  animation: toastIn 3.3s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}
.toast-notification.error-toast {
  border-left-color: var(--danger);
  border-color: rgba(255, 92, 92, 0.4);
}

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn {
  from { transform: translateY(-24px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
@keyframes toastIn {
  0%   { opacity: 0; transform: translate(-50%, 18px); }
  10%  { opacity: 1; transform: translate(-50%, 0); }
  90%  { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 18px); }
}

/* ---------- Footer ---------- */
.page-footer {
  position: relative;
  z-index: 1;
  width: 100%;
  margin-top: 26px;
  padding-bottom: 10px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.page-footer p { margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  body { padding: 16px 10px 32px; }
  .container { padding: 20px 16px; gap: 18px; }
  .brand-mark { font-size: 1.8rem; }
  .brand-lockup h1 { font-size: 1.35rem; }
  .brand-subtitle { font-size: 0.68rem; }
  .mode-buttons { grid-template-columns: 1fr; }
  textarea { height: 120px; }
  .mode-btn, .ghost-btn { padding: 12px 14px; }
  .modal-content { margin: 10% auto; padding: 22px 20px; }
  .modal-content h2 { font-size: 1.15rem; }
  .toast-notification { white-space: normal; max-width: 88vw; text-align: center; }
}
@media (max-width: 360px) {
  .brand-lockup h1 { font-size: 1.2rem; }
  .container { padding: 16px 12px; gap: 15px; }
  textarea { font-size: 0.9rem; height: 110px; }
}
