/* ===== GLOBAL GAME PAGE LAYOUT ===== */
.game-page,
.game-page * {
  box-sizing: border-box;
}

.game-page {
  --bg-page: #f5f6f8;
  --panel-bg: #ffffff;
  --panel-border: rgba(0,0,0,0.08);
  --text-main: #1a1a1a;
  --text-dim: #6b7280;
  --radius-lg: 16px;
  --radius-md: 12px;
  --shadow-card: 0 16px 32px rgba(0,0,0,.07);

  background: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 4rem;
}

/* ===== HERO STRIP (red / blue / green band) ===== */
.game-hero {
  background: var(--accent, #ff4d57);
  color: #fff;
  padding: 3rem 1rem 4rem; /* more top/bottom air to match mock */
}

@media(min-width:768px){
  .game-hero {
    padding: 4rem 1rem 5rem;
  }
}

.game-hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: 2rem;
  align-items: flex-start;
}

@media(min-width:900px){
  .game-hero-inner {
    grid-template-columns: minmax(0,1fr) 260px;
  }
}

/* ===== MAIN GAME CARD (white card in hero band) ===== */
.game-card.main-card {
  background: var(--panel-bg);
  color: var(--text-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--panel-border);
  padding: 1.25rem 1.25rem 1.5rem;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
}

@media(min-width:480px){
  .game-card.main-card {
    padding: 1.5rem 1.5rem 2rem;
  }
}

.main-card-head {
  margin-bottom: 1rem;
}

.main-card-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
  margin: 0 0 .5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.main-card-desc {
  font-size: .85rem;
  line-height: 1.4;
  color: var(--text-dim);
  margin: 0;
  max-width: 480px;
}

/* ===== GUESS ROW (Your Guess + Submit) ===== */
.guess-row {
  margin-top: 1.25rem;
  margin-bottom: 2rem;
}

.guess-label {
  font-size: .75rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: .5rem;
  display: block;
}

.guess-flex {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: flex-start;
}

.guess-input {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--panel-border) !important;
  border-radius: var(--radius-md);
  font-size: .9rem;
  padding: .6rem .75rem;
  background:#fff;
  color:#1a1a1a;
  outline: none;
  line-height:1.3;
}

.guess-input:focus {
  border-color: var(--accent, #ff4d57) !important;
  box-shadow: 0 0 0 3px rgba(255,77,87,.25);
}

.guess-submit {
  background: var(--accent, #ff4d57);
  color:#fff;
  font-size:.9rem;
  font-weight:600;
  border-radius: var(--radius-md);
  padding: .6rem .9rem;
  border: none;
  cursor: pointer;
  line-height:1.3;
  white-space: nowrap;
}

.guess-hint {
  font-size: .7rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-top: .75rem;
  max-width: 360px;
}

/* ===== HERO SIDE COLUMN (emoji bubble + ad card) ===== */
.hero-side {
  display: grid;
  gap: 1rem;
  max-width: 260px;
  width: 100%;
  margin: 0 auto;
}

@media(min-width:900px){
  .hero-side {
    margin-top: 2rem; /* nudge downward to align visually with card center */
  }
}

.hero-art {
  display: flex;
  justify-content: center;
}

.hero-art-circle {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(0,0,0,.15);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:2rem;
  color:#fff;
  font-weight:600;
  text-shadow: 0 2px 4px rgba(0,0,0,.4);
}

.hero-emoji {
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.4));
}

.hero-ad .ad-box {
  background:#fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  border:1px solid var(--panel-border);
  min-height:60px;
  font-size:.8rem;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--text-dim);
  line-height:1.3;
  text-align:center;
}

/* ===== ATTEMPTS SECTION ===== */

.attempts-area {
  position: relative;
  margin: 0 auto;
  max-width: 680px;
  width: 100%;
  text-align: left;
  margin-bottom: 2rem;
}

.attempts-header {
  margin-bottom: .75rem;
  text-align: center;
}

.attempts-header h2 {
  font-size: .8rem;
  font-weight:600;
  color: var(--text-main);
  margin:0;
}

.attempts-grid {
  display: grid;
  gap: .75rem;
  justify-content: center;
}

@media(min-width:480px){
  .attempts-grid {
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Individual attempt tiles */
.attempt-card {
  background:#fff;
  border-radius: var(--radius-md);
  border:1px solid var(--panel-border);
  box-shadow: var(--shadow-card);
  padding:.75rem .75rem .9rem;
  font-size:.8rem;
  line-height:1.4;
}

.attempt-top {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  font-size:.7rem;
  margin-bottom:.5rem;
  line-height:1.3;
  color:var(--text-dim);
}

.attempt-num {
  font-weight:500;
  color:var(--text-main);
}

.attempt-status.win {
  color: var(--accent, #ff4d57);
  font-weight:600;
}

.attempt-status.miss {
  color:#6b7280;
}

.attempt-guess {
  font-size:.8rem;
  font-weight:500;
  color:var(--text-main);
  word-break:break-word;
}

/* Floating "You Win!" card */
.result-overlay {
  position: absolute;
  left: 50%;
  transform: translate(-50%, -10%);
  top: 0;
  background:#fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border:1px solid var(--panel-border);
  padding:1rem 1rem 1.25rem;
  text-align:center;
  width: 220px;
}

@media(min-width:768px){
  .result-overlay {
    width: 240px;
  }
}

.result-head {
  font-size:.9rem;
  font-weight:600;
  color:var(--text-main);
  margin:0 0 .5rem;
  line-height:1.3;
}

.result-detail {
  font-size:.75rem;
  color:var(--text-main);
  line-height:1.4;
  margin-bottom: .75rem;
}

.share-btn {
  background: var(--accent, #ff4d57);
  color:#fff;
  font-size:.8rem;
  font-weight:600;
  border:none;
  border-radius: var(--radius-md);
  padding:.6rem .9rem;
  cursor:pointer;
  width:100%;
  line-height:1.3;
}

/* ===== INLINE AD BLOCK ===== */

.mid-ad-area {
  margin: 2.5rem auto 2rem;
  max-width: 680px;
  width:100%;
  display:flex;
  justify-content:center;
}

.mid-ad .ad-box {
  background:#fff;
  border-radius: var(--radius-md);
  border:1px solid var(--panel-border);
  box-shadow: var(--shadow-card);
  min-height:60px;
  min-width:120px;
  font-size:.8rem;
  color:var(--text-dim);
  display:flex;
  align-items:center;
  justify-content:center;
  line-height:1.3;
  text-align:center;
  padding:.75rem 1rem;
}

/* ===== SCOREBOARD ===== */

.scoreboard-area {
  margin: 0 auto 0;
  max-width: 680px;
  width:100%;
  text-align:center;
}

.scoreboard-header {
  margin-bottom: .75rem;
}

.scoreboard-header h2 {
  font-size: .8rem;
  font-weight:600;
  color:var(--text-main);
  margin:0;
}

.scoreboard-grid {
  display: grid;
  gap: .75rem;
  justify-content:center;
}

@media(min-width:480px){
  .scoreboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px,1fr));
    max-width: 400px;
    margin-left:auto;
    margin-right:auto;
  }
}

.score-card {
  background:#fff;
  border-radius: var(--radius-md);
  border:1px solid var(--panel-border);
  box-shadow: var(--shadow-card);
  padding:.75rem .75rem .9rem;
  text-align:center;
  line-height:1.4;
}

.score-label {
  font-size:.7rem;
  color:var(--text-dim);
  margin-bottom:.4rem;
  font-weight:500;
  line-height:1.3;
}

.score-value {
  font-size:1rem;
  font-weight:600;
  color:var(--text-main);
  line-height:1.3;
}

/* ===== SITE FOOTER BAR ===== */
.game-footer {
  background:#1f242f;
  color:#d1d5db;
  font-size:.7rem;
  line-height:1.3;
  margin-top: 0;
}

.game-footer-inner {
  max-width:1200px;
  margin:0 auto;
  padding:1rem;
  display:flex;
  justify-content:center;
  align-items:center;
  gap:.5rem;
  flex-wrap:wrap;
}

.game-footer-inner a {
  color:#d1d5db;
  text-decoration:none;
  font-weight:500;
}

.game-footer-inner a:hover {
  text-decoration:underline;
}

/* =========================================================
   GEMINI SKIN EXTENSION
   ========================================================= */

/* light gray app background around shell */
.qm-frame {
  background: #eef0f3;
  padding: 1.5rem 1rem 4rem;
  min-height: calc(100vh - 3rem); /* gives room for footer */
  display: flex;
  justify-content: center;
  font-family: inherit;
}

/* rounded white "phone shell" */
.qm-shell {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 28px 48px rgba(0,0,0,.12);
  border: 1px solid rgba(0,0,0,.05);
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #111827;
}

/* red hero header */
.qm-hero {
  background: #ff4d57;
  position: relative;
  padding: 1.25rem 1rem 2rem;
  color: #fff;
}

/* blurred car-ish bg zone */
.qm-hero-art {
  position: relative;
  height: 120px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0,0,0,.15);
  box-shadow: 0 20px 40px rgba(0,0,0,.4) inset;
  margin-bottom: -2rem; /* pull the white card upward overlap */
}
.qm-hero-bg {
  width:100%;
  height:100%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.35) 0%, rgba(0,0,0,0) 60%);
  filter: blur(2px);
  opacity: .7;
}

/* white game card that overlaps hero */
.qm-card {
  background: #ffffff;
  color: #111827;
  border-radius: 12px;
  box-shadow: 0 24px 40px rgba(0,0,0,.18);
  border: 1px solid rgba(0,0,0,.08);
  padding: 1rem 1rem 1.5rem;
  position: relative;
}
.qm-title {
  font-size: 1.4rem;
  line-height:1.2;
  font-weight:600;
  color:#111827;
  display:flex;
  align-items:center;
  gap:.5rem;
  margin:0 0 1rem;
}

/* little gray safety/info block */
.qm-safety {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:.75rem;
  background:#f9fafb;
  border:1px solid rgba(0,0,0,.08);
  border-radius:8px;
  padding:.75rem .75rem;
  box-shadow:0 8px 16px rgba(0,0,0,.05);
  margin-bottom:1rem;
  font-size:.8rem;
  line-height:1.3;
  color:#4b5563;
}
.qm-safety-copy strong {
  color:#111827;
  font-weight:600;
  font-size:.8rem;
  line-height:1.2;
}
.qm-safety-desc {
  font-size:.75rem;
  line-height:1.3;
  color:#4b5563;
  display:block;
  margin-top:.25rem;
  max-width:220px;
}
.qm-safety-meta {
  display:flex;
  flex-shrink:0;
  gap:.5rem;
}
.qm-mini-btn {
  width:28px;
  height:28px;
  border-radius:6px;
  background:#fff;
  border:1px solid rgba(0,0,0,.15);
  font-size:.75rem;
  font-weight:600;
  line-height:28px;
  text-align:center;
  color:#374151;
  box-shadow:0 6px 12px rgba(0,0,0,.08);
}

/* Guess block */
.qm-guess { margin-bottom:1.5rem; }
.qm-label {
  display:block;
  font-size:.8rem;
  font-weight:500;
  color:#111827;
  margin-bottom:.5rem;
  line-height:1.2;
}
.qm-guess-row {
  display:flex;
  flex-wrap:nowrap;
  gap:.5rem;
}
.qm-input {
  flex:1;
  min-width:0;
  border:1px solid rgba(0,0,0,.18);
  border-radius:6px;
  background:#fff;
  color:#1f2937;
  font-size:.9rem;
  line-height:1.3;
  padding:.6rem .75rem;
  outline:none;
}
.qm-input:focus{
  border-color:#ff4d57;
  box-shadow:0 0 0 3px rgba(255,77,87,.25);
}
.qm-submit {
  background:#ff4d57;
  color:#fff;
  font-size:.8rem;
  font-weight:600;
  border:none;
  border-radius:6px;
  line-height:1.2;
  white-space:nowrap;
  padding:.6rem .9rem;
  cursor:pointer;
  box-shadow:0 8px 16px rgba(255,77,87,.4);
}
.qm-next {
  width:100%;
  margin-top:.75rem;
  text-align:center;
}
.qm-hint {
  font-size:.7rem;
  line-height:1.4;
  color:#6b7280;
  margin-top:.6rem;
}
.qm-feedback {
  background:#fff;
  border-radius:6px;
  border:1px solid rgba(0,0,0,.15);
  box-shadow:0 12px 24px rgba(0,0,0,.12);
  font-size:.8rem;
  line-height:1.4;
  text-align:center;
  font-weight:600;
  padding:.75rem;
  margin-top:.75rem;
  color:#111827;
}
.qm-answer {
  font-size:.75rem;
  text-align:center;
  color:#6b7280;
  margin-top:.75rem;
  line-height:1.4;
}

/* Attempts / clues block */
.qm-attempts {
  background:#ffffff;
  padding:1rem 1rem 1.5rem;
}
.qm-block-head {
  font-size:.8rem;
  font-weight:600;
  color:#111827;
  margin:0 0 .75rem;
  line-height:1.2;
}
.qm-attempts-grid {
  display:grid;
  gap:.75rem;
}
.qm-attempt-tile {
  background:#fff;
  border-radius:8px;
  border:2px solid #ff4d57;
  box-shadow:0 8px 16px rgba(0,0,0,.05);
  padding:.75rem .75rem .9rem;
  font-size:.8rem;
  line-height:1.4;
}
.qm-attempt-top {
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  font-size:.7rem;
  line-height:1.3;
  margin-bottom:.5rem;
  color:#4b5563;
}
.qm-attempt-num {
  font-weight:600;
  color:#111827;
}
.qm-attempt-status {
  font-weight:600;
  color:#ff4d57;
}
.qm-attempt-body {
  font-size:.8rem;
  font-weight:500;
  color:#111827;
  word-break:break-word;
}

/* Win/Lose popup w/ confetti bar */
.qm-result {
  position:relative;
  margin-top:1rem;
  background:#fff;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 24px 40px rgba(0,0,0,.18);
  max-width:260px;
  padding-top:0;
}
.qm-confetti {
  height:24px;
  border-radius:12px 12px 0 0;
  background-image: repeating-linear-gradient(
    -45deg,
    #ff4d57 0 8px,
    #ffd54a 8px 16px,
    #4b70dd 16px 24px,
    #10b981 24px 32px
  );
}
.qm-result-inner {
  padding:1rem .75rem 1rem;
  text-align:center;
  font-size:.8rem;
  line-height:1.4;
  color:#111827;
}
.qm-result-head {
  font-size:.9rem;
  font-weight:600;
  color:#ff4d57;
  margin:0 0 .5rem;
}
.qm-result-detail {
  font-size:.75rem;
  color:#111827;
  line-height:1.4;
  margin:0 0 .75rem;
}
.qm-share {
  display:block;
  width:100%;
  border:none;
  border-radius:6px;
  font-size:.8rem;
  font-weight:600;
  line-height:1.2;
  color:#fff;
  cursor:pointer;
  background:#ff4d57;
  padding:.6rem .75rem;
  box-shadow:0 12px 24px rgba(255,77,87,.4);
}

/* scoreboard */
.qm-score {
  background:#ffffff;
  padding:1rem 1rem 2rem;
}
.qm-score-grid {
  display:grid;
  gap:.75rem;
  grid-template-columns:repeat(auto-fit,minmax(110px,1fr));
}
.qm-score-card {
  background:#f9fafb;
  border-radius:8px;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:0 12px 24px rgba(0,0,0,.06);
  text-align:center;
  padding:.75rem .75rem .9rem;
  line-height:1.4;
}
.qm-score-label {
  font-size:.7rem;
  line-height:1.3;
  color:#6b7280;
  margin-bottom:.4rem;
  font-weight:500;
}
.qm-score-value {
  font-size:1rem;
  line-height:1.2;
  font-weight:600;
  color:#111827;
}

/* utility */
.hidden { display:none; }
