:root {
  /* Colors */
  --bg-color: #0a0a0c;
  --bg-card: #141418;
  --text-main: #e0e0e0;
  --sys-blue: #00d2ff;
  --sys-blue-glow: rgba(0, 210, 255, 0.4);
  --sys-blue-soft: rgba(0, 210, 255, 0.1);
  --sys-red: #ff003c;
  --sys-red-glow: rgba(255, 0, 60, 0.4);
  --sys-green: #00ff88;
  
  /* Fonts */
  --font-sys: 'Share Tech Mono', monospace;
  --font-ui: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-ui);
  line-height: 1.6;
  overflow-x: hidden;
  user-select: none;
}

h1, h2, h3, h4 {
  font-weight: 800;
  margin-bottom: 1rem;
}

/* System Notifications */
#system-notification {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 10, 12, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

#system-notification.hidden {
  opacity: 0;
  pointer-events: none;
}

.notification-box {
  background: var(--bg-card);
  border: 1px solid var(--sys-blue);
  box-shadow: 0 0 20px var(--sys-blue-glow);
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  text-align: center;
  transform: translateY(0);
  animation: slideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-box.penalty {
  border-color: var(--sys-red);
  box-shadow: 0 0 20px var(--sys-red-glow);
}

@keyframes slideIn {
  0% { transform: translateY(-50px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.system-label {
  display: block;
  font-family: var(--font-sys);
  color: var(--sys-blue);
  font-size: 0.9rem;
  margin-bottom: 1rem;
  letter-spacing: 2px;
}

.notification-box.penalty .system-label {
  color: var(--sys-red);
}

#notification-text {
  white-space: pre-line;
  font-family: var(--font-sys);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Typography & Core UI Elements */
.sys-text {
  font-family: var(--font-sys);
  color: var(--sys-blue);
}

.sys-text-red {
  font-family: var(--font-sys);
  color: var(--sys-red);
}

.btn {
  background: transparent;
  border: 1px solid var(--sys-blue);
  color: var(--sys-blue);
  font-family: var(--font-sys);
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s ease;
  width: 100%;
  font-size: 1rem;
}

.btn:hover, .btn:active {
  background: var(--sys-blue);
  color: var(--bg-color);
  box-shadow: 0 0 15px var(--sys-blue-glow);
}

.hidden {
  display: none !important;
}

.btn.hidden {
  display: none !important;
}

.btn.penalty-btn {
  border-color: var(--sys-red);
  color: var(--sys-red);
}

.btn.penalty-btn:hover, .btn.penalty-btn:active {
  background: var(--sys-red);
  color: var(--bg-color);
  box-shadow: 0 0 15px var(--sys-red-glow);
}

input, select {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid #333;
  color: var(--text-main);
  padding: 0.75rem;
  margin-bottom: 1rem;
  font-family: var(--font-ui);
  border-radius: 4px;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--sys-blue);
  box-shadow: 0 0 5px var(--sys-blue-glow);
}

/* Layouts */
#main-container {
  padding: 1rem;
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
}

.view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Awakening Form */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-family: var(--font-sys);
  color: var(--sys-blue);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

/* Dashboard */
.rank-display {
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid #333;
  margin-bottom: 2rem;
}

.rank-letter {
  font-family: var(--font-sys);
  font-size: 4rem;
  color: var(--sys-blue);
  text-shadow: 0 0 20px var(--sys-blue-glow);
  line-height: 1;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  background: var(--bg-card);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #222;
  text-align: center;
}

.stat-name {
  font-family: var(--font-sys);
  color: var(--sys-blue);
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 0.5rem;
}

.exp-bar-container {
  background: var(--bg-card);
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  border: 1px solid #333;
}

.exp-bar-fill {
  background: var(--sys-blue);
  height: 100%;
  width: 0%;
  transition: width 0.5s ease;
  box-shadow: 0 0 10px var(--sys-blue-glow);
}

/* Quest View */
.quest-card {
  background: var(--bg-card);
  border: 1px solid var(--sys-blue);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  box-shadow: 0 0 10px var(--sys-blue-soft);
}

.quest-card.penalty {
  border-color: var(--sys-red);
  box-shadow: 0 0 10px rgba(255, 0, 60, 0.1);
}

.quest-header {
  font-family: var(--font-sys);
  color: var(--sys-blue);
  border-bottom: 1px dashed var(--sys-blue);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.quest-card.penalty .quest-header {
  color: var(--sys-red);
  border-bottom-color: var(--sys-red);
}

.exercise-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0;
  border-bottom: 1px solid #222;
}

.exercise-item:last-child {
  border-bottom: none;
}

.exercise-name {
  font-weight: 600;
}

.exercise-reps {
  font-family: var(--font-sys);
  color: var(--sys-blue);
}

/* Active Quest UI */
.active-exercise {
  text-align: center;
  margin: 2rem 0;
}

.active-exercise-name {
  font-size: 1.5rem;
  color: var(--sys-blue);
  margin-bottom: 1rem;
}

.rpe-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.5rem;
  margin: 1rem 0 2rem 0;
}
@media (min-width: 480px) {
  .rpe-selector { grid-template-columns: repeat(10, 1fr); gap: 0.35rem; }
}

.rpe-btn {
  background: var(--bg-card);
  border: 1px solid #444;
  color: var(--text-main);
  padding: 0.6rem 0;
  min-height: 44px;
  border-radius: 4px;
  cursor: pointer;
}

.rpe-btn.selected {
  border-color: var(--sys-blue);
  background: var(--sys-blue-soft);
  color: var(--sys-blue);
}

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
  padding-bottom: 2rem;
}

.achievement-card {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid #333;
  padding: 1rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.achievement-card.locked {
  opacity: 0.5;
  filter: grayscale(100%);
}

.achievement-card.unlocked {
  border-color: var(--sys-blue);
  box-shadow: 0 0 10px var(--sys-blue-glow);
}

.achievement-icon {
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  margin-right: 1.5rem;
}

.achievement-details h4 {
  margin-bottom: 0.25rem;
  font-family: var(--font-sys);
  color: var(--sys-blue);
}

.achievement-card.locked .achievement-details h4 {
  color: #888;
}

.achievement-details p {
  font-size: 0.85rem;
  color: #ccc;
}

/* ================================================
   STORE
   ================================================ */

#view-store {
  padding-bottom: 2rem;
}

.store-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #2a2a2a;
}

.store-gold {
  font-family: var(--font-sys);
  font-size: 1.4rem;
  color: #f5c518;
  text-shadow: 0 0 8px rgba(245, 197, 24, 0.4);
}

.store-category {
  margin-bottom: 2rem;
}

.store-category-label {
  font-family: var(--font-sys);
  font-size: 0.75rem;
  letter-spacing: 2px;
  color: #555;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #1e1e1e;
}

.store-items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.store-card {
  background: #111114;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: border-color 0.2s;
}

.store-card:hover {
  border-color: #444;
}

.store-card-name {
  font-family: var(--font-sys);
  font-size: 0.85rem;
  color: #e0e0e0;
  line-height: 1.3;
}

.store-card-lore {
  font-size: 0.75rem;
  color: #666;
  flex: 1;
  font-family: var(--font-sys);
  line-height: 1.4;
}

.store-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.store-card-cost {
  font-family: var(--font-sys);
  font-size: 0.85rem;
  color: #f5c518;
  white-space: nowrap;
}

.store-buy-btn {
  font-size: 0.75rem;
  padding: 0.3rem 0.7rem;
  border-color: #f5c518;
  color: #f5c518;
}

.store-buy-btn:hover:not(:disabled) {
  background: rgba(245, 197, 24, 0.1);
}

/* Toast notifications */
.store-toast {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-family: var(--font-sys);
  font-size: 0.85rem;
  margin-bottom: 1rem;
  animation: slideDown 0.25s ease;
}

.store-toast-success {
  background: rgba(0, 255, 136, 0.12);
  border: 1px solid var(--sys-green);
  color: var(--sys-green);
}

.store-toast-error {
  background: rgba(255, 0, 60, 0.12);
  border: 1px solid var(--sys-red);
  color: var(--sys-red);
}

/* Animations */
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.shake {
  animation: shake 0.4s ease;
  border-color: var(--sys-red) !important;
}

@keyframes goldGlowAnim {
  0%   { text-shadow: 0 0 8px rgba(245, 197, 24, 0.4); }
  50%  { text-shadow: 0 0 24px rgba(245, 197, 24, 1); }
  100% { text-shadow: 0 0 8px rgba(245, 197, 24, 0.4); }
}

.gold-glow {
  animation: goldGlowAnim 0.6s ease;
}



/* ── v0.2: disclaimer, settings, store counts ─────────────────────── */
.disclaimer-list { padding-left: 1.2rem; display: grid; gap: 0.5rem; font-size: 0.9rem; color: #ccc; }
.disclaimer-list a, .legal-links a { color: var(--sys-blue); }
.check-row { display: flex; gap: 0.75rem; align-items: flex-start; margin: 1.25rem 0; font-size: 0.9rem; color: #ccc; cursor: pointer; text-align: left; }
.check-row input { width: 1.2rem; height: 1.2rem; flex-shrink: 0; margin-top: 0.15rem; accent-color: var(--sys-blue); }

.setting-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid #222; cursor: pointer; text-align: left; }
.setting-row:last-child { border-bottom: none; }
.setting-label { display: block; font-family: var(--font-sys); letter-spacing: 1px; }
.setting-hint { display: block; font-size: 0.75rem; color: #777; margin-top: 0.15rem; text-align: left; }

input.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 26px; padding: 0; border-radius: 13px; background: #333; border: 1px solid #555; position: relative; cursor: pointer; flex-shrink: 0; transition: background 0.2s; }
input.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #888; transition: transform 0.2s, background 0.2s; }
input.switch:checked { background: var(--sys-blue-soft); border-color: var(--sys-blue); }
input.switch:checked::after { transform: translateX(20px); background: var(--sys-blue); box-shadow: 0 0 8px var(--sys-blue-glow); }
input.switch:disabled { opacity: 0.4; cursor: not-allowed; }

.aura-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.aura-swatch { display: flex; align-items: center; gap: 0.4rem; background: #111; color: #ccc; border: 1px solid #444; border-radius: 6px; padding: 0.45rem 0.7rem; font-family: var(--font-sys); font-size: 0.8rem; cursor: pointer; }
.aura-swatch.active { border-color: var(--swatch); color: var(--swatch); box-shadow: 0 0 8px var(--swatch); }
.aura-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--swatch); box-shadow: 0 0 6px var(--swatch); }

.legal-links a { display: block; padding: 0.35rem 0; text-align: left; }
.store-owned-count { color: #f5c518; font-size: 0.8rem; margin-left: 0.3rem; }
.store-header h2 { font-size: clamp(1rem, 5vw, 1.5rem); white-space: nowrap; }
