/* === TYPE === */

:root {
  --bg:          #0a0c14;
  --surface:     #10141f;
  --surface2:    #171c2a;
  --border:      #1c2438;
  --primary:     #ccd4e8;
  --dim:         #48567a;
  --action:      #7eb8f7;
  --action-dark: #5a9fe0;
  --action-glow: rgba(126,184,247,0.2);
  --yes:         #6bcf7f;
  --no:          #e07070;
}

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

html, body {
  height: 100%;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  background: var(--bg);
  color: var(--primary);
  overflow-x: hidden;
}

body { display: flex; flex-direction: column; align-items: center; min-height: 100vh; }

/* === SCREENS === */

.screen {
  display: none;
  width: 100%;
  max-width: 540px;
  padding: 1.5rem;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}
.screen.active { display: flex; }

/* === HOME === */

.home-top { text-align: center; padding-top: 0.5rem; }

.logo {
  font-size: clamp(3rem, 10vw, 5rem);
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--action);
  text-shadow: 0 0 40px var(--action-glow);
  line-height: 1;
}

.logo-sub {
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  color: var(--dim);
  text-transform: uppercase;
  margin-top: 0.3rem;
}

.char-preview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  width: 100%;
}

.preview-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.preview-emoji { font-size: 1.6rem; line-height: 1; }

.preview-name {
  font-size: 0.5rem;
  letter-spacing: 0.07em;
  color: var(--dim);
  text-align: center;
  text-transform: uppercase;
}

.home-desc {
  font-size: 0.8rem;
  color: var(--dim);
  line-height: 1.75;
  text-align: center;
  max-width: 340px;
}

/* === BUTTONS === */

.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.1s;
  text-transform: uppercase;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: var(--action);
  color: #060a14;
  box-shadow: 0 0 20px var(--action-glow);
}
.btn-primary:hover:not(:disabled) { background: var(--action-dark); }

.btn-secondary {
  background: var(--surface2);
  color: var(--primary);
  border: 1px solid var(--border);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--dim); }

.btn-large { width: 100%; padding: 1rem 2rem; font-size: 1.1rem; max-width: 340px; }
.btn-small { font-size: 0.72rem; padding: 0.45rem 1.1rem; }

.back-link {
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.2s;
  padding-bottom: 0.5rem;
}
.back-link:hover { color: var(--primary); }

/* === GAME HEADER === */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.game-status {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.05em;
}

.status-dim {
  font-size: 0.7rem;
  color: var(--dim);
  letter-spacing: 0.1em;
}

/* === CARD GRID === */

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.type-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: filter 0.4s ease, opacity 0.4s ease, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  cursor: default;
}

.type-card.eliminated {
  filter: grayscale(1);
  opacity: 0.15;
}

.type-card.selectable {
  cursor: pointer;
  border-color: var(--action);
  box-shadow: 0 0 12px var(--action-glow);
}

.type-card.selectable:hover {
  background: rgba(126,184,247,0.07);
  transform: scale(1.03);
}

.type-card.selectable:active { transform: scale(0.97); }

.card-emoji { font-size: 2.2rem; line-height: 1; }

.card-name {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--primary);
  text-align: center;
  line-height: 1.4;
  text-transform: uppercase;
}

/* Attribute icons */

.card-attrs {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.attr-icon {
  font-size: 0.85rem;
  line-height: 1;
  transition: transform 0.2s;
}

.attr-icon.no {
  filter: grayscale(1);
  opacity: 0.2;
}

.attr-icon.flash {
  animation: attr-flash 0.45s ease-in-out;
}

@keyframes attr-flash {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.7); filter: brightness(1.8); }
  100% { transform: scale(1); }
}

/* === QUESTION SECTION === */

#question-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.section-label {
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  color: var(--dim);
  text-transform: uppercase;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.question-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.7rem 0.9rem;
  font-family: inherit;
  font-size: 0.77rem;
  color: var(--primary);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  transition: background 0.15s, border-color 0.15s, opacity 0.3s, transform 0.3s;
  width: 100%;
}

.question-btn:hover:not(:disabled) {
  background: var(--surface2);
  border-color: var(--action);
}

.question-btn:disabled { cursor: default; }

.q-attr-icon { font-size: 1rem; flex-shrink: 0; }
.q-text { flex: 1; }

.q-ask {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--action);
  flex-shrink: 0;
}

.question-btn.answered-yes,
.question-btn.answered-no  { flex-wrap: wrap; }
.question-btn.answered-yes .q-ask { color: var(--yes); font-weight: 700; font-size: 0.8rem; }
.question-btn.answered-no  .q-ask { color: var(--no);  font-weight: 700; font-size: 0.8rem; }

.q-reason {
  font-size: 0.65rem;
  color: var(--dim);
  letter-spacing: 0.05em;
  width: 100%;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  margin-top: 0.35rem;
}

.question-btn.fading {
  opacity: 0;
  transform: translateX(10px);
}

.q-empty {
  font-size: 0.75rem;
  color: var(--dim);
  letter-spacing: 0.05em;
  padding: 0.4rem 0;
}

/* === RESULT === */

.result-title {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
  line-height: 1.1;
}
.result-title.win  { color: var(--action); text-shadow: 0 0 40px var(--action-glow); }
.result-title.loss { color: var(--no); }

.result-char {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  width: 100%;
  max-width: 340px;
}

.result-emoji     { font-size: 3.5rem; line-height: 1; }
.result-char-name { font-size: 0.82rem; color: var(--primary); text-align: center; line-height: 1.6; }
.result-meta      { font-size: 0.72rem; color: var(--dim); text-align: center; min-height: 1em; }
.result-stat      { font-size: 0.72rem; color: var(--dim); letter-spacing: 0.08em; }
.result-stat span { color: var(--action); font-weight: 700; }

.btn-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
}

/* === TOAST === */

#toast-container {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem 1.25rem;
  font-size: 0.78rem;
  color: var(--primary);
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: toast-in 0.2s ease-out, toast-out 0.3s ease-in 2.5s forwards;
}

@keyframes toast-in  { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }

@media (max-width: 480px) {
  .screen { padding: 1rem; gap: 1rem; }
}
