/* Mobbin-informed interaction polish, using the established PairPlays tokens. */
:root {
  --control-radius: 10px;
  --control-border: #c7b8aa;
  --control-hover: #f1e8dd;
}

/* One strong primary action; calm secondary actions with equally usable targets. */
.btn {
  min-height: 50px;
  padding: 14px 24px;
  border-radius: var(--control-radius);
  gap: 22px;
  line-height: 1.45;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}
.btn.small { min-height: 44px; padding: 10px 16px; }
.btn.outline { border-color: var(--control-border); background: transparent; }
.btn.outline:hover { background: var(--control-hover); border-color: var(--wine); }
.btn:not(.outline):not(:disabled):hover { box-shadow: 0 4px 12px #49182b16; }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn:disabled, .btn[aria-busy="true"] { cursor: progress; transform: none; box-shadow: none; }
.btn:disabled:not([aria-busy="true"]) { cursor: not-allowed; opacity: .55; }
.btn[aria-busy="true"]::after {
  content: "";
  width: 14px; height: 14px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: review-spin .8s linear infinite;
}
.btn:focus-visible, .text-btn:focus-visible, .filter-btn:focus-visible,
.nav-link:focus-visible, .nav-profile:focus-visible, .modal-close:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 3px;
}
.text-btn { min-height: 44px; padding: 10px 2px; line-height: 1.4; }
.nav-link, .nav-profile, .back-link, .filter-btn { min-height: 44px; }
.nav-profile { display: inline-flex; align-items: center; justify-content: center; }
.site-footer button { min-height: 44px; padding: 8px 2px; }
.review-ribbon button { min-height: 30px; padding: 4px 0; }
.filter-btn { border-color: var(--control-border); padding: 10px 16px; }
.filter-btn[aria-pressed="true"], .review-option .btn[aria-pressed="true"] {
  border-color: var(--wine); background: var(--wine); color: white;
}
.modal-close { width: 44px; height: 44px; display: grid; place-items: center; top: 12px; right: 12px; }
.modal-inner > .btn.full + .btn.full { margin-top: 12px; }
.modal-inner h2 { padding-right: 10px; }
.modal-inner.center h2 { padding-right: 0; }
.modal-inner [tabindex="-1"]:focus, #main:focus { outline: none; }
.actions { gap: 12px; }
.wine-coupon { min-height: 44px; display: flex; align-items: center; width: 100%; }
.balance-uses button, .engine-toolbar button { min-height: 44px; }
.engine-toolbar { min-height: 56px; padding-top: 5px; padding-bottom: 5px; }
.recap-food { border-radius: var(--control-radius); }

/* Initial page load is useful before the large content scripts have arrived. */
.shell-loading {
  min-height: 56vh;
  padding: 48px 24px 64px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
}
.loading-emblem {
  width: 102px; height: 112px; margin-bottom: 28px;
  display: grid; place-items: center;
  background: #f0e8db; border: 1px solid var(--line); border-radius: 50px 50px 16px 16px;
}
.loading-emblem img { width: 52px; height: 78px; object-fit: contain; }
.shell-loading h1 { font-size: clamp(34px, 4vw, 46px); }
.shell-loading .eyebrow { margin-bottom: 14px; }
.loading-stage { display: flex; align-items: center; justify-content: center; gap: 10px; }
.shell-loading .loading-stage { margin-top: 25px; font-size: 13px; }
.loading-spinner {
  display: inline-block; flex: 0 0 auto; width: 18px; height: 18px;
  border: 2px solid #d8c8b9; border-top-color: var(--wine);
  border-radius: 50%; animation: review-spin 1s linear infinite;
}
.loading-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 25px; }
[data-state="error"] .loading-spinner { display: none; }

/* The game stays covered until its first real round is ready. */
.engine-loading { top: 56px; background: var(--cream); }
.engine-loading > div { width: min(100%, 340px); padding: 25px; }
.engine-loading .loading-spinner { width: 30px; height: 30px; margin: 0 auto 22px; }
.engine-loading .eyebrow { font-size: 9px; letter-spacing: 2px; }
.engine-loading h2 { font-size: 34px; }
.engine-loading .loading-stage { margin: 18px auto 0; line-height: 1.65; max-width: 260px; }
.engine-loading .loading-actions { flex-direction: column; gap: 10px; }
.engine-loading .loading-actions .btn { width: 100%; }
#game-frame[aria-hidden="true"] { visibility: hidden; }
#game-frame:not([aria-hidden="true"]) { animation: review-ready .2s ease both; }

@keyframes review-spin { to { transform: rotate(360deg); } }
@keyframes review-ready { from { opacity: 0; } to { opacity: 1; } }

/* Keep Preview 6's welcome and 15-second tutorial, with warmer tonal depth. */
.entry-panel {
  background: radial-gradient(ellipse at 100% 0, #ead8b94d, transparent 52%), var(--paper);
  border-top: 4px solid #b69767;
}
.entry-panel .tutorial-scene {
  background: radial-gradient(circle at 50% 35%, #faf5e8, #e6e7d8 76%);
  border: 1px solid #d6d8c5;
  box-shadow: inset 0 1px 0 #fff9;
}
.entry-panel .tutorial-caption { padding: 5px 8px; }
.entry-panel .timer-track { height: 5px; background: #eadfce; }
.entry-panel .timer-track span { background: linear-gradient(90deg, var(--wine), #ae7358); }
.entry-panel .tutorial-status { color: #716255; }

/* A complete, naturally scrolling recap is the first stop after every round. */
#experience-modal[data-appearance="recap"] { width: min(900px, calc(100vw - 32px)); max-width: 900px; }
.round-recap { padding: 38px; background: #fcfaf5; }
.recap-heading { padding-right: 30px; }
.recap-heading .eyebrow { margin-bottom: 12px; }
.recap-status {
  display: inline-block; margin-bottom: 14px; border: 1px solid #cbd6bd; border-radius: 30px;
  padding: 5px 11px; font-size: 10px; font-weight: 700; color: #435832; background: #edf1e7;
}
.recap-status.retry { color: #78572d; background: #f3eada; border-color: #dfcaab; }
.round-recap .recap-heading h2 { font-size: clamp(31px, 3vw, 42px); padding: 0; max-width: 630px; }
.recap-heading > p { margin-top: 12px; font-size: 13px; color: #6e5e54; }
.round-recap .result-numbers { gap: 12px; margin: 25px 0 0; }
.round-recap .result-number { border: 1px solid #e1d4c1; padding: 17px 10px; font-size: 12px; }
.round-recap .result-number strong { font-size: 34px; }
.round-recap .result-number.paired { background: #edf1e7; border-color: #d5ddc9; }
.round-recap .result-number.missed { background: #f5ecdc; }
.round-recap .result-number.missed strong { color: #82602e; }
.round-recap .result-number.wrong { background: #f5e9e7; border-color: #e7d1cd; }
.recap-scoreline { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 15px 1px 22px; font-size: 12px; color: #75614d; }
.recap-scoreline strong { color: var(--wine); margin-left: 4px; }
.recap-context { font-size: 12px; line-height: 1.7; border-left: 3px solid #b69767; padding: 8px 14px; margin-bottom: 22px; }
.recap-collection { border-top: 1px solid var(--line); padding-top: 25px; }
.recap-list-heading { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; }
.recap-list-heading h3 { font-family: var(--serif); font-size: 28px; font-weight: 400; }
.recap-list-heading > span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.recap-list-intro { margin: 10px 0 0; font-size: 12px; max-width: 650px; }
.round-recap .recap-filter-row { margin: 19px 0; gap: 8px; }
.round-recap .recap-filter-row .filter-btn { padding: 10px 15px; min-height: 44px; font-size: 12px; }
.round-recap .actual-recap-list { max-height: none; overflow: visible; border: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.round-recap .actual-recap-row { padding: 18px; border: 1px solid #dfd5c8; border-radius: 12px; background: #fffefa; gap: 14px; align-items: flex-start; }
.recap-item-art { width: 66px; min-height: 76px; flex: 0 0 66px; display: grid; place-items: center; background: #f1ebdf; border-radius: 9px; }
.round-recap .actual-recap-row img, .round-recap .recap-food-emoji { width: 58px; height: 64px; object-fit: contain; }
.recap-item-copy { min-width: 0; }
.round-recap .actual-recap-row small { color: #76624f; font-size: 8px; line-height: 1.55; letter-spacing: 1px; margin-bottom: 6px; }
.round-recap .actual-recap-row h3 { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1.15; overflow-wrap: anywhere; }
.round-recap .actual-recap-row p { font-size: 12px; line-height: 1.65; margin-top: 10px; }
.recap-outcomes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 11px; }
.recap-outcome { padding: 4px 7px; border-radius: 5px; font-size: 10px; line-height: 1.3; font-weight: 600; }
.recap-outcome.paired { background: #e9efde; color: #425d2c; }
.recap-outcome.missed { background: #f5e9cd; color: #795626; }
.recap-outcome.wrong { background: #f4dfdc; color: #8a3440; }
.recap-outcome.neutral { background: #eee8df; color: #675b4d; }
.recap-next { margin-top: 25px; border-top: 1px solid var(--line); padding-top: 22px; }
.recap-next p { font-size: 12px; margin-bottom: 15px; }
.recap-next .actions { margin: 0; }
.recap-back { display: block; background: transparent; color: var(--wine); font-size: 12px; padding: 8px 0; }

@media (hover: none) {
  .btn:hover { box-shadow: none; }
}
@media (max-width: 700px) {
  #experience-modal[data-appearance="recap"] { width: calc(100vw - 20px); }
  .round-recap { padding: 30px 20px 25px; }
  .round-recap .actual-recap-list { grid-template-columns: 1fr; }
  .round-recap .result-numbers { gap: 8px; }
  .round-recap .result-number { padding: 13px 7px; }
  .round-recap .actual-recap-row { padding: 16px 13px; gap: 13px; }
  .recap-heading { padding-right: 15px; }
  .recap-list-heading h3 { font-size: 25px; }
  .recap-next .btn { width: 100%; }
  .site-header { gap: 12px; padding-left: 18px; padding-right: 18px; }
  .site-header nav { gap: 8px; }
  .wordmark { font-size: 27px; }
  .nav-link { font-size: 11px; }
  .nav-profile { padding: 9px 11px; max-width: 116px; overflow-wrap: anywhere; }
  .btn { font-size: 13px; }
  .btn.small, .wine-copy .btn { min-height: 44px; font-size: 12px; }
  .modal-inner { padding: 36px 24px 28px; }
  .modal-inner .text-btn { font-size: 12px; }
  .modal-inner .actions > .btn { flex: 1 1 auto; }
  .filter-btn { font-size: 12px; }
  .wine-copy { padding: 16px 13px; }
  .wine-coupon { font-size: 10px; line-height: 1.5; }
  .shell-loading { min-height: 58vh; }
  .shell-loading .eyebrow { font-size: 9px; letter-spacing: 1.7px; }
  .review-ribbon { padding-top: 0; padding-bottom: 0; }
}
@media (max-width: 480px) {
  .wine-grid { grid-template-columns: 1fr; gap: 18px; }
  .wine-copy { padding: 21px; }
  .wine-copy h3 { font-size: 26px; }
  .wine-copy .eyebrow { font-size: 9px; }
  .wine-copy p { font-size: 12px; }
  .wine-coupon { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .loading-spinner, .btn[aria-busy="true"]::after, #game-frame { animation: none !important; }
  .btn { transition: none; }
}
