/* reveal.css: scoped styles for Reveal & Guess. */

.rg-root { position: absolute; inset: 0; }

.rg-view {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  animation: rgViewIn 0.26s ease both;
}

@keyframes rgViewIn {
  from { opacity: 0; transform: scale(0.992); }
  to { opacity: 1; transform: scale(1); }
}

/* WAGER */
.rg-wager {
  align-items: center;
  justify-content: center;
  padding: 6vh 5vw;
}

.wager-card {
  background: var(--panel);
  border: 2px solid var(--outline);
  border-radius: 8px;
  box-shadow: var(--shadow-hard), var(--shadow-soft);
  padding: clamp(1.2rem, 4vw, 2.4rem);
  text-align: center;
  max-width: 560px;
  width: 100%;
  transform: rotate(-0.35deg);
}

.wager-kicker {
  font-family: var(--disp);
  color: var(--accent);
  letter-spacing: 0;
  margin: 0 0 0.45rem;
  text-transform: uppercase;
}

.wager-q {
  font-family: var(--disp);
  font-size: 1.55rem;
  margin: 0 0 1rem;
  line-height: 1.08;
  text-wrap: balance;
}

.wager-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 4vw, 1.4rem);
  margin: 0.7rem 0 0.25rem;
}

.wager-num {
  font-family: var(--disp);
  font-size: 4.5rem;
  color: var(--accent4);
  min-width: 1.7em;
  text-shadow: 3px 3px 0 var(--outline);
  line-height: 1;
}

.wager-hint {
  color: var(--ink-dim);
  margin: 0.2rem 0 1.2rem;
  line-height: 1.55;
  font-size: 1rem;
}

.wager-hint .rule-good { color: var(--good); font-weight: 700; }
.wager-hint .rule-bad { color: var(--bad); font-weight: 700; }

.wager-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* REVEALING */
.rg-reveal { padding: calc(env(safe-area-inset-top) + 54px) 2vw 0; }

.rg-stage {
  flex: 1;
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 0.5vh 0;
}

.rg-photobox {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 0 0 3px var(--outline), 7px 7px 0 oklch(19% 0.012 248 / 0.22);
  background: var(--paper);
}

.rg-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rg-grid {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 3px;
  grid-template-columns: repeat(var(--cols), 1fr);
  grid-template-rows: repeat(var(--rows), 1fr);
}

.rg-tile {
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  position: relative;
  background:
    repeating-linear-gradient(45deg, oklch(18% 0.012 248 / 0.1) 0 2px, transparent 2px 10px),
    linear-gradient(135deg, var(--paper), var(--paper-2));
  box-shadow: inset 0 0 0 2px oklch(18% 0.012 248 / 0.38);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease, filter 0.15s ease;
  transform-origin: center;
}

.rg-tile::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46%;
  height: 58%;
  background: url("../../../assets/memes/raf,360x360,075,t,fafafa_ca443f4786.jpg?v=20260707a") center / contain no-repeat;
  filter: grayscale(0.08) contrast(1.22);
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%) rotate(-3deg);
}

.rg-tile:nth-child(2n)::after { background-image: url("../../../assets/memes/dumb-smart.png?v=20260707a"); transform: translate(-50%, -50%) rotate(5deg); }
.rg-tile:nth-child(3n)::after { background-image: url("../../../assets/memes/dumb-wojak.png?v=20260707a"); transform: translate(-50%, -50%) rotate(-8deg); }
.rg-tile:nth-child(5n)::after { background-image: url("../../../assets/memes/f7c7c5a714368559a72064680df1b920.jpg?v=20260707a"); }

.rg-tile:hover { filter: brightness(1.03) contrast(1.06); }
.rg-tile.revealed { transform: rotateY(90deg) scale(0.84); opacity: 0; pointer-events: none; }

/* HUD */
.rg-hud {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0.6rem 0.6rem calc(0.6rem + env(safe-area-inset-bottom));
}

.hud-left { display: flex; align-items: center; gap: 0.6rem; }
.hud-right { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; justify-content: flex-end; }

.hud-counter {
  font-family: var(--disp);
  font-size: 1.65rem;
  color: var(--accent4);
  text-shadow: 2px 2px 0 var(--paper);
}

.hud-counter.maxed { color: var(--bad); animation: counterPulse 0.5s ease infinite alternate; }

@keyframes counterPulse {
  to { transform: scale(1.08) rotate(-1deg); }
}

.hud-bet {
  font-family: var(--disp);
  color: var(--ink-dim);
  padding: 0.24em 0.62em;
  border: 2px solid var(--outline);
  border-radius: 999px;
  background: var(--panel);
  font-size: 0.88rem;
}

/* RESULT */
.rg-result-photo {
  position: absolute;
  inset: 0;
  background-color: var(--outline);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.rg-result::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(0deg, oklch(91% 0.018 134 / 0.96) 0%, oklch(91% 0.018 134 / 0.62) 42%, transparent 70%);
}

.result-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  text-align: center;
  padding: 1rem 5vw calc(1.4rem + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.result-headline {
  font-family: var(--disp);
  font-size: 3.1rem;
  margin: 0;
  line-height: 0.95;
  -webkit-text-stroke: 2px var(--outline);
  paint-order: stroke fill;
  text-transform: uppercase;
  letter-spacing: 0;
  transform: rotate(-1.4deg);
}

.result-headline.good { color: var(--good); text-shadow: 3px 3px 0 var(--outline); }
.result-headline.bad { color: var(--bad); text-shadow: 3px 3px 0 var(--outline); }

.result-sub {
  font-family: var(--body);
  color: var(--ink-dim);
  margin: 0;
  font-size: 0.95rem;
}

.drink-line.big { padding: 0.55em 1.1em; }
.drink-line.big .drink-amt { font-size: 1.35rem; }

.bet-result {
  font-family: var(--disp);
  margin: 0;
  color: var(--accent);
}

.bet-result.over { color: var(--bad); }
.bet-result.beat { color: var(--good); }
.bet-result.exact { color: var(--accent4); }

.drink-lines {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.3rem 0;
  width: 100%;
  max-width: 520px;
}

.drink-line {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  background: var(--panel);
  border: 2px solid var(--outline);
  border-radius: 8px;
  padding: 0.44em 0.9em;
  box-shadow: 3px 3px 0 oklch(18% 0.012 248 / 0.18);
}

.drink-amt { font-family: var(--disp); font-size: 1.15em; }
.drink-line.bachelor .drink-amt { color: var(--bad); }
.drink-line.group .drink-amt { color: var(--good); }
.drink-why { color: var(--ink-dim); font-size: 0.9em; }

.result-actions {
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}

/* Exhausted / empty */
.rg-exhausted {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 1rem;
  padding: 8vh 6vw;
  font-family: var(--disp);
}

.rg-exhausted h2 { font-size: 2rem; margin: 0; }
.rg-exhausted p { font-family: var(--body); color: var(--ink-dim); margin: 0; }

@media (min-width: 760px) {
  .wager-q { font-size: 2rem; }
  .wager-num { font-size: 6rem; }
  .rg-tile::after { width: 42%; height: 54%; }
  .hud-counter { font-size: 1.9rem; }
  .result-headline { font-size: 5.25rem; }
  .drink-line.big .drink-amt { font-size: 1.8rem; }
  .rg-exhausted h2 { font-size: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .rg-view { animation: none; }
  .hud-counter.maxed { animation: none; }
}
