/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #fdf6ee;
  color: #3a2a1a;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

.game h1 {
  margin-bottom: 4px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.subtitle {
  color: #6b5844;
  margin-top: 0;
}

.counters {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.qa-log {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  border: 1px solid #e7d8c3;
  border-radius: 8px;
  background: #fff;
}

.qa-log li {
  padding: 8px 12px;
  border-bottom: 1px solid #f0e6d8;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qa-log li.empty {
  color: #9a8a76;
  font-style: italic;
}

.qa-log .reason {
  color: #9a8a76;
  font-size: 0.78rem;
}

.qa-log .q {
  font-weight: 600;
}

.qa-log .a {
  color: #b5651d;
}

#question_form, #guess_form {
  margin-bottom: 12px;
}

#question_form form, #guess_form form {
  display: flex;
  gap: 8px;
}

#question_form input[type="text"], #guess_form input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d8c7ac;
  border-radius: 6px;
}

.guess-trigger {
  margin-bottom: 16px;
}

.guess-open-btn {
  width: 100%;
  background: #fff;
  color: #b5651d;
  border: 1px solid #d97b29;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 42, 26, 0.4);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  position: relative;
  background: #fdf6ee;
  border-radius: 10px;
  padding: 24px 20px;
  width: min(360px, 100%);
  box-sizing: border-box;
}

.modal h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  color: #6b5844;
  border: none;
  padding: 4px 8px;
  font-size: 1.1rem;
  line-height: 1;
}

button, input[type="submit"] {
  background: #d97b29;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
}

button:disabled, input[type="submit"]:disabled {
  background: #e0c9ac;
  cursor: not-allowed;
}

.error {
  color: #b3261e;
  margin: 4px 0 0;
}

.turbo-progress-bar {
  visibility: hidden;
}

.thinking {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  color: #8a6a3d;
  font-size: 0.9rem;
}

.thinking.is-visible {
  display: flex;
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid #e0c9ac;
  border-top-color: #d97b29;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.not-ready {
  color: #6b5844;
  background: #fff;
  border: 1px solid #e7d8c3;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
}

.character-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid #e7d8c3;
  border-radius: 12px;
  background: #fff;
  height: 420px;
}

.character-stage canvas {
  height: 100%;
  aspect-ratio: 1 / 1;
}

.bonus-round {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #f0c46b;
  border-radius: 8px;
  background: #fff8e6;
}

.bonus-title {
  margin-top: 0;
  font-weight: 600;
}

.bonus-hints {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

.bonus-hints li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 0;
  border-bottom: 1px solid #f0e6d8;
}

.bonus-hints .a {
  color: #b5651d;
}

.bonus-round form {
  display: flex;
  gap: 8px;
}

.bonus-round input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d8c7ac;
  border-radius: 6px;
}

.bonus-label {
  font-weight: 600;
  color: #b5651d;
}

.admin-page {
  max-width: 900px;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid #e7d8c3;
  font-size: 0.9rem;
}

.admin-nav a {
  color: #6b5844;
  text-decoration: none;
}

.admin-nav a.active {
  color: #b5651d;
  font-weight: 600;
}

.admin-nav-sep {
  color: #d8c7ac;
}

.admin-btn {
  background: #d97b29;
  color: #fff;
  border-radius: 6px;
  padding: 8px 14px;
  text-decoration: none;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e7d8c3;
  margin: 16px 0;
}

.admin-table th, .admin-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0e6d8;
  text-align: left;
}

.admin-table .empty {
  color: #9a8a76;
  font-style: italic;
  text-align: center;
}

.admin-table .actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-form {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
