/* Incremental styles for the Road to Solos Gems mini game. Reuses the same
   CSS variables defined in styles.css (--ink, --paper, --panel, --card,
   --line, --rust, --rust-dark, --ok) so it stays visually part of the site. */

.gq-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 4px 60px;
}

.gq-lede {
  color: var(--ink-soft);
  margin-bottom: 20px;
}

/* ---- title / save screen ---- */
.gq-panel {
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 22px;
}

.gq-panel h2 {
  margin-top: 0;
}

#gq-save-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0 20px;
}

.gq-empty {
  color: var(--ink-soft);
  font-style: italic;
}

.gq-save-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.gq-save-btn {
  flex: 1;
  text-align: left;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}

.gq-save-btn:hover {
  border-color: var(--rust-dark);
}

.gq-save-btn span {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.gq-save-del {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  width: 42px;
  font-size: 1.2rem;
  cursor: pointer;
  line-height: 1;
}

.gq-save-del:hover {
  color: var(--rust-dark);
  border-color: var(--rust-dark);
}

#gq-new-form {
  display: flex;
  gap: 10px;
}

#gq-new-name {
  flex: 1;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--ink);
  font-size: 0.95rem;
}

#gq-new-form button {
  background: var(--rust);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

#gq-new-form button:hover {
  background: var(--rust-dark);
}

/* ---- in-game ---- */
#gq-game {
  position: relative;
}

.gq-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.gq-hud-left {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.gq-hud-left strong {
  color: var(--ink);
}

.gq-hud-buttons {
  display: flex;
  gap: 8px;
}

.gq-hud-buttons button {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 7px;
  color: var(--ink-soft);
  padding: 6px 12px;
  font-size: 0.8rem;
  cursor: pointer;
}

.gq-hud-buttons button:hover {
  color: var(--ink);
  border-color: var(--rust-dark);
}

#gq-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
  min-height: 26px;
}

.gq-inv-label {
  color: var(--ink-soft);
  font-size: 0.82rem;
  align-self: center;
}

.gq-inv-empty {
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-style: italic;
  align-self: center;
}

.gq-item-chip {
  background: var(--card);
  border: 2px solid var(--rust);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  cursor: default;
}

/* ---- scene: image + text side by side on wider screens, stacked on narrow ---- */
.gq-stage {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.gq-scene-frame {
  position: relative;
  flex: 0 0 230px;
  width: 230px;
  height: 230px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.gq-scene-frame.gq-win-glow {
  border-color: var(--rust);
  animation: gq-glow-pulse 1.6s ease-in-out infinite;
}

@keyframes gq-glow-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 138, 46, 0.55); }
  50% { box-shadow: 0 0 22px 6px rgba(201, 138, 46, 0.55); }
}

#gq-scene-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

#gq-scene-img.gq-loading {
  opacity: 0.55;
}

.gq-stage-text {
  flex: 1;
  min-width: 0;
}

#gq-scene-title {
  margin: 0 0 6px;
  font-size: 1.15rem;
}

#gq-scene-text {
  color: var(--ink-soft);
  margin: 0;
  line-height: 1.6;
  font-size: 0.93rem;
}

.gq-win-banner {
  display: inline-block;
  background: var(--rust);
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 8px;
  animation: gq-banner-bounce 0.5s ease;
}

@keyframes gq-banner-bounce {
  0% { transform: scale(0.4); opacity: 0; }
  60% { transform: scale(1.12); opacity: 1; }
  100% { transform: scale(1); }
}

@media (max-width: 620px) {
  .gq-stage { flex-direction: column; }
  .gq-scene-frame { width: 100%; height: 190px; flex-basis: auto; }
}

#gq-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gq-choice-btn {
  text-align: left;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 11px 16px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.94rem;
  cursor: pointer;
}

.gq-choice-btn:hover {
  border-color: var(--rust-dark);
  background: var(--card);
}

.gq-choice-again {
  border-color: var(--rust);
}

.gq-choice-start {
  border-color: var(--rust);
  font-weight: 700;
}

.gq-cta {
  display: block;
  text-align: center;
  background: var(--rust);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  padding: 13px 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.gq-cta:hover {
  background: var(--rust-dark);
  color: #fff;
}

/* ---- dice roll ---- */
#gq-dice-area {
  text-align: center;
  padding: 10px 0 4px;
}

.gq-dice-spin {
  animation: gq-spin 0.75s cubic-bezier(0.2, 0.6, 0.3, 1);
}

@keyframes gq-spin {
  0% { transform: rotate(0deg) scale(0.8); }
  60% { transform: rotate(540deg) scale(1.08); }
  100% { transform: rotate(720deg) scale(1); }
}

#gq-dice-result {
  margin-top: 10px;
  font-family: "IBM Plex Mono", monospace;
  color: var(--ink-soft);
  min-height: 1.4em;
  font-size: 0.88rem;
}

/* ---- minigames ---- */
#gq-minigame-area {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.gq-mg-instructions {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

.gq-mg-target {
  font-family: "IBM Plex Mono", monospace;
  font-style: italic;
  color: var(--ink);
  margin: 0 0 10px;
  font-size: 0.95rem;
}

#gq-minigame-area input[type="text"] {
  width: 100%;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  font-size: 0.95rem;
  box-sizing: border-box;
}

#gq-minigame-area input[type="text"]:focus {
  outline: none;
  border-color: var(--rust-dark);
}

.gq-mg-facts {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gq-mg-fact-btn {
  text-align: left;
  background: var(--panel);
  border: 2px solid var(--line);
  border-radius: 7px;
  padding: 10px 14px;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}

.gq-mg-fact-btn:hover {
  border-color: var(--rust-dark);
}

.gq-mg-sentence {
  line-height: 2.2;
  margin: 0;
}

.gq-mg-word {
  display: inline-block;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  color: var(--ink);
}

.gq-mg-word:hover {
  background: var(--panel);
  text-decoration: underline;
}

.gq-mg-word.gq-mg-wrong {
  color: var(--ink-soft);
  text-decoration: line-through;
  cursor: default;
  background: none;
}

.gq-mg-glow {
  background: rgba(201, 138, 46, 0.28);
  box-shadow: 0 0 0 2px rgba(201, 138, 46, 0.5);
}

.gq-mg-timer {
  font-family: "IBM Plex Mono", monospace;
  color: var(--rust-dark);
  font-weight: 700;
  margin: 10px 0 0;
  font-size: 0.85rem;
}

.gq-mg-result {
  color: var(--ink);
  font-size: 0.9rem;
  margin: 0;
}

@media (max-width: 480px) {
  .gq-hud { flex-direction: column; align-items: flex-start; }
}

/* ---- win confetti ---- */
.gq-winfx {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}

.gq-winfx-piece {
  position: absolute;
  top: -30px;
  animation-name: gq-fall;
  animation-timing-function: ease-in;
  animation-fill-mode: forwards;
}

@keyframes gq-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(260px) rotate(340deg); opacity: 0; }
}
