:root {
  --bg-color: #0d0f12;
  --surface-color: #1a1d24;
  --surface-hover: #262a33;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #eab308;
  --accent-hover: #ca8a04;
  --success-color: #10b981;
  --error-color: #ef4444;
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

#app {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Home Page */
.home-header {
  text-align: center;
  margin-bottom: 4rem;
}

.home-title {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.concept-text {
  font-size: 1.5rem;
  color: var(--text-secondary);
  max-width: 900px;
  margin: 0 auto;
  font-weight: 300;
}

.concept-text strong {
  color: var(--accent-color);
  font-weight: 500;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
}

.category-card {
  background-color: #2C3E50;
  border-radius: 16px;
  padding: 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid #3498DB;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 200px;
}

.category-card:hover {
  background-color: #34495e;
  transform: translateY(-5px);
  border-color: #F0922E;
  box-shadow: 0 10px 30px rgba(240, 146, 46, 0.3);
}

.category-card h3 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.category-number {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #F0922E;
  margin-bottom: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Category Page */
.category-header {
  margin-bottom: 3rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.back-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  transition: color 0.2s;
}

.back-btn:hover {
  color: var(--text-primary);
}

.category-page-title {
  font-size: 3rem;
}

.stories-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 800px;
}

.story-card {
  background-color: var(--surface-color);
  border-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  border: 1px solid rgba(255,255,255,0.05);
  overflow: hidden;
  min-height: 180px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.story-card-content {
  padding: 3rem;
  flex: 0 0 60%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.story-card-image {
  flex: 0 0 40%;
  width: 40%;
  background-color: #2a2c33;
}

.story-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0 16px 16px 0;
}

.story-card.active {
  cursor: pointer;
}

.story-card.active:hover {
  background-color: var(--surface-hover);
  border-color: var(--accent-color);
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
}

.story-card.inactive {
  opacity: 0.5;
  cursor: not-allowed;
}

.story-card h4 {
  font-size: 1.6rem;
}

.story-status {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--accent-color);
}

.story-card.inactive .story-status {
  color: var(--text-secondary);
}

/* Bara de navigație din ecranul de poveste — mică, discretă, deasupra imaginii */
.story-nav-bar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.25rem;
}

.story-nav-bar .back-btn {
  font-size: 0.85rem;
  opacity: 0.65;
}

.story-nav-bar .back-btn:hover {
  opacity: 1;
}

/* Story Node Presentation */
.story-node-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  padding: 0;
}

.story-image {
  width: 100%;
  height: auto;
  max-height: 55vh;
  object-fit: contain;
  display: block;
  margin: 0 auto 1rem auto;
  border-radius: 20px;
}

/* Removed image overlay gradient */

.story-text-container {
  text-align: center;
  z-index: 10;
  position: relative;
}

.story-text {
  font-size: 2.2rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  font-weight: 500;
}

.story-title {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.story-buttons {
  display: flex;
  gap: 2rem;
  width: 100%;
  justify-content: center;
  margin-top: 2rem;
}

.btn-large {
  flex: 1;
  max-width: 450px;
  background-color: var(--surface-color);
  color: var(--text-primary);
  border: 2px solid var(--accent-color);
  padding: 1.5rem 2rem;
  font-size: 1.4rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-heading);
  font-weight: 600;
  transition: all 0.2s ease;
  line-height: 1.3;
}

.btn-large:hover {
  background-color: var(--accent-color);
  color: #000;
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(234, 179, 8, 0.2);
}

.btn-primary {
  background-color: var(--accent-color);
  color: #000;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
}

/* Debriefing & Final */
.final-screen {
  background-color: #1a0505;
  transition: background-color 1s ease;
}

.final-screen.success {
  background-color: #061f14;
}

.final-screen .story-image-wrapper::after {
  background: linear-gradient(to top, rgba(26, 5, 5, 1), rgba(26, 5, 5, 0) 80%);
}

.final-screen.success .story-image-wrapper::after {
  background: linear-gradient(to top, rgba(6, 31, 20, 1), rgba(6, 31, 20, 0) 80%);
}

.final-title {
  font-size: 4rem;
  color: var(--accent-color);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.debriefing-container {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem;
}

.debriefing-title {
  font-size: 4rem;
  color: var(--accent-color);
  margin-bottom: 3rem;
}

.debriefing-text {
  font-size: 2.2rem;
  line-height: 1.5;
  white-space: pre-wrap;
  text-align: left;
  background-color: var(--surface-color);
  padding: 3rem;
  border-radius: 16px;
  border-left: 8px solid var(--accent-color);
  margin-bottom: 3rem;
}

.debriefing-moral-question {
  font-size: 3.5rem;
  color: var(--accent-color);
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.debriefing-subtext {
  font-size: 1.5rem;
  color: var(--text-secondary);
  font-weight: 300;
  margin-bottom: 3rem;
}

.debriefing-subtitle {
  font-size: 2.5rem;
  color: var(--text-primary);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  text-align: left;
}

.moral-box {
  background-color: transparent !important;
  border-left: none !important;
  border-bottom: 2px solid var(--accent-color);
  padding: 0 0 2rem 0 !important;
  margin-bottom: 2rem !important;
  font-style: italic;
  color: var(--accent-color);
}

.debrief-list {
  text-align: left;
  font-size: 2rem;
  line-height: 1.6;
  list-style-position: inside;
  color: var(--text-primary);
  margin-bottom: 3rem;
  background-color: var(--surface-color);
  padding: 3rem;
  border-radius: 16px;
  border-left: 8px solid var(--accent-color);
}

.debrief-list li {
  margin-bottom: 1.5rem;
  padding-left: 1rem;
}

.debrief-list li:last-child {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 3rem 2rem;
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.05);
  background-color: rgba(0,0,0,0.2);
}

.about-author {
  max-width: 600px;
  margin: 0 auto 2rem;
  color: var(--text-secondary);
}

.about-author h4 {
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.about-author p {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.5;
}

.footer-copy {
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.5;
}

.footer-logo {
  max-width: 200px;
  height: auto;
  display: block;
  margin: 10px auto;
}

/* Login Screen */
body.login-active {
  background-color: #2C3E50;
}

body.login-active .site-footer {
  display: none;
}

.login-screen {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.login-box {
  background-color: var(--surface-color);
  padding: 4rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  max-width: 600px;
  width: 90%;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.05);
}

.login-title {
  color: #fff;
  font-size: 2.2rem;
  margin-bottom: 1rem;
  line-height: 1.4;
  font-family: var(--font-heading);
}

.login-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.3rem;
  margin-bottom: 3rem;
  line-height: 1.5;
  font-weight: 300;
}

.login-input {
  width: 100%;
  padding: 1.2rem;
  font-size: 1.2rem;
  border-radius: 8px;
  border: 2px solid transparent;
  background-color: rgba(255,255,255,0.05);
  color: #fff;
  margin-bottom: 1.5rem;
  text-align: center;
  font-family: var(--font-body);
  transition: border-color 0.3s;
}

.login-input:focus {
  outline: none;
  border-color: #3498DB;
  background-color: rgba(255,255,255,0.1);
}

.login-btn {
  background-color: #F0922E;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 1.2rem 2.5rem;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.2s;
  width: 100%;
  font-family: var(--font-heading);
}

.login-btn:hover {
  background-color: #e67e22;
  transform: translateY(-2px);
}

.login-error {
  color: #e74c3c;
  margin-top: 1rem;
  font-size: 1rem;
}

/* Regulile pe scurt, pe ecranul de invitație — pentru echipele fără facilitator. */
.story-rules {
  margin-top: 1.25rem;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-secondary);
  font-style: italic;
}

/* Ecranul „Ce nu ați văzut": perechile de opțiuni care duceau în același loc. */
.dezvaluire-lista {
  margin: 1rem 0;
  padding-left: 1.25rem;
  text-align: left;
}
.dezvaluire-lista li {
  margin: 0.4rem 0;
}

/* --- Vot live pe telefoane (vot.js, doar pachetul full) --- */
.vot-porneste { margin-top: 1rem; opacity: 0.85; }
.vot-panou {
  display: flex; align-items: center; justify-content: center; gap: 1.5rem; flex-wrap: wrap;
  font-size: 1.2rem; color: var(--text-secondary); margin-top: 1rem;
}
.vot-panou b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.vot-punct {
  display: inline-block; width: 0.6em; height: 0.6em; border-radius: 50%; margin-right: 0.5em;
  background: var(--success-color); animation: vot-puls 1.4s ease-in-out infinite;
}
@keyframes vot-puls { 50% { opacity: 0.3; } }
.vot-inchide {
  background: none; border: 1px solid var(--text-secondary); color: var(--text-primary);
  border-radius: 8px; padding: 0.4rem 1rem; font: inherit; font-size: 1rem; cursor: pointer;
}
/* Rezultatul: bara de procent se umple în fundalul butonului alegerii. */
.btn-large[style*="--vot-pct"] {
  background-image: linear-gradient(90deg, rgba(234, 179, 8, 0.28) var(--vot-pct), transparent var(--vot-pct));
}
.btn-large.vot-majoritate { box-shadow: 0 0 0 3px var(--accent-color), 0 0 24px rgba(234, 179, 8, 0.35); }
.vot-procent {
  display: block; margin-top: 0.5rem; font-size: 1.6rem; font-weight: 700;
  color: var(--accent-color); font-variant-numeric: tabular-nums;
}
.btn-large:hover .vot-procent { color: #000; }
.vot-insigna {
  position: fixed; right: 16px; bottom: 16px; z-index: 50;
  background: var(--surface-color); color: var(--text-primary); border: 1px solid var(--surface-hover);
  border-radius: 999px; padding: 0.5rem 1rem; font: inherit; font-size: 0.95rem; cursor: pointer; opacity: 0.8;
}
.vot-insigna.deconectat { color: var(--error-color); }
.vot-fereastra {
  position: fixed; inset: 0; z-index: 100; background: var(--bg-color);
  display: flex; align-items: safe center; justify-content: center; padding: 16px; overflow-y: auto;
}
.vot-fereastra-continut { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.vot-fereastra p { margin: 0; }
.vot-fereastra h2 { font-size: 2rem; }
.vot-qr { background: #fff; border-radius: 16px; padding: 12px; width: min(42vh, 80vw); }
.vot-qr svg { display: block; width: 100%; height: auto; }
.vot-adresa { font-size: 1.6rem; color: var(--text-primary); }
.vot-cod { font-size: 2.5rem; letter-spacing: 0.2em; color: var(--accent-color); }
.vot-conectati { color: var(--text-secondary); font-size: 1.2rem; }
.vot-fereastra .btn-large { flex: none; margin-top: 0.5rem; }
