/* =========================================================
   "GUESS THE COFFEE" — the Décaf. mini-game at /game
   Black-and-white like the printed menu: a black cover, white
   paper, hairline buttons; the photo is the only colour.
   ========================================================= */

.game-body {
  background: #FFFFFF;
}

.game-main {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 18px 16px calc(32px + env(safe-area-inset-bottom) + var(--tg-bottom, 0px));
  flex: 1;
}

.game-view {
  animation: game-in 0.3s ease;
}

@keyframes game-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- intro ---------- */
.game-cover {
  position: relative;
  overflow: hidden;
  background: #000000;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px 24px 30px;
  margin-bottom: 20px;
  min-height: 220px;
}

.game-eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.65;
  margin-bottom: 10px;
}

.game-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 500;
  line-height: 1.02;
  max-width: 60%;
  position: relative;
  z-index: 1;
}

.game-lead {
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.5;
  opacity: 0.85;
  max-width: 62%;
  position: relative;
  z-index: 1;
}

/* two cups and a question mark, in the white line of the menu drawings */
.game-cover-art {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 150px;
  height: 150px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' fill='none' stroke='%23FFFFFF' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 36h20v6a9 9 0 0 1-9 9h-2a9 9 0 0 1-9-9z'/%3E%3Cpath d='M26 38h2a4 4 0 0 1 0 8h-2.5'/%3E%3Cpath d='M4 56h28'/%3E%3Cpath d='M38 30l3 26h14l3-26z'/%3E%3Cpath d='M37 26h22v4H37z'/%3E%3Cpath d='M39.5 40h17'/%3E%3Cpath d='M34 14a6 6 0 1 1 8 5.6c-1.5.6-2 1.6-2 3.4'/%3E%3Ccircle cx='40' cy='27' r='.4' fill='%23FFFFFF'/%3E%3Cpath d='M12 30c-2-3 2-4 0-8M19 30c-2-3 2-4 0-8'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.9;
}

.game-rules {
  list-style: none;
  counter-reset: rule;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.game-rules li {
  counter-increment: rule;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
}

.game-rules li::before {
  content: counter(rule);
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.game-best {
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-muted);
  margin: 0 0 14px;
}

.game-btn {
  display: block;
  width: 100%;
  appearance: none;
  border: 0;
  background: #000000;
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  padding: 17px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: transform 0.15s ease;
  margin-bottom: 10px;
}

.game-btn:active {
  transform: scale(0.98);
}

.game-btn-ghost {
  background: transparent;
  color: #000000;
  border: 1px solid rgba(0, 0, 0, 0.25);
}

.game-link {
  display: block;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  padding: 10px;
}

/* ---------- a round ---------- */
.game-hud {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
}

.game-streak {
  font-size: 12.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: #000000;
  color: #FFFFFF;
  animation: game-pop 0.3s ease;
}

.game-score {
  margin-left: auto;
}

.game-bar {
  height: 3px;
  background: #EDEDED;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
}

.game-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: #000000;
  transition: width 0.4s ease;
}

.game-photo {
  position: relative;
  margin: 0;
  aspect-ratio: 1;
  border-radius: 22px;
  overflow: hidden;
  background: #F2F2F2;
  border: 1px solid var(--line);
  transition: box-shadow 0.25s ease;
}

.game-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.35s ease, transform 0.5s ease;
}

.game-photo img.is-in {
  opacity: 1;
  transform: none;
}

.game-photo.is-right {
  box-shadow: 0 0 0 3px #000000;
}

.game-photo.is-wrong img {
  filter: grayscale(1);
}

.game-verdict {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.86);
  color: #FFFFFF;
  border-radius: 16px;
  padding: 12px 16px;
  font-size: 15px;
  animation: game-pop 0.28s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.game-verdict span {
  font-size: 13px;
  opacity: 0.75;
  white-space: nowrap;
}

@keyframes game-pop {
  from { transform: translateY(6px) scale(0.97); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.game-question {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  text-align: center;
  margin: 16px 0 12px;
}

.game-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-option {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 92px;
  padding: 14px 10px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  border-radius: 18px;
  background: #FFFFFF;
  color: #000000;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform 0.12s ease, background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.game-option:active {
  transform: scale(0.97);
}

.game-option-key {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.game-option-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
}

.game-option.is-right {
  background: #000000;
  color: #FFFFFF;
  border-color: #000000;
}

.game-option.is-right .game-option-key::after {
  content: '✓';
}

.game-option.is-right .game-option-key {
  font-size: 0;
  opacity: 1;
}

.game-option.is-right .game-option-key::after {
  font-size: 13px;
}

.game-option.is-wrong {
  border-style: dashed;
  color: #8A8A8A;
}

.game-option.is-wrong .game-option-name {
  text-decoration: line-through;
}

.game-option.is-dim {
  opacity: 0.4;
}

.game-option:disabled {
  cursor: default;
}

.game-next {
  display: block;
  margin: 14px auto 0;
  appearance: none;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 8px 14px;
  cursor: pointer;
}

/* ---------- the end ---------- */
.game-result {
  background: #000000;
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  text-align: center;
  margin-bottom: 18px;
}

.game-result .game-lead {
  max-width: none;
  margin-top: 8px;
}

.game-result .game-best {
  color: rgba(255, 255, 255, 0.6);
  margin: 10px 0 0;
}

.game-result-score {
  font-family: var(--font-display);
  line-height: 1;
  margin: 4px 0 8px;
}

.game-result-score b {
  font-size: 84px;
  font-weight: 500;
}

.game-result-score span {
  font-size: 30px;
  opacity: 0.6;
}

.game-rank {
  font-family: var(--font-script);
  font-size: 28px;
}

.game-review {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.game-review li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10.5px;
  line-height: 1.2;
  text-align: center;
}

.game-review img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
}

.game-review li.is-wrong img {
  filter: grayscale(1);
  opacity: 0.55;
}

.game-review i {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #000000;
  color: #FFFFFF;
  font-style: normal;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-review li.is-wrong i {
  background: #FFFFFF;
  color: #000000;
  border: 1px solid #000000;
}

/* ---------- loading ---------- */
.game-loading {
  display: flex;
  justify-content: center;
  padding: 90px 0;
}

.game-loading[hidden] {
  display: none;
}

.game-spinner {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-top-color: #000000;
  border-radius: 50%;
  animation: game-spin 0.8s linear infinite;
}

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

@media (max-width: 360px) {
  .game-title { font-size: 34px; }
  .game-cover-art { width: 110px; height: 110px; }
  .game-option-name { font-size: 14.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-view, .game-verdict, .game-streak { animation: none; }
  .game-photo img { transition: none; }
}

/* ---------- the recipe hint ---------- */
/* A smaller photo leaves room for the recipe and both answers on one screen. */
.game-photo {
  aspect-ratio: 4 / 3;
}

.game-recipe {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px dashed rgba(0, 0, 0, 0.3);
  border-radius: 16px;
}

.game-recipe-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 8px;
}

.game-recipe-items {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.game-recipe-items li {
  font-size: 13.5px;
  font-weight: 500;
  padding: 5px 11px;
  border-radius: 999px;
  background: #F2F2F2;
}

.game-recipe + .game-question {
  margin-top: 12px;
}
