/* ===========================================================
   Na Zdravje! — pivska igra
   Mobile-first, bright cartoon theme
   =========================================================== */

:root {
  /* palette */
  --coral:   #ff6b6b;
  --sun:     #ffd93d;
  --sky:     #4dabf7;
  --mint:    #38d9a9;
  --grape:   #845ef7;
  --pink:    #ff8cc8;
  --ink:     #2b2140;
  --ink-soft:#5b5170;
  --cream:   #fff8f0;
  --white:   #ffffff;

  /* themable accent (changes per mode/difficulty) */
  --accent:      var(--coral);
  --accent-deep: #e84b4b;

  /* type */
  --font-display: "Baloo 2", system-ui, sans-serif;
  --font-body:    "Fredoka", system-ui, sans-serif;

  /* shape */
  --radius:    22px;
  --radius-lg: 32px;
  --shadow:    0 8px 0 rgba(43, 33, 64, 0.18);
  --shadow-soft: 0 12px 28px rgba(43, 33, 64, 0.18);

  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(160deg, #fff3e0 0%, #ffe3ec 45%, #e3f2ff 100%);
  overflow-x: hidden;
  min-height: 100dvh;
  position: relative;
}

/* ---- floating background blobs ---- */
#bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.5;
  animation: float 9s ease-in-out infinite;
}
.blob-1 { width: 210px; height: 210px; background: var(--sun);  top: -60px; left: -50px; }
.blob-2 { width: 260px; height: 260px; background: var(--sky);  bottom: -90px; right: -70px; animation-delay: -3s; }
.blob-3 { width: 160px; height: 160px; background: var(--pink); top: 40%; right: -40px; animation-delay: -6s; }
@keyframes float {
  0%,100% { transform: translateY(0) scale(1); }
  50%     { transform: translateY(-22px) scale(1.06); }
}

/* ---- app shell ---- */
#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: calc(18px + var(--safe-top)) 20px calc(24px + var(--safe-bottom));
  display: flex;
  flex-direction: column;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: screen-in 0.32s cubic-bezier(.2,.9,.3,1.2) both;
}
@keyframes screen-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===========================================================
   Typography helpers
   =========================================================== */
.title {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.5px;
}
.logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.6rem, 14vw, 3.6rem);
  text-align: center;
  line-height: 0.95;
  color: var(--coral);
  text-shadow: 0 4px 0 #fff, 0 8px 0 rgba(43,33,64,.12);
}
.logo .cheer { display: block; font-size: 0.5em; color: var(--grape); margin-top: .35em; letter-spacing: 2px; }
.subtitle { text-align: center; color: var(--ink-soft); font-size: 1.05rem; margin-top: 14px; }
.section-title { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; text-align: center; }
.hint { color: var(--ink-soft); font-size: .92rem; text-align: center; }
.hint a { color: inherit; text-decoration: underline; }

/* ===========================================================
   Buttons
   =========================================================== */
.btn {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--white);
  background: var(--accent);
  border: none;
  border-radius: var(--radius);
  padding: 18px 22px;
  min-height: 60px;
  width: 100%;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--accent-deep);
  transition: transform .08s ease, box-shadow .08s ease, background .2s ease;
  -webkit-user-select: none; user-select: none;
  touch-action: manipulation;
}
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--accent-deep); }
.btn:disabled { opacity: .45; box-shadow: 0 6px 0 rgba(43,33,64,.2); cursor: not-allowed; }

.btn-lg { font-size: 1.5rem; min-height: 72px; border-radius: var(--radius-lg); }

.btn-ghost {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 6px 0 rgba(43,33,64,.14);
}
.btn-ghost:active { box-shadow: 0 2px 0 rgba(43,33,64,.14); }

.btn-pop { animation: pop .35s ease; }
@keyframes pop { 0%{transform:scale(1)} 40%{transform:scale(1.08)} 100%{transform:scale(1)} }

.btn-row { display: flex; gap: 12px; }
.btn-row .btn { flex: 1; }

/* small round icon button */
.icon-btn {
  width: 44px; height: 44px; min-height: 44px;
  border-radius: 14px; flex: 0 0 auto; font-size: 1.3rem;
  display: grid; place-items: center; padding: 0;
}

/* ===========================================================
   Cards / panels
   =========================================================== */
.panel {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-soft);
}

.stack { display: flex; flex-direction: column; gap: 14px; }
.grow  { flex: 1; }
.center-col { justify-content: center; align-items: center; text-align: center; gap: 22px; }
.pushed-bottom { margin-top: auto; }

/* top bar (back + title) */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.topbar .section-title { flex: 1; text-align: left; font-size: 1.3rem; }

/* ===========================================================
   Player setup
   =========================================================== */
.player-list { display: flex; flex-direction: column; gap: 10px; }
.player-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 10px 12px;
  box-shadow: 0 6px 0 rgba(43,33,64,.08);
  animation: screen-in .25s ease both;
}
.player-row .name { flex: 1; font-weight: 600; font-size: 1.1rem; }

.avatar {
  width: 46px; height: 46px; flex: 0 0 auto;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 1.5rem;
  box-shadow: inset 0 -4px 0 rgba(0,0,0,.12);
}
.avatar-lg { width: 84px; height: 84px; font-size: 2.6rem; }

.add-row { display: flex; gap: 10px; }
.text-input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1.1rem;
  border: 3px solid #ffe0d6;
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--white);
  color: var(--ink);
  outline: none;
  min-height: 56px;
}
.text-input:focus { border-color: var(--accent); }

/* ===========================================================
   Mode / difficulty selection
   =========================================================== */
.choice-grid { display: flex; flex-direction: column; gap: 14px; }
.choice {
  position: relative;
  text-align: left;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  color: var(--white);
  box-shadow: var(--shadow);
  font-family: var(--font-body);
  transition: transform .1s ease, box-shadow .1s ease;
}
.choice:active { transform: translateY(3px); box-shadow: 0 5px 0 rgba(43,33,64,.18); }
.choice.selected { outline: 4px solid var(--ink); outline-offset: 3px; }
.choice h3 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin-bottom: 4px; }
.choice p  { font-size: .96rem; opacity: .95; }
.choice .emoji { position: absolute; right: 18px; top: 16px; font-size: 2.2rem; }
.choice .badge18 {
  position: absolute; right: 16px; bottom: 14px;
  background: rgba(0,0,0,.25); border-radius: 12px;
  padding: 3px 10px; font-weight: 700; font-size: .8rem;
}

.diff-row { display: flex; gap: 10px; }
.diff {
  flex: 1; cursor: pointer; border: none;
  border-radius: var(--radius); padding: 10px 8px;
  font-family: var(--font-display); font-weight: 700; font-size: .95rem;
  color: var(--white); box-shadow: 0 5px 0 rgba(43,33,64,.18);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: transform .08s ease;
}
.diff .ico { font-size: 1.15rem; }
.diff:active { transform: translateY(3px); }
.diff.selected { outline: 4px solid var(--ink); outline-offset: 2px; }
.diff .diff-skips {
  font-size: .72rem; font-weight: 600; opacity: .85;
  background: rgba(0,0,0,.18); border-radius: 999px; padding: 2px 8px;
}

.toggle-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: 0 5px 0 rgba(43,33,64,.08);
}
.toggle-row .label { flex: 1; font-weight: 600; }
.switch { position: relative; width: 58px; height: 34px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: #d9d2e6; border-radius: 999px;
  transition: background .2s ease; cursor: pointer;
}
.switch .track::before {
  content: ""; position: absolute; width: 26px; height: 26px; left: 4px; top: 4px;
  background: var(--white); border-radius: 50%; transition: transform .2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.switch input:checked + .track { background: var(--mint); }
.switch input:checked + .track::before { transform: translateX(24px); }

/* ===========================================================
   Game screen
   =========================================================== */
.game-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.game-head .round { margin-left: auto; font-weight: 600; color: var(--ink-soft); font-size: .95rem; }
.turn-name { font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; }
.turn-label { font-size: .8rem; color: var(--ink-soft); }

.card-area { flex: 1; display: grid; place-items: center; perspective: 1200px; padding: 8px 0; }

.card {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 56dvh;
  border-radius: var(--radius-lg);
  background: var(--accent);
  color: var(--white);
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column;
  padding: 26px 24px;
  transform-style: preserve-3d;
  animation: deal .45s cubic-bezier(.2,.9,.3,1.25) both;
}
@keyframes deal {
  from { opacity: 0; transform: translateY(26px) rotate(-3deg) scale(.92); }
  to   { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}
/* reveal flip: a longer, bouncier 3D turn with a wind-up + overshoot */
.card.flip { animation: flip .82s cubic-bezier(.34,1.28,.5,1) both; }
@keyframes flip {
  0%   { transform: rotateY(0deg)   scale(1);   }
  12%  { transform: rotateY(-16deg) scale(.93); }  /* wind-up */
  49%  { transform: rotateY(90deg)  scale(1.07);}  /* edge-on, zoom */
  50%  { transform: rotateY(-90deg) scale(1.07);}  /* face swaps while hidden */
  86%  { transform: rotateY(9deg)   scale(1.02);}  /* overshoot */
  100% { transform: rotateY(0deg)   scale(1);   }
}
/* gloss sweep across the face as the card lands */
.card.flip::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
    transparent 30%, rgba(255,255,255,.45) 47%,
    rgba(255,255,255,.7) 52%, transparent 70%);
  transform: translateX(-130%);
  animation: card-gloss .82s ease-out both;
  pointer-events: none;
  z-index: 4;
}
@keyframes card-gloss {
  0%, 55% { transform: translateX(-130%); opacity: 0; }
  68%     { opacity: 1; }
  100%    { transform: translateX(130%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .card.flip { animation-duration: .26s; }
  .card.flip::before { display: none; }
}

.card-back {
  background: var(--grape) !important;
  justify-content: center;
  align-items: center;
  gap: 24px;
  cursor: pointer;
}
.cb-logo {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: white;
  text-shadow: 0 3px 8px rgba(0,0,0,.25);
  text-align: center;
}
.cb-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.cb-hint {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: rgba(255,255,255,.85);
}
.cb-hint-shake {
  font-size: .85rem;
  color: rgba(255,255,255,.6);
  animation: shake-hint 1.6s ease-in-out infinite;
}
@keyframes shake-hint {
  0%, 88%, 100% { transform: translateX(0); }
  91% { transform: translateX(-4px); }
  94% { transform: translateX(4px); }
  97% { transform: translateX(-2px); }
}
/* "how to reveal" chip pinned to the bottom of the card back */
.cb-help {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(255,255,255,.18); border: none; border-radius: 999px;
  color: rgba(255,255,255,.92); cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: .78rem;
  padding: 7px 15px;
}
.cb-help:active { transform: translateX(-50%) scale(.95); }
.card .type-tag {
  align-self: flex-start;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  letter-spacing: .5px;
}
.card .card-text {
  flex: 1;
  display: grid;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.4rem, 6.2vw, 2rem);
  line-height: 1.2;
  text-align: center;
}
.card .sips-badge {
  align-self: center;
  background: rgba(0,0,0,.2);
  border-radius: 16px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 1.05rem;
}

.game-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }

/* score chips */
.scoreboard {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 12px 2px;
  scrollbar-width: none;
  margin-top: 6px;
}
.scoreboard::-webkit-scrollbar { display: none; }
.score-chip {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 6px;
  background: var(--white); border-radius: 999px;
  padding: 6px 12px 6px 6px;
  box-shadow: 0 4px 0 rgba(43,33,64,.08);
  font-weight: 600; font-size: .9rem;
}
.score-chip .mini-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: .95rem;
}
.score-chip.active { outline: 3px solid var(--accent); }
.score-chip .sips { color: var(--ink-soft); font-size: .82rem; }

/* active "pravilo" rules banner (persists across turns until they expire) */
.rules-banner {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 12px; margin: 2px 0 6px;
}
.rules-banner:empty { display: none; }
.rule-chip {
  display: inline-flex; align-items: center;
  max-width: 100%;
  background: rgba(92,124,250,.18); color: var(--ink);
  border: 1px solid rgba(66,99,235,.35);
  border-radius: 999px; padding: 5px 12px;
  font-family: var(--font-display); font-weight: 600; font-size: .78rem;
  line-height: 1.25;
}
/* shown in the izziv action row once a player's skip budget is spent */
.skip-locked {
  display: inline-flex; align-items: center;
  color: var(--ink-soft); font-family: var(--font-display);
  font-weight: 700; font-size: .9rem; padding: 0 6px;
}

/* ===========================================================
   Modal (18+ gate / confirm)
   =========================================================== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(43,33,64,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: fade .2s ease both;
}
@supports (align-items: center) {
  @media (min-height: 700px) {
    .modal-backdrop { align-items: center; }
  }
}
@keyframes fade { from{opacity:0} to{opacity:1} }
.modal {
  width: 100%; max-width: 380px;
  background: var(--white); border-radius: var(--radius-lg);
  padding: 26px 22px; text-align: center;
  box-shadow: var(--shadow-soft);
  flex-shrink: 0;
  animation: screen-in .3s cubic-bezier(.2,.9,.3,1.2) both;
}
.modal .big-emoji { font-size: 3.2rem; }
.modal h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; margin: 8px 0; }
.modal p { color: var(--ink-soft); margin-bottom: 18px; }
.help-tip {
  background: rgba(132,94,247,.1);
  border: 1px solid rgba(132,94,247,.28);
  border-radius: 14px; padding: 12px 14px; margin-top: 12px;
  font-family: var(--font-display); font-weight: 500;
  font-size: .88rem; line-height: 1.55; color: var(--ink);
}
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(255,255,255,.07); border-radius: 14px;
  padding: 14px 16px; gap: 12px; margin: 14px 0 0;
  font-family: var(--font-display); font-weight: 600; font-size: .95rem;
}
.toggle-btn {
  flex-shrink: 0;
  padding: 7px 18px; border-radius: 999px; border: none; cursor: pointer;
  font-family: var(--font-display); font-weight: 700; font-size: .85rem;
  background: #ff6b6b; color: #fff;
  transition: background .18s, color .18s;
}
.toggle-btn.on {
  background: #38d9a9; color: #fff;
}
.btn-danger {
  background: #ff6b6b;
  box-shadow: 0 4px 0 #e03131;
}

/* ===========================================================
   Summary
   =========================================================== */
.podium-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: 0 6px 0 rgba(43,33,64,.08);
}
.podium-row .rank { font-family: var(--font-display); font-weight: 800; font-size: 1.4rem; width: 34px; text-align: center; }
.podium-row .name { flex: 1; font-weight: 700; font-size: 1.1rem; }
.podium-row .stat { color: var(--ink-soft); font-weight: 600; }
.podium-row.first { background: linear-gradient(120deg, #fff5cc, #ffe6a0); }

/* ===========================================================
   Confetti canvas
   =========================================================== */
#confetti {
  position: fixed; inset: 0; z-index: 40;
  pointer-events: none; width: 100%; height: 100%;
}

/* utility */
.spacer-sm { height: 6px; }
.spacer { height: 16px; }
.text-center { text-align: center; }
.fade-list > * { animation: screen-in .3s ease both; }

@media (min-height: 720px) {
  .card { max-height: 60dvh; }
}

/* ===========================================================
   Monetization — locks, teaser, nudge, upsell, paywall
   =========================================================== */

/* locked mode card (mode select) */
.choice.locked { filter: saturate(.7); }
.choice.locked h3, .choice.locked p { opacity: .9; }

/* blurred premium text (teaser card + paywall peek) */
.blurred {
  filter: blur(7px);
  user-select: none; -webkit-user-select: none;
}

/* in-game teaser card */
.card.teaser { position: relative; }
.card.teaser .type-tag { background: rgba(0,0,0,.28); }

/* repetition nudge bar (game screen) */
.nudge-bar {
  display: flex; align-items: center; gap: 10px;
  background: #fff3bf; color: var(--ink);
  border-radius: var(--radius);
  padding: 10px 12px; margin-top: 10px;
  box-shadow: 0 5px 0 rgba(43,33,64,.1);
  font-size: .9rem; font-weight: 600;
  animation: screen-in .3s ease both;
}
.nudge-bar > span { flex: 1; }
.nudge-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.nudge-actions .btn { width: auto; min-height: 40px; padding: 8px 14px; font-size: .95rem; box-shadow: 0 4px 0 var(--accent-deep); }
.nudge-actions .icon-btn { width: 40px; height: 40px; min-height: 40px; }

/* summary upsell card */
.upsell-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  margin-top: 16px; cursor: pointer; text-align: left;
  border: none; border-radius: var(--radius-lg);
  padding: 16px 18px; color: var(--white);
  background: linear-gradient(120deg, var(--grape), var(--pink));
  box-shadow: var(--shadow); font-family: var(--font-body);
  transition: transform .08s ease;
}
.upsell-card:active { transform: translateY(3px); }
.upsell-emoji { font-size: 2rem; flex: 0 0 auto; }
.upsell-text { flex: 1; font-size: .95rem; line-height: 1.25; }
.upsell-cta { font-family: var(--font-display); font-weight: 800; flex: 0 0 auto; }

/* paywall modal */
.modal.paywall { max-width: 400px; padding: 16px 18px 10px; }
.modal.paywall .big-emoji { font-size: 1.9rem; }
.modal.paywall h2 { margin: 0 0 4px; font-size: 1.25rem; }
.modal.paywall .paywall-desc { margin-bottom: 8px; font-size: .85rem; line-height: 1.3; }
.modal.paywall .peek {
  position: relative; margin: 0 0 10px;
  background: var(--pink); color: #fff;
  border-radius: var(--radius); padding: 8px 14px;
  min-height: 40px; display: grid; place-items: center; text-align: center;
  overflow: hidden;
}
.peek-tag {
  position: absolute; top: 6px; left: 10px;
  background: rgba(0,0,0,.28); border-radius: 999px;
  padding: 3px 10px; font-size: .75rem; font-weight: 700;
}
.peek-text {
  font-family: var(--font-display); font-weight: 700; font-size: .95rem; padding: 0 6px;
  line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}

.tier-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.tier {
  position: relative; display: flex; align-items: center; gap: 12px;
  border: 3px solid #f0ebf7; background: var(--white); cursor: pointer;
  border-radius: var(--radius); padding: 8px 12px; text-align: left;
  font-family: var(--font-body); transition: transform .08s ease, border-color .15s ease;
}
.tier:active { transform: translateY(2px); }
.tier-best { border-color: var(--grape); }
.tier-emoji { font-size: 1.3rem; flex: 0 0 auto; }
.tier-main { flex: 1; display: flex; flex-direction: column; }
.tier-main b { font-size: .96rem; }
.tier-sub { color: var(--ink-soft); font-size: .75rem; }
.tier-price { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; flex: 0 0 auto; }
.tier-flag {
  position: absolute; top: -9px; right: 12px;
  background: var(--grape); color: #fff; border-radius: 999px;
  padding: 2px 10px; font-size: .7rem; font-weight: 800; letter-spacing: .5px;
}

.modal.paywall .btn { min-height: 48px; padding: 12px 18px; font-size: 1.05rem; }
.modal.paywall [data-act="verify"] { margin-bottom: 8px; }
.redeem { display: flex; gap: 8px; margin-top: 8px; }
.redeem .text-input { min-height: 42px; font-size: 1rem; }
.redeem .icon-btn { width: 42px; height: 42px; min-height: 42px; }
.redeem-msg { min-height: 0; margin: 4px 0 6px; font-weight: 600; }
.modal.paywall .hint { font-size: .76rem; }

/* ===========================================================
   Auth — login / signup screen
   =========================================================== */
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  box-shadow: var(--shadow-soft);
  width: 100%;
  margin-top: 24px;
}

.input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e0f0;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
  -webkit-appearance: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--ink-soft); opacity: 0.7; }

.user-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 6px 2px; margin-bottom: 4px;
  font-size: .82rem; color: var(--ink-soft); font-weight: 600;
}
.btn-logout {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: .82rem; font-weight: 600;
  font-family: var(--font-body); padding: 4px 8px;
  border-radius: 999px; transition: background .15s;
  text-decoration: underline;
}
.btn-logout:hover { background: rgba(43,33,64,.06); }

.btn-forgot {
  background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: .82rem; font-weight: 600;
  font-family: var(--font-body); padding: 4px 0;
  text-decoration: underline; text-align: center; width: 100%;
}
.btn-forgot:hover { color: var(--accent); }

.auth-consent {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: .8rem; color: var(--ink-soft); line-height: 1.35;
  cursor: pointer; padding: 2px 0;
}
.auth-consent input { flex-shrink: 0; margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); }
.auth-consent a { color: var(--accent); font-weight: 600; }

/* "Play as guest" — quiet alternative under the auth card */
.btn-guest {
  margin-top: 16px;
  background: transparent;
  border: 2px dashed rgba(255,255,255,.55);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 22px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-guest:hover { background: rgba(255,255,255,.45); border-color: rgba(255,255,255,.9); }
.btn-guest:active { transform: translateY(1px); }

/* ---- Google sign-in ---- */
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 13px 18px;
  background: var(--white); color: #3c4043;
  border: 1.5px solid #dadce0; border-radius: 999px;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
  cursor: pointer; transition: background .15s, box-shadow .15s;
}
.btn-google:hover { background: #f7f8f8; box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.btn-google:active { background: #f1f3f4; }
.btn-google:disabled { opacity: .6; cursor: default; }
.btn-google.is-loading span::after { content: "…"; }
.btn-google svg { flex-shrink: 0; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink-soft); font-size: .82rem; font-weight: 600;
  margin: 2px 0;
}
.auth-divider::before, .auth-divider::after {
  content: ""; flex: 1; height: 1px; background: #e6e3ee;
}

/* ---- premium badge (home screen) ---- */
.premium-status {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #ffd43b 0%, #ff922b 100%);
  border-radius: var(--radius); padding: 12px 16px;
  box-shadow: 0 4px 16px rgba(255, 180, 0, .35);
  margin-bottom: 4px;
}
.premium-status .ps-crown { font-size: 1.8rem; line-height: 1; }
.premium-status .ps-text { flex: 1; }
.premium-status .ps-title {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1rem; color: #fff; letter-spacing: .02em;
}
.premium-status .ps-sub { font-size: .78rem; color: rgba(255,255,255,.85); font-weight: 600; margin-top: 1px; }
.premium-status .ps-refresh {
  background: rgba(255,255,255,.25); border: none; cursor: pointer;
  font-size: .78rem; font-weight: 700; color: #fff;
  font-family: var(--font-body); padding: 4px 10px;
  border-radius: 999px; transition: background .15s; white-space: nowrap;
}
.premium-status .ps-refresh:hover { background: rgba(255,255,255,.4); }

/* premium crown chip in game header */
.premium-chip {
  font-size: .72rem; font-weight: 800; font-family: var(--font-display);
  background: linear-gradient(135deg, #ffd43b, #ff922b);
  color: #fff; padding: 2px 8px; border-radius: 999px;
  letter-spacing: .04em; vertical-align: middle; margin-left: 4px;
}

/* gold tint on user-row when premium */
.user-row.is-premium { color: #b37400; }
.user-row.is-premium .btn-logout { color: #b37400; }

/* ---- clink overlay (start animation) ---- */
.clink-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(255, 107, 107, 0.96);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  pointer-events: none;
  animation: clink-fade-in .18s ease;
}
.clink-mugs { display: flex; gap: 0; font-size: 5.5rem; line-height: 1; }
.clink-l { display: inline-block; animation: clink-slide-l .65s cubic-bezier(.36,.07,.19,.97) .1s both; }
.clink-r { display: inline-block; animation: clink-slide-r .65s cubic-bezier(.36,.07,.19,.97) .1s both; }
.clink-label {
  color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: 2.2rem; margin-top: 18px;
  animation: clink-pop .4s ease .62s both;
}
.clink-out { animation: clink-fade-out .32s ease both; }

@keyframes clink-slide-l   { 0%{transform:translateX(-70px) rotate(-22deg)} 55%{transform:translateX(5px) rotate(8deg)} 100%{transform:translateX(0) rotate(0)} }
@keyframes clink-slide-r   { 0%{transform:translateX(70px) rotate(22deg)}   55%{transform:translateX(-5px) rotate(-8deg)} 100%{transform:translateX(0) rotate(0)} }
@keyframes clink-pop       { from{opacity:0;transform:translateY(10px) scale(.9)} to{opacity:1;transform:translateY(0) scale(1)} }
@keyframes clink-fade-in   { from{opacity:0} to{opacity:1} }
@keyframes clink-fade-out  { from{opacity:1} to{opacity:0} }

/* ---- drink animation overlay ---- */
.drink-overlay {
  position: fixed; inset: 0; z-index: 250; pointer-events: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden;
}
.drink-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 55%, rgba(255,212,59,.38) 0%, transparent 70%);
  animation: drink-bg .85s ease both;
}
.drink-mug {
  font-size: 5.5rem; position: relative; z-index: 1;
  animation: drink-mug-pop .5s cubic-bezier(.36,.07,.19,.97) both;
}
.drink-count {
  color: #fff; font-family: var(--font-display); font-weight: 800;
  font-size: 1.5rem; margin-top: 10px; position: relative; z-index: 1;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
  animation: clink-pop .3s ease .28s both;
}
.drink-bubble {
  position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.55); pointer-events: none;
  animation: drink-bubble-rise var(--b-dur,.7s) ease var(--b-del,0s) both;
}
@keyframes drink-mug-pop {
  0%   { transform: scale(0) rotate(-18deg); opacity: 0; }
  60%  { transform: scale(1.3) rotate(6deg);  opacity: 1; }
  100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}
@keyframes drink-bg          { from{opacity:0} to{opacity:1} }
@keyframes drink-bubble-rise {
  0%   { transform: translateY(0) scale(1);    opacity: .75; }
  100% { transform: translateY(-130px) scale(.2); opacity: 0;   }
}

/* ---- podium row slide-in (summary screen) ---- */
.podium-row { animation: podium-in .4s ease both; }
@keyframes podium-in { from{opacity:0;transform:translateY(20px)} to{opacity:1;transform:translateY(0)} }

/* ---- global leaderboard widget ---- */
.leaderboard-widget {
  width: 100%; background: rgba(255,255,255,.08);
  border-radius: 18px; padding: 14px 16px;
  box-sizing: border-box;
}
.lb-title {
  font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  color: rgba(255,255,255,.9); margin-bottom: 10px; text-align: center;
}
.lb-row {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px; border-bottom: 1px solid rgba(255,255,255,.07);
  font-family: var(--font-display); font-weight: 600; font-size: .9rem;
  animation: podium-in .35s ease both;
}
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 28px; text-align: center; font-size: 1rem; }
.lb-emoji { font-size: 1.1rem; }
.lb-name { flex: 1; color: rgba(255,255,255,.9); }
.lb-sips { color: rgba(255,255,255,.6); font-size: .85rem; }
.lb-loading, .lb-empty {
  text-align: center; color: rgba(255,255,255,.45);
  font-family: var(--font-display); font-size: .85rem; padding: 6px 0;
}

/* ---- tilt hint (mode screen) ---- */
.tilt-hint {
  text-align: center; color: var(--ink-soft); font-size: .9rem;
  font-weight: 600; margin-top: 10px;
  animation: tilt-pulse 2.2s ease infinite;
}
.btn-tilt-perm {
  display: block; width: 100%; background: none;
  border: 2px solid var(--ink-soft); cursor: pointer;
  color: var(--ink-soft); font-size: .88rem; font-weight: 700;
  font-family: var(--font-body); padding: 9px 18px;
  border-radius: 999px; margin-top: 12px;
  transition: border-color .15s, color .15s;
}
.btn-tilt-perm:hover { border-color: var(--accent); color: var(--accent); }
@keyframes tilt-pulse { 0%,100%{opacity:.65} 50%{opacity:1} }

/* ---- custom cards screen ---- */
.custom-card-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: var(--white);
  border-radius: var(--radius); box-shadow: var(--shadow-soft);
  margin-bottom: 8px; transition: opacity .2s;
}
.custom-card-item.cc-disabled { opacity: .45; }
.cc-text { font-size: .95rem; color: var(--ink); line-height: 1.4; }
.cc-meta { font-size: .78rem; font-weight: 700; color: var(--ink-soft); margin-top: 3px; }
/* per-card enable toggle */
.cc-toggle { position: relative; flex-shrink: 0; width: 36px; height: 20px; cursor: pointer; }
.cc-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.cc-track {
  position: absolute; inset: 0; border-radius: 999px;
  background: #ddd; transition: background .2s;
}
.cc-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.cc-toggle input:checked + .cc-track { background: #38d9a9; }
.cc-toggle input:checked + .cc-track::after { transform: translateX(16px); }
.cc-del {
  background: none; border: none; cursor: pointer; font-size: 1.1rem;
  padding: 2px 6px; border-radius: 8px; color: var(--ink-soft);
  transition: background .15s; flex-shrink: 0;
}
.cc-del:hover { background: #ffe0e0; color: #e84b4b; }
.cc-add-form {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow-soft); margin-bottom: 18px;
}
.cc-type-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 0; }
.cc-type-btn {
  font-family: var(--font-body); font-size: .8rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; background: #f0edf8; color: var(--ink-soft);
  transition: all .15s;
}
.cc-type-btn.selected { background: var(--accent); color: #fff; border-color: var(--accent-deep); }
