/* ========================================
   Good Employee — Stylesheet
   A Slow AI Game
   ======================================== */

/* --- Reset & Base --- */

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

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: #F5F0E8;
  color: #3D3D3D;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Screens --- */

.screen {
  display: none;
  opacity: 0;
  transition: opacity 300ms ease;
  padding: 40px 20px 60px;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: block;
}

.screen.visible {
  opacity: 1;
}

#screen-game {
  padding-top: 24px;
}

.container {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.game-content,
.ending-content {
  text-align: left;
}

/* --- Progress Bar --- */

.progress-track {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(42, 107, 107, 0.15);
  z-index: 100;
}

.progress-fill {
  height: 100%;
  background: #2A6B6B;
  width: 0%;
  transition: width 500ms ease;
}

/* --- Typography --- */

h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.5rem;
  font-weight: normal;
  color: #2A6B6B;
  letter-spacing: 0.02em;
  margin: 0.5em 0 0.3em;
  text-align: center;
}

h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.6rem;
  font-weight: normal;
  color: #2A6B6B;
  margin: 0 0 0.8em;
}

h3 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  font-weight: normal;
  color: #2A6B6B;
  margin: 1.5em 0 0.5em;
}

.tagline {
  font-size: 0.95rem;
  color: #7A9B7A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 2em;
  text-align: center;
}

.intro {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3D3D3D;
  text-align: center;
  margin: 0 0 0.5em;
}

/* --- Title Screen --- */

.title-badge {
  text-align: center;
  margin: 0 0 1em;
}

.title-badge svg {
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

/* --- Buttons --- */

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  font-size: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: all 300ms ease;
  border: none;
  text-decoration: none;
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  outline: 2px solid #C17B4A;
  outline-offset: 2px;
}

.btn-primary {
  background: #2A6B6B;
  color: #F5F0E8;
  border: 1.5px solid #2A6B6B;
}

.btn-primary:hover {
  background: #235959;
  border-color: #235959;
}

.btn-secondary {
  background: transparent;
  color: #2A6B6B;
  border: 1.5px solid #2A6B6B;
}

.btn-secondary:hover {
  background: #2A6B6B;
  color: #F5F0E8;
}

/* --- Choice Buttons --- */

.choices {
  margin: 1.5em 0;
}

.btn-choice {
  display: block;
  width: 100%;
  padding: 0.9rem 1.2rem;
  margin: 0 0 0.6em;
  border-radius: 4px;
  font-size: 1rem;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.5;
  cursor: pointer;
  transition: all 300ms ease;
  border: 1.5px solid #2A6B6B;
  background: #F5F0E8;
  color: #2A6B6B;
  text-align: left;
}

.btn-choice:hover {
  background: #2A6B6B;
  color: #F5F0E8;
}

.btn-choice:active {
  transform: scale(0.98);
}

.btn-choice:focus-visible {
  outline: 2px solid #C17B4A;
  outline-offset: 2px;
}

.btn-choice:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* --- MIRA Text --- */

.mira-line {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3D3D3D;
  margin: 0 0 0.7em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.mira-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Description Text --- */

.desc-line {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #5C5C5C;
  font-style: italic;
  margin: 0 0 0.6em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.desc-line.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- System Messages --- */

.system-msg {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9rem;
  color: #5C5C5C;
  opacity: 0;
  margin: 1.2em 0 0.4em;
  transition: opacity 300ms ease;
}

.system-msg.visible {
  opacity: 0.6;
}

.system-msg.fade {
  opacity: 0;
}

/* --- Poem Display --- */

.poem-container {
  border-left: 3px solid #C17B4A;
  background: rgba(193, 123, 74, 0.04);
  padding: 1.2em 1.5em;
  margin: 1.5em 0;
  opacity: 0;
  transition: opacity 400ms ease;
}

.poem-container.visible {
  opacity: 1;
}

.poem-title {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #C17B4A;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 1em;
  opacity: 0.7;
}

.poem-line {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.8;
  color: #3D3D3D;
  margin: 0;
  opacity: 0;
  transition: opacity 500ms ease;
}

.poem-line.visible {
  opacity: 1;
}

.poem-dismissal {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 0.9rem;
  font-style: italic;
  color: #5C5C5C;
  margin: 1.2em 0 0;
  opacity: 0;
  transition: opacity 400ms ease;
}

.poem-dismissal.visible {
  opacity: 1;
}

/* --- Text Input --- */

.text-input-container {
  margin: 1.5em 0;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 400ms ease, transform 400ms ease;
}

.text-input-container.visible {
  opacity: 1;
  transform: translateY(0);
}

.text-input {
  display: block;
  width: 100%;
  padding: 0.8rem 1rem;
  font-family: 'Courier New', Courier, monospace;
  font-size: 1rem;
  line-height: 1.5;
  color: #3D3D3D;
  background: #F5F0E8;
  border: 1.5px solid #2A6B6B;
  border-radius: 4px;
  transition: border-color 300ms ease, box-shadow 300ms ease;
}

.text-input:focus {
  outline: none;
  border-color: #C17B4A;
  box-shadow: 0 0 0 2px rgba(193, 123, 74, 0.2);
}

.text-input::placeholder {
  color: #B4AFA7;
}

.btn-submit {
  display: block;
  width: 100%;
  margin-top: 0.6em;
  padding: 0.7rem 1.2rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: all 300ms ease;
  border: 1.5px solid #2A6B6B;
  background: #2A6B6B;
  color: #F5F0E8;
}

.btn-submit:hover {
  background: #235959;
}

.btn-submit:active {
  transform: scale(0.98);
}

.btn-submit:focus-visible {
  outline: 2px solid #C17B4A;
  outline-offset: 2px;
}

.btn-submit:disabled {
  opacity: 0.4;
  cursor: default;
}

/* --- Continue Button --- */

.btn-continue {
  display: inline-block;
  margin: 1.5em 0;
  padding: 0.7rem 2rem;
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  cursor: pointer;
  transition: all 300ms ease;
  border: 1.5px solid #2A6B6B;
  background: transparent;
  color: #2A6B6B;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 400ms ease, transform 400ms ease, background 300ms ease, color 300ms ease;
}

.btn-continue.visible {
  opacity: 1;
  transform: translateY(0);
}

.btn-continue:hover {
  background: #2A6B6B;
  color: #F5F0E8;
}

.btn-continue:active {
  transform: scale(0.98);
}

.btn-continue:focus-visible {
  outline: 2px solid #C17B4A;
  outline-offset: 2px;
}

/* --- Ending Screen --- */

.ending-content {
  text-align: left;
}

.ending-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.8rem;
  font-weight: normal;
  color: #2A6B6B;
  margin: 0 0 1.5em;
  text-align: center;
}

.ending-icon {
  display: block;
  margin: 0 auto 0.5em;
  color: #C17B4A;
  line-height: 1;
}

.ending-icon svg {
  width: 36px;
  height: auto;
}

.ending-line {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.05rem;
  line-height: 1.7;
  color: #3D3D3D;
  margin: 0 0 0.7em;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 500ms ease, transform 500ms ease;
}

.ending-line.visible {
  opacity: 1;
  transform: translateY(0);
}

.final-poem-container {
  border-left: 3px solid #C17B4A;
  background: rgba(193, 123, 74, 0.04);
  padding: 1.2em 1.5em;
  margin: 2em 0;
  opacity: 0;
  transition: opacity 400ms ease;
}

.final-poem-container.visible {
  opacity: 1;
}

.final-poem-line {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  font-style: italic;
  line-height: 1.8;
  color: #3D3D3D;
  margin: 0;
  opacity: 0;
  transition: opacity 500ms ease;
}

.final-poem-line.visible {
  opacity: 1;
}

.ending-reflection {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #5C5C5C;
  font-style: italic;
  border-top: 1px solid rgba(42, 107, 107, 0.2);
  padding-top: 1.5em;
  margin-top: 2em;
  opacity: 0;
  transition: opacity 600ms ease;
}

.ending-reflection.visible {
  opacity: 1;
}

.ending-continue {
  text-align: center;
  margin-top: 2em;
  opacity: 0;
  transition: opacity 400ms ease;
}

.ending-continue.visible {
  opacity: 1;
}

/* --- Share Screen --- */

.share-box {
  margin: 1.5em 0;
  text-align: center;
}

#share-canvas {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid rgba(42, 107, 107, 0.15);
  margin-bottom: 1em;
  aspect-ratio: 1200 / 630;
}

.share-buttons {
  display: flex;
  gap: 0.8em;
  justify-content: center;
  flex-wrap: wrap;
}

.share-text-hidden {
  position: absolute;
  left: -9999px;
  opacity: 0;
}

.share-reflection {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  line-height: 1.7;
  color: #5C5C5C;
  font-style: italic;
  text-align: center;
  margin: 0 0 1.5em;
}

.share-actions {
  display: flex;
  gap: 0.8em;
  justify-content: center;
  flex-wrap: wrap;
  margin: 1.5em 0;
}

/* --- Debrief --- */

.debrief {
  text-align: left;
  border-top: 1px solid rgba(42, 107, 107, 0.2);
  padding-top: 1.5em;
  margin-top: 2em;
}

.debrief h3 {
  margin-top: 0;
}

.debrief-stats {
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  color: #5C5C5C;
  margin: 0 0 1.2em;
}

.debrief-line {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #5C5C5C;
  margin: 0 0 0.8em;
}

.debrief-bridge {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #3D3D3D;
  font-style: italic;
  margin: 1.2em 0 0;
}

/* --- What Next --- */

.what-next {
  text-align: left;
  border-top: 1px solid rgba(42, 107, 107, 0.2);
  padding-top: 1.5em;
  margin-top: 2em;
}

.what-next h3 {
  margin-top: 0;
}

.what-next p {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #5C5C5C;
  margin: 0 0 0.6em;
}

.game-links {
  display: flex;
  gap: 0.8em;
  flex-wrap: wrap;
}

.game-link {
  flex: 1;
  min-width: 120px;
}

/* --- Footer --- */

.footer-link {
  text-align: center;
  margin-top: 2em;
  font-size: 0.9rem;
}

.footer-link a {
  color: #5C5C5C;
  text-decoration: none;
  transition: color 300ms ease;
}

.footer-link a:hover {
  color: #2A6B6B;
}

/* --- Responsive --- */

@media (max-width: 480px) {
  h1 {
    font-size: 1.8rem;
  }

  h2 {
    font-size: 1.3rem;
  }

  .screen {
    padding: 30px 16px 50px;
    height: 100vh;
  }

  .mira-line,
  .ending-line {
    font-size: 1rem;
  }

  .btn-choice {
    font-size: 0.95rem;
    padding: 0.8rem 1rem;
  }

  #share-canvas {
    display: none;
  }

  .title-badge svg {
    width: 90px;
    height: auto;
  }

  .intro {
    font-size: 1rem;
  }
}

/* --- Accessibility --- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
