/* -------------------------------------------------------------
   Costcodle - Zadely Neo-Brutalist Sticker Style Sheet
   ------------------------------------------------------------- */

:root {
  color-scheme: light;
  --sheet: #e6ecff;
  --sheet-line: #d3dcfb;
  --ink: #1b1f3b;
  --ink-soft: #4a5078;
  --paper: #ffffff;

  /* Zadely Core Pop Palette */
  --tomato: #ff5a4e;
  --yolk: #ffd23f;
  --pool: #3fa7ff;
  --leaf: #2ec27e;
  --grape: #8b6cff;
  --pink: #ff8fc7;
  --orange: #ff7a32;
  --teal: #18c4c7;

  /* Typography matching zadely.com */
  --display: "Dela Gothic One", "Arial Black", Impact, sans-serif;
  --body: "Figtree", system-ui, -apple-system, sans-serif;

  /* Hard offset ink drop shadows */
  --lift-xl: 0 8px 0 var(--ink);
  --lift-lg: 0 6px 0 var(--ink);
  --lift-md: 0 4px 0 var(--ink);
  --lift-sm: 0 3px 0 var(--ink);
  --lift-xs: 0 2px 0 var(--ink);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--body);
  color: var(--ink);
  background-color: var(--sheet);
  /* Zadely graph paper texture */
  background-image:
    linear-gradient(var(--sheet-line) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--sheet-line) 1.5px, transparent 1.5px);
  background-size: 36px 36px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -60px;
  left: 12px;
  background: var(--yolk);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  padding: 8px 16px;
  font-weight: 800;
  z-index: 1000;
  text-decoration: none;
  border-radius: 999px;
  transition: top 0.15s ease;
}
.skip-link:focus {
  top: 12px;
}

/* Page Wrapper (Level 1) */
.page-wrapper {
  width: 100%;
  max-width: 580px;
  padding: 14px 16px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* Header & Controls */
.game-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.brand-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.site-title {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 400;
  line-height: 1.1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

/* Tilted Sticker Badges */
.sticker-tag {
  display: inline-block;
  padding: 0.15em 0.45em 0.18em;
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-xs);
  border-radius: 8px;
  font-family: var(--display);
  letter-spacing: 0.02em;
  transition: transform 0.15s ease;
}

.tag-cost {
  background: var(--tomato);
  color: #ffffff;
  transform: rotate(-2deg);
}
.tag-cost:hover {
  transform: rotate(-3.5deg) scale(1.06);
}

.tag-codle {
  background: var(--yolk);
  color: var(--ink);
  transform: rotate(2deg);
}
.tag-codle:hover {
  transform: rotate(3.5deg) scale(1.06);
}

.tag-unlimited {
  background: var(--leaf);
  color: #ffffff;
  font-size: 0.58em;
  padding: 0.25em 0.6em;
  border-radius: 999px;
  transform: rotate(-1deg);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-tagline {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* Action Buttons */
.controls-group {
  display: flex;
  gap: 6px;
}

.btn-icon {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  font-size: 1rem;
  transition: transform 80ms, box-shadow 80ms, background-color 80ms;
}

.btn-icon:hover {
  background: var(--yolk);
  transform: translateY(-1px);
  box-shadow: var(--lift-md);
}

.btn-icon:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-icon svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

/* Mode Switcher Segmented Control */
.mode-switcher {
  display: flex;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
  width: 100%;
  max-width: 380px;
}

.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.mode-btn.active {
  background: var(--yolk);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: var(--lift-xs);
}

/* Product Hero Card (Clean Minimalist Photo Card like original Costcodle) */
.product-card {
  width: 100%;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--lift-lg);
  border-radius: 24px;
  padding: 16px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  position: relative;
}

.card-top-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.product-badge {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--pool);
  color: #ffffff;
  padding: 3px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

.attempt-badge {
  font-family: var(--display);
  font-size: 0.82rem;
  color: var(--ink);
  background: #f1f4fd;
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
}

.product-image-container {
  width: 250px;
  height: 250px;
  background: #ffffff;
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px;
  margin-top: 2px;
}

.product-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.product-image:hover {
  transform: scale(1.05);
}

.product-name {
  font-family: var(--display);
  font-size: 1.15rem;
  line-height: 1.3;
  color: var(--ink);
  max-width: 460px;
  margin: 0;
}

/* Guess Input Stage */
.guess-input-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.input-row {
  width: 100%;
  display: flex;
  gap: 8px;
}

.currency-input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.currency-symbol {
  position: absolute;
  left: 16px;
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--ink);
  pointer-events: none;
}

.price-input {
  width: 100%;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 16px;
  padding: 10px 14px 10px 38px;
  outline: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.price-input:focus {
  box-shadow: var(--lift-md);
  transform: translateY(-1px);
}

.btn-submit {
  background: var(--leaf);
  color: #ffffff;
  border: 3px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 16px;
  padding: 0 20px;
  font-family: var(--display);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 80ms, box-shadow 80ms;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--lift-md);
}

.btn-submit:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-submit:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: var(--lift-sm);
}

/* Quick Increments Chip Bar */
.chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.chip-btn {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--lift-xs);
  border-radius: 999px;
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--ink);
  padding: 4px 10px;
  cursor: pointer;
  transition: transform 80ms;
}

.chip-btn:hover {
  background: var(--yolk);
  transform: translateY(-1px);
}

.chip-btn:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 var(--ink);
}

/* Guess History Grid (6 Rows) */
.history-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-row {
  width: 100%;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.history-row.empty {
  background: #f4f7ff;
  border-style: dashed;
  border-color: #cbd5e1;
  box-shadow: none;
  opacity: 0.6;
}

.guess-number {
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--ink-soft);
  width: 24px;
}

.guess-amount {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
}

.guess-feedback {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

/* Feedback Status Classes */
.fb-cold {
  background-color: var(--tomato);
  color: #ffffff;
}

.fb-warm {
  background-color: var(--yolk);
  color: var(--ink);
}

.fb-win {
  background-color: var(--leaf);
  color: #ffffff;
}

/* Feature Badges Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 4px;
}

.tag-pill {
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.76rem;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  padding: 4px 10px;
  border-radius: 999px;
  cursor: default;
}

/* Content Sections */
.content-section {
  width: 100%;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guide-block {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-md);
  border-radius: 20px;
  padding: 14px 18px;
}

.guide-heading {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 8px;
  font-weight: 400;
}

.guide-list {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--ink);
}

.guide-list strong {
  font-weight: 800;
}

/* Accordion FAQ */
details.faq-item {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 16px;
  padding: 12px 16px;
  cursor: pointer;
  transition: box-shadow 80ms, transform 80ms;
}

details.faq-item:hover {
  box-shadow: var(--lift-md);
  transform: translateY(-1px);
}

details.faq-item[open] {
  box-shadow: var(--lift-md);
}

details.faq-item summary {
  font-weight: 800;
  color: var(--ink);
  font-size: 0.95rem;
  outline: none;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

details.faq-item summary::-webkit-details-marker {
  display: none;
}

details.faq-item summary::after {
  content: "+";
  font-family: var(--display);
  font-size: 1.2rem;
  color: var(--ink);
}

details.faq-item[open] summary::after {
  content: "−";
}

details.faq-item p {
  margin-top: 8px;
  font-size: 0.86rem;
  color: var(--ink-soft);
  line-height: 1.45;
}

/* Footer & Legal Disclaimer */
.site-footer {
  margin-top: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.disclaimer-text {
  font-size: 0.72rem;
  color: #64748b;
  line-height: 1.4;
  max-width: 520px;
  margin-inline: auto;
}

/* Modals (Zadely Neo-Brutalist Pop Dialogs) */
dialog.game-dialog {
  margin: auto;
  background: var(--paper);
  border: 3.5px solid var(--ink);
  box-shadow: var(--lift-xl);
  border-radius: 26px;
  padding: 28px 22px;
  color: var(--ink);
  max-width: 380px;
  width: 90%;
  text-align: center;
}

dialog.game-dialog::backdrop {
  background-color: rgba(27, 31, 59, 0.6);
  backdrop-filter: blur(4px);
}

.modal-title {
  font-family: var(--display);
  font-size: 2rem;
  color: var(--tomato);
  margin-bottom: 6px;
  line-height: 1.1;
}

.modal-desc {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 16px;
}

.actual-price-banner {
  background: var(--yolk);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 18px;
}

.actual-price-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink);
}

.actual-price-value {
  font-family: var(--display);
  font-size: 2.2rem;
  color: var(--ink);
  line-height: 1;
}

.modal-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.stat-tile {
  background: #f1f4fd;
  border: 2px solid var(--ink);
  box-shadow: var(--lift-xs);
  border-radius: 12px;
  padding: 8px 4px;
}

.stat-tile-val {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--ink);
  line-height: 1;
}

.stat-tile-lbl {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.btn-primary {
  background: var(--leaf);
  color: #ffffff;
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-md);
  font-family: var(--display);
  font-size: 1.15rem;
  padding: 12px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 80ms, box-shadow 80ms;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--lift-lg);
}

.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--ink);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-sm);
  font-family: var(--body);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 80ms;
}

.btn-secondary:hover {
  background: var(--sheet);
  transform: translateY(-1px);
}

/* -------------------------------------------------------------
   Strategy Guides, High-Score Cards, & Recommendations (Zadely Style)
   ------------------------------------------------------------- */
.guide-subheading {
  font-family: var(--display);
  font-size: 0.98rem;
  color: var(--ink);
  margin-top: 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.guide-para {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--ink);
  margin-bottom: 10px;
}

.strategy-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
  margin-bottom: 12px;
}

.strategy-card {
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: var(--lift-sm);
  border-radius: 14px;
  padding: 12px 14px;
  transition: transform 100ms ease, box-shadow 100ms ease;
}

.strategy-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lift-md);
}

.strategy-card-title {
  font-family: var(--display);
  font-size: 0.88rem;
  color: var(--ink);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.strategy-card-desc {
  font-size: 0.83rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.pro-tip-callout {
  background: #fef9e7;
  border: 2px solid var(--yolk);
  box-shadow: var(--lift-sm);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 12px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #78350f;
}

.pro-tip-callout strong {
  color: #b45309;
}

/* More Games & Zadely External Link Grid */
.more-games-section {
  width: 100%;
  margin-top: 16px;
}

.section-title {
  font-family: var(--display);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.more-games-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 540px) {
  .more-games-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.game-rec-card {
  background: var(--paper);
  border: 2.5px solid var(--ink);
  box-shadow: var(--lift-md);
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  transition: transform 120ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 120ms ease;
}

.game-rec-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--lift-lg);
}

.game-rec-card.zadely-special {
  background: linear-gradient(135deg, #fffbeb 0%, #f5f3ff 100%);
  border-color: var(--ink);
}

.rec-badge {
  display: inline-block;
  align-self: flex-start;
  font-family: var(--display);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  background: var(--paper);
  color: var(--ink);
  margin-bottom: 8px;
}

.rec-badge.badge-ai {
  background: var(--grape);
  color: #ffffff;
}

.rec-title {
  font-family: var(--display);
  font-size: 1.02rem;
  color: var(--ink);
  margin-bottom: 6px;
}

.rec-desc {
  font-size: 0.83rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin-bottom: 14px;
  flex-grow: 1;
}

.rec-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--display);
  font-size: 0.82rem;
  padding: 8px 14px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  background: var(--yolk);
  color: var(--ink);
  box-shadow: var(--lift-sm);
  font-weight: 800;
  text-align: center;
  transition: background 100ms ease, transform 100ms ease;
}

.game-rec-card:hover .rec-btn {
  background: var(--tomato);
  color: #ffffff;
}
