/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ===== SCREEN READER ONLY (SEO: sr-only for H1 keyword expansion) ===== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===== VARIABLES ===== */
:root {
  /* Glass size — scales with viewport height */
  --glass-h:      clamp(200px, 42dvh, 390px);
  --glass-w:      calc(var(--glass-h) * 0.615);
  --glass-taper:  10%;
  --rim-h:        clamp(14px, 2.8dvh, 26px);
  --base-w:       calc(var(--glass-w) * 0.8);
  --base-h:       clamp(10px, 2dvh, 20px);

  --beer-amber: #f5a623;
  --gold:       #f0a500;
}

/* ===== BASE ===== */
html {
  height: 100%;
}
body {
  min-height: 100%;           /* allows body to grow past viewport for seo-section */
  background-color: #ddd0b8;  /* matches seo-section so no white flash below .page */
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

/* ===== PAGE — fits viewport, no scroll, fix height ===== */
.page {
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* no justify-content: center — tab-view uses flex:1 to fill space */
  gap: clamp(0.4rem, 1.5dvh, 1.2rem);
  padding:
    max(env(safe-area-inset-top), clamp(0.6rem, 2dvh, 1.5rem))
    1rem
    max(env(safe-area-inset-bottom), clamp(0.4rem, 1dvh, 0.8rem));

  /* background:
    radial-gradient(ellipse 80% 55% at 50% 0%, #fff8ee 0%, transparent 65%),
    linear-gradient(160deg, #f5ede0 0%, #ede0cc 55%, #e5d5bf 100%); */

  background: #181818;
  /* Dot texture */
  background-color: #171717;
}

.page::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle 1px at 1px 1px, rgba(160,120,60,0.07) 1px, transparent 0);
  background-size: 26px 26px;
  pointer-events: none;
  z-index: 0;
}

/* ===== HEADER ===== */
.header {
  text-align: center;
  flex-shrink: 0;
  z-index: 1;
}

.title {
  font-size: clamp(2rem, 6dvh, 3.4rem);
  font-weight: 900;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #d4820a 0%, #f5a623 45%, #e07b00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(200,120,0,0.2));
  line-height: 1.1;
}

.subtitle {
  color: #a07848;
  font-size: clamp(0.75rem, 2dvh, 1.05rem);
  margin-top: 0.2rem;
  letter-spacing: 0.06em;
  font-weight: 700;
}

/* ===== MAIN ===== */
.main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 1.8dvh, 2rem);
  z-index: 1;
  flex-shrink: 0;
}

/* ===== GLASS SCENE — tap target ===== */
.glass-scene {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.glass-scene:active .glass {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

/* Glass shake on overflow */
@keyframes glassShake {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  18%       { transform: translateX(-5px) rotate(-1.8deg); }
  36%       { transform: translateX(5px) rotate(1.8deg); }
  54%       { transform: translateX(-4px) rotate(-1.2deg); }
  72%       { transform: translateX(4px) rotate(1.2deg); }
  90%       { transform: translateX(-2px) rotate(-0.6deg); }
}

.glass-scene.shaking {
  animation: glassShake 0.45s ease-in-out 2;
}

/* Pre-pour anticipation shake (lighter, single run) */
.glass-scene.pre-shake {
  animation: glassShake 0.4s ease-in-out 1;
}

/* ===== RIM TOP ===== */
.glass-rim-top {
  width: var(--glass-w);
  height: var(--rim-h);
  border-radius: 50%;
  position: relative;
  z-index: 30;
  margin-bottom: calc(var(--rim-h) * -0.5);

  background: radial-gradient(ellipse 100% 100% at 50% 40%,
    #c8ddf0 0%, #dff0ff 30%, #f5fbff 55%, #ffffff 70%, #f0f8ff 85%, #d8eeff 100%
  );
  border: 2px solid rgba(180, 215, 255, 0.9);
  box-shadow:
    0 -3px 6px rgba(255,255,255,0.9),
    0  4px 10px rgba(100,150,200,0.25),
    inset 0 3px 6px rgba(255,255,255,0.8),
    inset 0 -2px 5px rgba(100,160,220,0.2);
}

/* ===== GLASS BODY ===== */
.glass {
  width: var(--glass-w);
  height: var(--glass-h);
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;

  clip-path: polygon(
    0%                                0%,
    100%                              0%,
    calc(100% - var(--glass-taper))  100%,
    var(--glass-taper)               100%
  );

  background: linear-gradient(180deg,
    rgba(210,235,255,0.12) 0%,
    rgba(190,220,255,0.06) 60%,
    rgba(170,205,245,0.10) 100%
  );
}

/* ===== BEER FILL ===== */
.beer-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 0%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow: hidden;
}

/* ===== FOAM ===== */
.foam {
  position: relative;
  width: 100%;
  height: clamp(24px, 5dvh, 36px);
  flex-shrink: 0;
  background: linear-gradient(180deg, #fffcf8 0%, #fff4e2 60%, #ffe9c5 100%);
  overflow: visible;
}

.foam::before {
  content: '';
  position: absolute;
  top: -14px; left: -2px; right: -2px;
  height: 22px;
  background:
    radial-gradient(ellipse 22px 16px at  8% 100%, #fffcf8 52%, transparent 53%),
    radial-gradient(ellipse 26px 18px at 19% 100%, #fff8f0 52%, transparent 53%),
    radial-gradient(ellipse 20px 14px at 30% 100%, #fffcf8 52%, transparent 53%),
    radial-gradient(ellipse 28px 18px at 42% 100%, #fff8f0 52%, transparent 53%),
    radial-gradient(ellipse 22px 16px at 54% 100%, #fffcf8 52%, transparent 53%),
    radial-gradient(ellipse 26px 18px at 66% 100%, #fff8f0 52%, transparent 53%),
    radial-gradient(ellipse 20px 14px at 78% 100%, #fffcf8 52%, transparent 53%),
    radial-gradient(ellipse 24px 16px at 90% 100%, #fff8f0 52%, transparent 53%);
}

.foam::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(200,160,80,0.12) 100%);
}

.foam-bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.8);
  box-shadow: inset 0 -2px 3px rgba(200,160,80,0.2), 0 1px 2px rgba(255,255,255,0.9);
  animation: bubbleFloat 2.2s infinite ease-in-out alternate;
}
.foam-bubble-1 { width: 11px; height: 11px; top:  4px; left:  7%; animation-delay: 0.0s; }
.foam-bubble-2 { width:  7px; height:  7px; top: 10px; left: 18%; animation-delay: 0.4s; }
.foam-bubble-3 { width: 13px; height: 13px; top:  3px; left: 31%; animation-delay: 0.7s; }
.foam-bubble-4 { width:  8px; height:  8px; top:  9px; left: 46%; animation-delay: 0.2s; }
.foam-bubble-5 { width: 12px; height: 12px; top:  4px; left: 59%; animation-delay: 0.9s; }
.foam-bubble-6 { width:  7px; height:  7px; top: 11px; left: 73%; animation-delay: 0.5s; }
.foam-bubble-7 { width: 10px; height: 10px; top:  5px; left: 86%; animation-delay: 0.3s; }

@keyframes bubbleFloat {
  from { transform: translateY(0px)  scale(1.0); opacity: 0.75; }
  to   { transform: translateY(-4px) scale(1.05); opacity: 1; }
}

/* Foam wave — animated scrolling blob layer overlaid on static ::before */
.foam-wave {
  position: absolute;
  top: -14px;
  left: -2px; right: -2px;
  height: 22px;
  /* 8 blobs evenly spaced across 50% tile — positions: 6.25%, 18.75%, … 93.75% */
  background-image:
    radial-gradient(ellipse 23px 17px at  6.25% 100%, rgba(255,252,248,0.9) 52%, transparent 53%),
    radial-gradient(ellipse 27px 19px at 18.75% 100%, rgba(255,248,240,0.9) 52%, transparent 53%),
    radial-gradient(ellipse 21px 15px at 31.25% 100%, rgba(255,252,248,0.9) 52%, transparent 53%),
    radial-gradient(ellipse 29px 19px at 43.75% 100%, rgba(255,248,240,0.9) 52%, transparent 53%),
    radial-gradient(ellipse 23px 17px at 56.25% 100%, rgba(255,252,248,0.9) 52%, transparent 53%),
    radial-gradient(ellipse 27px 19px at 68.75% 100%, rgba(255,248,240,0.9) 52%, transparent 53%),
    radial-gradient(ellipse 21px 15px at 81.25% 100%, rgba(255,252,248,0.9) 52%, transparent 53%),
    radial-gradient(ellipse 25px 17px at 93.75% 100%, rgba(255,248,240,0.9) 52%, transparent 53%);
  background-size: 50% 100%;
  background-repeat: repeat-x;
  pointer-events: none;
  animation: foamWave 4s linear infinite;
}

@keyframes foamWave {
  from { background-position-x: 0; }
  to   { background-position-x: 100%; }
}

/* ===== BEER LIQUID ===== */
.beer-liquid {
  flex: 1;
  position: relative;
  background: linear-gradient(90deg,
    #b06c0e 0%, #d4880f 12%, #f0a420 30%,
    #f7b733 50%, #f0a420 70%, #d4880f 88%, #b06c0e 100%
  );
  overflow: hidden;
}

.beer-liquid::before {
  content: '';
  position: absolute;
  top: -4px; left: -60%; width: 220%; height: 12px;
  background:
    radial-gradient(ellipse 32px 10px at 15% 100%, rgba(255,220,100,0.55) 50%, transparent 51%),
    radial-gradient(ellipse 28px  8px at 35% 100%, rgba(255,200,80,0.45)  50%, transparent 51%),
    radial-gradient(ellipse 32px 10px at 55% 100%, rgba(255,220,100,0.55) 50%, transparent 51%),
    radial-gradient(ellipse 28px  8px at 75% 100%, rgba(255,200,80,0.45)  50%, transparent 51%),
    radial-gradient(ellipse 32px 10px at 95% 100%, rgba(255,220,100,0.55) 50%, transparent 51%);
  animation: wave 2s linear infinite;
}

@keyframes wave {
  from { transform: translateX(0); }
  to   { transform: translateX(27.3%); }
}

.beer-liquid::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg,
    transparent 25%,
    rgba(255,230,120,0.22) 40%,
    rgba(255,245,180,0.35) 50%,
    rgba(255,230,120,0.22) 60%,
    transparent 75%
  );
  animation: glint 3s ease-in-out infinite;
}

@keyframes glint {
  0%   { transform: translateX(-120%); }
  60%  { transform: translateX(120%); }
  100% { transform: translateX(120%); }
}

/* ===== RISING BUBBLES ===== */
.bubble {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,
    rgba(255,248,200,0.9) 0%, rgba(255,220,80,0.4) 60%, rgba(255,200,50,0.1) 100%
  );
  border: 1px solid rgba(255,240,150,0.4);
  animation: rise linear infinite;
  bottom: -10px;
}
.bubble-1 { width: 5px; height: 5px; left: 10%; animation-duration: 2.3s; animation-delay: 0.0s; }
.bubble-2 { width: 8px; height: 8px; left: 21%; animation-duration: 3.0s; animation-delay: 0.6s; }
.bubble-3 { width: 4px; height: 4px; left: 34%; animation-duration: 2.1s; animation-delay: 1.1s; }
.bubble-4 { width: 6px; height: 6px; left: 46%; animation-duration: 2.6s; animation-delay: 0.3s; }
.bubble-5 { width: 4px; height: 4px; left: 58%; animation-duration: 2.0s; animation-delay: 0.9s; }
.bubble-6 { width: 7px; height: 7px; left: 70%; animation-duration: 2.7s; animation-delay: 1.5s; }
.bubble-7 { width: 4px; height: 4px; left: 80%; animation-duration: 2.2s; animation-delay: 0.4s; }
.bubble-8 { width: 5px; height: 5px; left: 90%; animation-duration: 2.9s; animation-delay: 1.8s; }

@keyframes rise {
  0%   { transform: translateY(0)      scale(1);   opacity: 0.8; }
  80%  { opacity: 0.6; }
  100% { transform: translateY(-500px) scale(0.4); opacity: 0; }
}

/* ===== "TAP TO POUR" PROMPT ===== */
.pour-prompt {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9;
  pointer-events: none;
  transition: opacity 0.4s ease, transform 0.4s ease;
  gap: 0.3rem;
}

.pour-prompt.hidden {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}

.pour-prompt-icon {
  font-size: clamp(2rem, 6dvh, 3.2rem);
  animation: pourBounce 2s ease-in-out infinite;
  line-height: 1;
  filter: drop-shadow(0 2px 6px rgba(160,100,0,0.25));
}

@keyframes pourBounce {
  0%, 100% { transform: translateY(0) rotate(-8deg) scale(1); }
  50%       { transform: translateY(clamp(-6px,-1.5dvh,-10px)) rotate(8deg) scale(1.08); }
}

.pour-prompt-pill {
  background: rgba(255, 248, 235, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 50px;
  padding: 0.3em 0.9em;
  box-shadow: 0 2px 12px rgba(160,100,0,0.18), inset 0 1px 0 rgba(255,255,255,0.8);
  border: 1px solid rgba(220,170,80,0.35);
}

.pour-prompt-text {
  font-size: clamp(0.65rem, 1.8dvh, 0.85rem);
  font-weight: 900;
  color: #a06820;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: promptPulse 1.8s ease-in-out infinite;
}

@keyframes promptPulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}

/* ===== GLASS 3D OVERLAY ===== */
.glass-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.overlay-left-wall {
  position: absolute; inset: 0;
  background: linear-gradient(90deg,
    rgba(80,120,180,0.28) 0%, rgba(100,140,200,0.14) 7%,
    rgba(100,140,200,0.05) 13%, transparent 22%
  );
}

.overlay-right-wall {
  position: absolute; inset: 0;
  background: linear-gradient(270deg,
    rgba(80,110,170,0.18) 0%, rgba(100,130,190,0.08) 6%, transparent 14%
  );
}

.overlay-glare-main {
  position: absolute;
  top: 0; left: 11%; width: 14%; bottom: 0;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.55) 0%, rgba(255,255,255,0.30) 30%,
    rgba(255,255,255,0.12) 65%, rgba(255,255,255,0.04) 100%
  );
  border-radius: 50%;
  filter: blur(3px);
}

.overlay-glare-thin {
  position: absolute;
  top: 0; left: 16%; width: 4px; height: 70%;
  background: linear-gradient(180deg, rgba(255,255,255,0.90) 0%, rgba(255,255,255,0.40) 50%, transparent 100%);
  border-radius: 2px;
}

.overlay-glare-right {
  position: absolute;
  top: 2%; right: 13%; width: 5px; height: 38%;
  background: linear-gradient(180deg, rgba(255,255,255,0.42) 0%, transparent 100%);
  border-radius: 3px;
}

/* Volume tick marks */
.glass::after {
  content: '';
  position: absolute;
  right: 6%; top: 4%; bottom: 4%; width: 1px;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 37px,
    rgba(180,210,255,0.28) 37px, rgba(180,210,255,0.28) 39px
  );
  z-index: 5;
  pointer-events: none;
}

/* ===== BASE RING ===== */
.glass-base-ring {
  width: var(--base-w);
  height: var(--base-h);
  border-radius: 50%;
  position: relative;
  z-index: 30;
  margin-top: calc(var(--base-h) * -0.6);
  background: radial-gradient(ellipse 100% 100% at 50% 50%,
    #d8ecff 0%, #eaf4ff 40%, #ffffff 65%, #eef7ff 80%, #cce0f5 100%
  );
  border: 2px solid rgba(170,210,250,0.85);
  box-shadow:
    0  4px 12px rgba(100,150,210,0.2),
    0  2px  6px rgba(0,0,0,0.08),
    inset 0 2px 4px rgba(255,255,255,0.8),
    inset 0 -2px 4px rgba(100,160,220,0.18);
}

/* ===== TABLE SHADOW ===== */
.glass-shadow {
  width: calc(var(--glass-w) * 0.9);
  height: clamp(10px, 2dvh, 18px);
  background: radial-gradient(ellipse 80% 100% at 50% 0%,
    rgba(100,70,30,0.20) 0%, rgba(100,70,30,0.05) 60%, transparent 100%
  );
  margin-top: 5px;
}

/* ===== FOAM OVERFLOW — side drips ===== */
.foam-overflow {
  position: absolute;
  bottom: calc(var(--base-h) + 22px);
  width: 13px;
  background: linear-gradient(180deg, #fffcf8 0%, #ffe9c5 70%, rgba(255,233,197,0) 100%);
  height: 0;
  opacity: 0;
  transition: height 0.5s ease, opacity 0.4s ease;
  pointer-events: none;
  z-index: 25;
}

.foam-overflow-right {
  right: calc(50% - var(--glass-w) / 2 - 13px);
  border-radius: 0 8px 8px 0;
}

.foam-overflow-left {
  left: calc(50% - var(--glass-w) / 2 - 13px);
  border-radius: 8px 0 0 8px;
}

/* ===== OVERFLOW FOAM TOP (bubble above rim for 100%) ===== */
.overflow-foam-top {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: calc(var(--glass-w) * 0.88);
  height: 0;
  border-radius: 50% 50% 30% 30% / 80% 80% 30% 30%;
  background: radial-gradient(ellipse 90% 100% at 50% 80%,
    #fffcf8 20%, #fff4e0 55%, rgba(255,233,180,0) 100%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 40;
  transition: height 0.45s ease-out, opacity 0.3s ease;
}

/* ===== RESULT AREA ===== */
.result-area {
  text-align: center;
  min-height: clamp(54px, 11dvh, 95px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.result-final {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  animation: revealResult 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes revealResult {
  from { opacity: 0; transform: scale(0.4) translateY(20px); }
  to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.result-percent {
  font-size: clamp(3.2rem, 9dvh, 5.5rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #c47800 0%, #f5a623 40%, #ffcc44 65%, #e08800 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 3px 10px rgba(200,130,0,0.25));
}

.result-label {
  font-size: clamp(0.8rem, 2.2dvh, 1.2rem);
  font-weight: 900;
  color: #8a5c20;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ===== WOOHOO special state ===== */
.result-final.woohoo .result-percent {
  font-size: clamp(3.5rem, 10dvh, 6rem);
  background: linear-gradient(90deg,
    #ff6b00, #ffcc00, #ff8c00, #ffd700, #ff6b00
  );
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 16px rgba(255,160,0,0.6));
  animation:
    revealResult   0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both,
    rainbowScroll  1.4s linear infinite;
}

.result-final.woohoo .result-label {
  font-size: clamp(1.3rem, 3.8dvh, 2.2rem);
  background: linear-gradient(90deg, #e06000, #ff9900, #e06000);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.06em;
  animation:
    woohooWiggle  0.45s ease-in-out infinite alternate,
    rainbowScroll 1.8s linear infinite;
}

@keyframes rainbowScroll {
  from { background-position: 0% center; }
  to   { background-position: 200% center; }
}

@keyframes woohooWiggle {
  from { transform: rotate(-4deg) scale(1.0); }
  to   { transform: rotate( 4deg) scale(1.08); }
}

/* ===== TAP HINT (after result) ===== */
.tap-hint {
  color: #b08a5a;
  font-size: clamp(0.72rem, 1.8dvh, 0.88rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.75;
  flex-shrink: 0;
  animation: promptPulse 2s ease-in-out infinite;
}

/* ===== POUR AGAIN BUTTON (kept for potential future use) ===== */
.btn-replay {
  background: linear-gradient(135deg, #f5a623 0%, #e07b00 100%);
  color: #fff8ee;
  border: none;
  border-radius: 50px;
  padding: clamp(0.6rem, 1.5dvh, 0.85rem) clamp(1.6rem, 4vw, 2.6rem);
  font-size: clamp(0.8rem, 2dvh, 1rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-transform: uppercase;
  font-family: inherit;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(200,120,0,0.32), 0 2px 6px rgba(0,0,0,0.10);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: btnAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  -webkit-tap-highlight-color: transparent;
}

@keyframes btnAppear {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

.btn-replay:hover  { transform: translateY(-3px) scale(1.05); box-shadow: 0 8px 28px rgba(200,120,0,0.42); }
.btn-replay:active { transform: translateY(0)    scale(0.97); box-shadow: 0 2px 10px rgba(200,120,0,0.28); }

/* ===== SITE FOOTER (SEO: keyword-rich, mobile-only — desktop shows tab-nav instead) ===== */
.site-footer {
  display: none; /* shown via @media (max-width: 768px) */
  position: absolute;
  bottom: max(env(safe-area-inset-bottom), 0.6rem);
  left: 1rem;
  right: 1rem;
  text-align: center;
  z-index: 1;
  pointer-events: none;
}

.site-footer p {
  color: #c4a078;
  font-size: clamp(0.52rem, 1.3dvh, 0.7rem);
  font-weight: 400;
  line-height: 1.55;
  opacity: 0.65;
  max-width: 44ch;
  margin: 0 auto;
}

.site-footer strong {
  font-weight: 700;
  opacity: 0.85;
}

/* =====================================================
   TAB VIEWS
   ===================================================== */
.tab-view {
  display: none;
  width: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0; /* allow flex shrink past content size */
}

.tab-view.active {
  display: flex;
}

/* =====================================================
   DESKTOP TAB NAV
   ===================================================== */
.tab-nav {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: rgba(200, 155, 80, 0.12);
  border: 1px solid rgba(200, 155, 80, 0.22);
  border-radius: 14px;
  flex-shrink: 0;
  width: min(480px, calc(100% - 2rem));
  z-index: 1;
}

.tab-nav__item {
  flex: 1;
  padding: 0.52em 0.6em;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #a07848;
  font-family: inherit;
  font-size: clamp(0.68rem, 1.7dvh, 0.84rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.tab-nav__item.active {
  background: linear-gradient(135deg, #d4820a 0%, #f5a623 100%);
  color: #fff8ee;
  box-shadow: 0 2px 10px rgba(200, 120, 0, 0.32);
}

.tab-nav__item:hover:not(.active) {
  background: rgba(200, 155, 80, 0.16);
}

/* =====================================================
   HAMBURGER BUTTON (mobile only — hidden on desktop)
   ===================================================== */
.hamburger {
  display: none;
  position: fixed;
  top: max(env(safe-area-inset-top), 0.75rem);
  right: 1rem;
  z-index: 300;
  width: 42px;
  height: 42px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  background: rgba(255, 248, 235, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(220, 170, 80, 0.38);
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 14px rgba(160, 100, 0, 0.16);
  -webkit-tap-highlight-color: transparent;
}

.hamburger__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #a06820;
  border-radius: 2px;
  transition: transform 0.28s ease, opacity 0.22s ease;
  transform-origin: center;
}

/* Animate to × when open */
.hamburger.open .hamburger__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open .hamburger__bar:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open .hamburger__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =====================================================
   MOBILE NAV OVERLAY
   ===================================================== */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(80, 45, 5, 0.48);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 350;
}

.nav-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

/* =====================================================
   MOBILE NAV SIDEBAR
   ===================================================== */
.nav-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(300px, 78vw);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding:
    max(env(safe-area-inset-top), 1.4rem)
    1.25rem
    max(env(safe-area-inset-bottom), 1.4rem);
  background: linear-gradient(160deg, #f9f1e6 0%, #ede0cc 100%);
  border-left: 1px solid rgba(200, 155, 80, 0.28);
  box-shadow: -10px 0 40px rgba(100, 55, 0, 0.2);
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 400;
  overflow-y: auto;
}

.nav-sidebar.open {
  transform: translateX(0);
}

.nav-sidebar__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.2rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid rgba(200, 155, 80, 0.2);
}

.nav-sidebar__brand {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #d4820a 0%, #f5a623 45%, #e07b00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-sidebar__close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(200, 155, 80, 0.14);
  color: #a06820;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-sidebar__close:hover {
  background: rgba(200, 155, 80, 0.26);
}

.nav-sidebar__links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-sidebar__item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.88rem 1rem;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: #9a7040;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-sidebar__item.active {
  background: linear-gradient(135deg, #d4820a 0%, #f5a623 100%);
  color: #fff8ee;
  box-shadow: 0 3px 14px rgba(200, 120, 0, 0.3);
}

.nav-sidebar__item:hover:not(.active) {
  background: rgba(200, 155, 80, 0.16);
}

.nav-sidebar__icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

/* =====================================================
   PLACEHOLDER VIEWS (Random Number, Drunk Cards)
   ===================================================== */
.placeholder-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.8rem, 2dvh, 1.4rem);
  text-align: center;
  padding: 2rem 1rem;
}

.placeholder-view__icon {
  font-size: clamp(3.5rem, 10dvh, 5.5rem);
  line-height: 1;
  animation: pourBounce 2.2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(160, 100, 0, 0.2));
}

.placeholder-view__title {
  font-size: clamp(1.5rem, 4.5dvh, 2.2rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #d4820a 0%, #f5a623 45%, #e07b00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(200, 120, 0, 0.18));
}

.placeholder-view__text {
  color: #a07848;
  font-size: clamp(0.82rem, 2.2dvh, 1rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

/* =====================================================
   RANDOM NUMBER VIEW
   ===================================================== */

/* Outer wrapper — fills the tab-view vertically */
.rnd-view {
  flex: 1;
  width: 100%;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(0.4rem, 1.2dvh, 0.8rem) 1rem clamp(0.5rem, 1.5dvh, 1rem);
  gap: clamp(0.6rem, 1.5dvh, 1rem);
  min-height: 0;
}

/* Arena — the "canvas" where numbers appear */
.rnd-arena {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 0;
  border-radius: 20px;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(255,248,235,0.7) 0%, transparent 70%),
    rgba(200, 155, 80, 0.07);
  border: 1.5px dashed rgba(200, 155, 80, 0.3);
  overflow: hidden;
}

/* Idle state (before Start) */
.rnd-idle {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 1.8dvh, 1rem);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.rnd-idle.hidden {
  opacity: 0;
  transform: scale(0.9);
}

.rnd-idle__icon {
  font-size: clamp(3rem, 9dvh, 5rem);
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, #f5a623 0%, #ffd166 50%, #e07b00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 18px rgba(200, 120, 0, 0.38));
  animation: pourBounce 2.2s ease-in-out infinite;
}

.rnd-idle__text {
  color: #a07848;
  font-size: clamp(0.85rem, 2.4dvh, 1.05rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  opacity: 0.85;
}

.rnd-idle__text strong {
  color: #d4820a;
}

/* The flying number — position & angle set by JS */
.rnd-number {
  position: absolute;
  display: none;
  font-size: clamp(3rem, 10dvh, 6rem); /* overridden per-spawn by JS */
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.03em;
  user-select: none;
  pointer-events: none;
  /* color, filter, left, top, transform all set inline by JS */
}

.rnd-number.pop {
  animation: rndPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes rndPop {
  0%   { scale: 0.05; opacity: 0; }
  55%  { scale: 1.25; opacity: 1; }
  78%  { scale: 0.92; }
  92%  { scale: 1.06; }
  100% { scale: 1;    opacity: 1; }
}

/* Controls bar */
.rnd-controls {
  display: flex;
  gap: 0.85rem;
  flex-shrink: 0;
}

.rnd-btn {
  padding: 0.62em 2.2em;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: clamp(0.85rem, 2.2dvh, 1rem);
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.rnd-btn--start {
  background: linear-gradient(135deg, #f5a623 0%, #e07b00 100%);
  color: #fff8ee;
  box-shadow: 0 4px 18px rgba(200, 120, 0, 0.38);
  animation: btnAppear 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.rnd-btn--stop {
  display: none;
  background: linear-gradient(135deg, #e63946 0%, #b01a24 100%);
  color: #fff;
  box-shadow: 0 4px 18px rgba(200, 30, 40, 0.38);
  animation: btnAppear 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.rnd-btn:hover  { transform: translateY(-3px) scale(1.05); }
.rnd-btn:active { transform: scale(0.96); }

.rnd-btn--rules {
  background: transparent;
  color: #c07000;
  border: 2px solid rgba(200, 130, 0, 0.45);
  box-shadow: none;
  padding: 0.62em 1.4em;
  font-size: 0.88em;
}
.rnd-btn--rules:hover {
  background: rgba(245, 166, 35, 0.12);
  border-color: #f5a623;
  color: #8a4a00;
  box-shadow: none;
}

/* ── Rules modal ── */
.rnd-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(20, 8, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}
.rnd-modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.rnd-modal {
  position: relative;
  background: linear-gradient(160deg, #fffdf5 0%, #fff8e8 100%);
  border: 1.5px solid rgba(200, 150, 60, 0.3);
  border-radius: 22px;
  padding: 2rem 1.8rem 1.6rem;
  width: min(400px, 100%);
  box-shadow: 0 24px 60px rgba(20, 8, 0, 0.35);
  transform: translateY(18px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.rnd-modal-overlay.visible .rnd-modal {
  transform: translateY(0) scale(1);
}

.rnd-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: none;
  background: rgba(200, 130, 0, 0.1);
  color: #9a6030;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.rnd-modal__close:hover {
  background: rgba(200, 130, 0, 0.22);
  color: #5a2800;
}

.rnd-modal__header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.rnd-modal__header-icon {
  font-size: 1.7rem;
  line-height: 1;
}
.rnd-modal__title {
  font-size: 1.25rem;
  font-weight: 900;
  background: linear-gradient(135deg, #b86800 0%, #f5a623 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.rnd-modal__intro {
  font-size: 0.88rem;
  color: #7a4818;
  line-height: 1.65;
  margin-bottom: 1.2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(200, 150, 60, 0.2);
}

.rnd-modal__rules {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1.2rem;
}

.rnd-modal__rule {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  background: rgba(255, 245, 220, 0.6);
  border: 1px solid rgba(200, 150, 60, 0.2);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.rnd-modal__rule-icon {
  font-size: 1.6rem;
  line-height: 1;
  flex-shrink: 0;
}
.rnd-modal__rule-body strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 900;
  color: #6a3800;
  margin-bottom: 0.25rem;
}
.rnd-modal__rule-body p {
  font-size: 0.83rem;
  color: #8a5020;
  line-height: 1.55;
  margin: 0;
}

.rnd-modal__tip {
  font-size: 0.78rem;
  color: #a07040;
  text-align: center;
  font-style: italic;
}

/* =====================================================
   DRUNK CARDS VIEW
   ===================================================== */

.cards-view {
  flex: 1;
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* ── Shared screen states (intro / done) ── */
.cards-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: clamp(0.9rem, 2.4dvh, 1.5rem);
  flex: 1;
  padding: 1.5rem 1rem;
}

.cards-screen.active { display: flex; }

.cards-screen__icon {
  font-size: clamp(3.5rem, 10dvh, 5.5rem);
  line-height: 1;
  animation: pourBounce 2.2s ease-in-out infinite;
  filter: drop-shadow(0 4px 14px rgba(160,100,0,0.22));
}

.cards-screen__title {
  font-size: clamp(1.5rem, 4.5dvh, 2.2rem);
  font-weight: 900;
  background: linear-gradient(135deg, #d4820a 0%, #f5a623 45%, #e07b00 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 2px 8px rgba(200,120,0,0.16));
}

.cards-screen__text {
  color: #a07848;
  font-size: clamp(0.82rem, 2.2dvh, 1rem);
  font-weight: 700;
  opacity: 0.8;
  line-height: 1.55;
}

/* ── Game layout ── */
.cards-game {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.5rem, 1.4dvh, 0.9rem);
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: clamp(0.4rem, 1dvh, 0.7rem) 1rem clamp(0.5rem, 1.2dvh, 0.8rem);
}

.cards-game.active { display: flex; }

/* ── Progress header ── */
.cards-header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.cards-counter {
  font-size: clamp(0.72rem, 1.8dvh, 0.85rem);
  font-weight: 700;
  color: #a07848;
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.cards-progress-track {
  width: 100%;
  height: 4px;
  border-radius: 99px;
  background: rgba(200,155,80,0.18);
  overflow: hidden;
}

.cards-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: linear-gradient(90deg, #d4820a, #f5a623);
  transition: width 0.45s cubic-bezier(0.4,0,0.2,1);
}

/* ── 3-D Card stage ── */
.cards-stage {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  perspective: 1200px;
}

.cards-card {
  width: min(290px, 82vw);
  aspect-ratio: 3 / 4;
  max-height: 96%;
  transform-style: preserve-3d;
  /* JS drives transform / opacity during flip */
}

/* Visual card face */
.cards-card__inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background: #fffdf7;
  border: 1.5px solid rgba(200,155,80,0.25);
  box-shadow:
    0 10px 38px rgba(100,60,0,0.13),
    0 3px 10px rgba(100,60,0,0.08),
    inset 0 1px 0 rgba(255,255,255,0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.4rem 1.1rem 1.6rem;
  gap: clamp(0.7rem, 2dvh, 1.1rem);
  overflow: hidden;
  /* --card-color and --card-bg set by JS */
}

/* Colored top accent bar */
.cards-card__inner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--card-color, #f5a623);
  border-radius: 22px 22px 0 0;
}

/* Card number watermark bottom-right */
.cards-card__inner::after {
  content: attr(data-num);
  position: absolute;
  bottom: 0.7rem;
  right: 0.95rem;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--card-color, #a07848);
  opacity: 0.28;
}

/* Category badge */
.cards-card__badge {
  font-size: clamp(0.65rem, 1.7dvh, 0.8rem);
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 0.28em 0.9em;
  border-radius: 99px;
  background: var(--card-bg, rgba(245,166,35,0.12));
  color: var(--card-color, #d4820a);
  flex-shrink: 0;
}

/* Question text */
.cards-card__question {
  font-size: clamp(0.9rem, 2.6dvh, 1.2rem);
  font-weight: 700;
  color: #4a2e0e;
  line-height: 1.55;
  text-align: center;
  margin: 0;
}

/* ── Controls ── */
.cards-controls {
  display: flex;
  gap: 0.7rem;
  flex-shrink: 0;
  width: 100%;
  max-width: 340px;
}

/* ── Shared button base ── */
.cards-btn {
  padding: 0.65em 1.5em;
  border: none;
  border-radius: 50px;
  font-family: inherit;
  font-size: clamp(0.85rem, 2.2dvh, 1rem);
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.cards-btn--primary {
  background: linear-gradient(135deg, #f5a623 0%, #e07b00 100%);
  color: #fff8ee;
  box-shadow: 0 4px 18px rgba(200,120,0,0.38);
  animation: btnAppear 0.45s cubic-bezier(0.34,1.56,0.64,1) both;
}

.cards-btn--next {
  flex: 1; /* stretch in controls row */
}

.cards-btn--ghost {
  background: rgba(200,155,80,0.13);
  color: #a07848;
  border: 1.5px solid rgba(200,155,80,0.28);
  font-size: 1.15rem;
  padding: 0.6em 0.85em;
}

.cards-btn:hover  { transform: translateY(-2px) scale(1.04); }
.cards-btn:active { transform: scale(0.97); }

/* =====================================================
   RESPONSIVE: MOBILE (≤ 768px)
   - Hide desktop tab-nav, show hamburger + footer
   ===================================================== */
@media (max-width: 768px) {
  .tab-nav    { display: none; }
  .hamburger  { display: flex; }
  .site-footer { display: block; }
}

/* =====================================================
   RESPONSIVE: DESKTOP (≥ 769px)
   - Show desktop tab-nav, hide hamburger + mobile footer
   ===================================================== */
@media (min-width: 769px) {
  .hamburger   { display: none; }
  .site-footer { display: none; }
}

/* =====================================================
   SEO TEXT SECTION
   Below .page in DOM — scrollable, tab-synced
   ===================================================== */
/* =====================================================
   SEO TEXT SECTION
   ===================================================== */

.seo-section {
  width: 100%;
  background-image: radial-gradient(circle 1px at 1px 1px, rgba(120,80,30,0.08) 1px, transparent 0);
  background-size: auto, auto, 26px 26px;
  padding: clamp(2.2rem, 5vw, 3.8rem) clamp(1.2rem, 5vw, 2rem) clamp(3.5rem, 9vw, 5.5rem);
  /* background:
  radial-gradient(ellipse 80% 40% at 50% 0%, rgba(255,240,200,0.18) 0%, transparent 60%),
  linear-gradient(180deg, #ddd0b8 0%, #cfc3a2 100%);
  background-color: #d4c8a8; */
  background:
  radial-gradient(ellipse 80% 40% at 50% 0%, rgba(228, 223, 209, 0.18) 0%, transparent 60%),
  linear-gradient(180deg, #ddd0b8 0%, #cfc3a2 100%);
  background-color: #d4c8a8;
}

/* Amber rule above content — visual break from the game */
.seo-section::before {
  content: '';
  display: block;
  width: 56px;
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #d4820a, #f5a623, #e07b00);
  box-shadow: 0 2px 10px rgba(200,120,0,0.32);
  margin: 0 auto 2.6rem;
}

/* ── Panel show / hide ── */
.seo-panel {
  display: none;
  max-width: 780px;
  margin: 0 auto;
}

.seo-panel.active {
  display: block;
  animation: seoPanelIn 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes seoPanelIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Title — amber gradient, matches app header style ── */
.seo-panel__title {
  font-size: clamp(1.25rem, 3.2dvh, 1.7rem);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin-bottom: 1.1rem;
  padding-bottom: 0.75rem;
  background: linear-gradient(135deg, #b86800 0%, #f5a623 45%, #d4820a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 1px 3px rgba(180,100,0,0.18));
  border-bottom: 1.5px solid rgba(200,145,55,0.22);
}

/* ── Sub-heading — left amber border accent ── */
.seo-panel__sub {
  font-size: clamp(0.88rem, 2.1dvh, 1.05rem);
  font-weight: 900;
  color: #7a4810;
  letter-spacing: 0.02em;
  line-height: 1.3;
  margin: 1.8rem 0 0.65rem;
  padding-left: 0.8rem;
  border-left: 3px solid #f5a623;
}

/* ── Body paragraphs ── */
.seo-panel p {
  font-size: clamp(0.83rem, 1.85dvh, 0.97rem);
  color: #6a4518;
  line-height: 1.82;
  margin-bottom: 0.9rem;
}

/* ── Keyword highlights — subtle amber pill ── */
.seo-panel strong {
  color: #8a4a00;
  font-weight: 800;
  background: rgba(245, 166, 35, 0.14);
  padding: 0.06em 0.25em;
  border-radius: 4px;
}

/* ── List — card container with row dividers ── */
.seo-panel__list {
  list-style: none;
  padding: 0.2rem 0;
  margin: 0.3rem 0 1.3rem;
  background: rgba(255, 248, 230, 0.42);
  border: 1px solid rgba(200, 150, 60, 0.2);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.seo-panel__list li {
  position: relative;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  font-size: clamp(0.8rem, 1.85dvh, 0.93rem);
  color: #6a4518;
  line-height: 1.65;
  border-bottom: 1px solid rgba(200, 150, 60, 0.14);
  transition: background 0.15s ease;
}

.seo-panel__list li:last-child {
  border-bottom: none;
}

.seo-panel__list li:hover {
  background: rgba(245, 166, 35, 0.08);
}

/* Amber arrow bullet */
.seo-panel__list li::before {
  content: '→';
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: #d4820a;
  font-weight: 900;
  font-size: 0.9em;
  line-height: 1;
}

/* ── Desktop: generous side padding + 2-col list on wide screens ── */
@media (min-width: 769px) {
  .seo-section {
    padding-left:  clamp(2.5rem, 9vw, 7rem);
    padding-right: clamp(2.5rem, 9vw, 7rem);
  }

  /* Two-column list grid on desktop when 5+ items */
  .seo-panel__list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 248, 230, 0.42);
    border-radius: 14px;
  }

  /* Re-apply row borders only within each column */
  .seo-panel__list li {
    border-bottom: 1px solid rgba(200, 150, 60, 0.14);
    border-right: 1px solid rgba(200, 150, 60, 0.14);
  }

  /* Remove right border on even items (right column) */
  .seo-panel__list li:nth-child(even) {
    border-right: none;
  }

  /* Remove bottom border on last row */
  .seo-panel__list li:nth-last-child(-n+2) {
    border-bottom: none;
  }
}

/* =====================================================
   SITE-WIDE LEGAL FOOTER
   Below .seo-section — always visible on all screens
   ===================================================== */
.site-legal-footer {
  width: 100%;
  background: #1a0800;
  color: #9a7050;
  text-align: center;
  padding: 1.6rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.site-legal-footer__copy {
  font-size: 0.78rem;
  color: #7a5838;
}

.site-legal-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.1rem;
}

.site-legal-footer__links a {
  font-size: 0.82rem;
  font-weight: 700;
  color: #f5a623;
  text-decoration: none;
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
  transition: background 0.18s ease, color 0.18s ease;
}

.site-legal-footer__links a:hover {
  background: rgba(245,166,35,0.15);
  color: #ffd166;
}

.site-legal-footer__links a + a::before {
  content: '\00b7';
  margin-right: 0.5rem;
  color: #4a3020;
  font-weight: 400;
  pointer-events: none;
}

.site-legal-footer__age {
  font-size: 0.73rem;
  color: #5a3820;
  max-width: 480px;
}

.site-legal-footer__desc {
  font-size: 0.8rem;
  color: #7a5838;
  max-width: 640px;
  text-align: center;
  line-height: 1.5;
}
