/* ── SKWKY ERS Chat — Styles ─────────────────────────────────────────── */

:root {
  --skwky-blue: #1565C0;
  --skwky-blue-light: #1E88E5;
  --skwky-yellow: #FFD700;
  --skwky-yellow-light: #FFF3B0;
  --white: #FFFFFF;
  --bg: #E8E8E8;
  --bubble-other: #E8E8ED;
  --text-dark: #1A1A1A;
  --text-muted: #8A8A8E;
  --ers-neutral: #CCCCCC;
  --gradient-start: #545CFF;
  --gradient-end: #B633FF;
  --gradient-btn: linear-gradient(135deg, #545CFF 0%, #B633FF 100%);
}

/* ── Splash screen ──────────────────────────────────────────────────── */

#splash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  opacity: 1;
  transition: opacity 0.8s ease;
}

#splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

#splash-video {
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
}

/* ── Base reset ────────────────────────────────────────────────────── */

.hidden {
  display: none !important;
}

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

html, body {
  height: 100%;
  font-family: "DM Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

body {
  display: flex;
  flex-direction: column;
  max-width: 600px;
  margin: 0 auto;
  background: var(--white);
  position: relative;
}

/* ── Splash video overlay ──────────────────────────────────────────── */

#splash-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  z-index: 9999;
  overflow: hidden;
  transition: bottom 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

#splash-overlay.drift {
  bottom: calc(100vh - 80px);
  bottom: calc(100dvh - 80px);
}

/* Splash composite logo: duck + SKWKY_ text, flex-row */
.splash-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  transform-origin: center center;
  transition: top 1s cubic-bezier(0.4, 0.0, 0.2, 1),
              left 1s cubic-bezier(0.4, 0.0, 0.2, 1),
              transform 1s cubic-bezier(0.4, 0.0, 0.2, 1),
              gap 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.splash-logo-duck {
  height: clamp(70px, 16vw, 120px);
  width: auto;
  transform: translateX(-100vw);
  animation: duck-waddle-in 1.5s cubic-bezier(0.25, 0.8, 0.35, 1.05) 0.2s forwards;
  transition: height 1s cubic-bezier(0.4, 0.0, 0.2, 1),
              width 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.splash-logo-text {
  height: clamp(44px, 10vw, 75px);
  width: auto;
  opacity: 0;
  animation: text-fade-in 0.7s ease-out 1.5s forwards;
  transition: height 1s cubic-bezier(0.4, 0.0, 0.2, 1),
              width 1s cubic-bezier(0.4, 0.0, 0.2, 1);
}

/* Drift end-state: shrink & slide to exact navbar position + sizes.
   `top: 50%` stays — since the overlay also shrinks to 80px tall during
   drift, 50% of the overlay's height equals the navbar's center on any
   viewport, even when mobile browser chrome toggles vh mid-transition. */
#splash-overlay.drift .splash-logo {
  left: 40px;
  gap: 8px;
  transform: translate(0, -50%);
}
#splash-overlay.drift .splash-logo-duck {
  height: 28px;
}
#splash-overlay.drift .splash-logo-text {
  height: 18px;
  opacity: 1;
}

@keyframes duck-waddle-in {
  0%   { transform: translateX(-100vw) rotate(0deg); }
  15%  { transform: translateX(-60vw)  rotate(-8deg); }
  30%  { transform: translateX(-40vw)  rotate(8deg); }
  45%  { transform: translateX(-25vw)  rotate(-8deg); }
  60%  { transform: translateX(-12vw)  rotate(8deg); }
  75%  { transform: translateX(-4vw)   rotate(-5deg); }
  90%  { transform: translateX(0)      rotate(3deg); }
  100% { transform: translateX(0)      rotate(0deg); }
}

@keyframes text-fade-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Persistent navbar ──────────────────────────────────────────────── */

.skwky-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 80px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 20px 0 40px;
  z-index: 100;
}

.skwky-navbar .navbar-duck {
  height: 28px;
  width: auto;
  object-fit: contain;
}
.skwky-navbar .navbar-text {
  height: 18px;
  width: auto;
  object-fit: contain;
}

/* ── Version footer ────────────────────────────────────────────────── */

.version-footer {
  position: fixed;
  bottom: 12px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 300;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 99;
  letter-spacing: 0.05em;
}

/* ── Landing page ──────────────────────────────────────────────────── */

.landing-content {
  text-align: left;
  max-width: 420px;
  width: 90%;
  margin: 0 auto;
  padding-top: 60px;
}

.landing-tagline {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.15;
}

.landing-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 40px;
  line-height: 1.4;
}

.landing-card {
  display: flex;
  align-items: center;
  padding: 28px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--white);
  text-decoration: none;
  margin-bottom: 20px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}

.landing-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.landing-card-text {
  flex: 1;
  z-index: 1;
}

.landing-card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 2px;
}

.landing-card-label {
  font-size: 14px;
  font-weight: 400;
  opacity: 0.9;
}

.landing-card-chevron {
  font-size: 28px;
  font-weight: 300;
  opacity: 0.7;
  flex-shrink: 0;
  z-index: 1;
}

.landing-art-wrap {
  position: relative;
  width: 70%;
  max-width: 280px;
  margin: 110px auto 0;
  pointer-events: none;
  user-select: none;
}

.landing-art {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
}

/* Duck speech bubbles (landing animation) */
.duck-bubble {
  position: absolute;
  bottom: 100%;
  margin-bottom: 12px;
  background: var(--white);
  color: var(--text-dark);
  padding: 6px 11px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
  max-width: 150px;
  pointer-events: none;
}

.duck-bubble::after {
  content: "";
  position: absolute;
  bottom: -4px;
  width: 10px;
  height: 10px;
  background: inherit;
  transform: rotate(45deg);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.06);
}

.duck-bubble-left {
  left: 6%;
}
.duck-bubble-left::after {
  left: 14px;
}

.duck-bubble-right {
  right: 6%;
}
.duck-bubble-right::after {
  right: 14px;
}

.duck-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

.duck-bubble-center {
  left: 50%;
  margin-bottom: 28px;
  transform: translate(-50%, 6px);
  background: var(--skwky-yellow);
  color: var(--text-dark);
  font-weight: 600;
}
.duck-bubble-center.visible {
  transform: translate(-50%, 0);
  opacity: 1;
}
.duck-bubble-center::after {
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  background: var(--skwky-yellow);
}

/* ── Back link ─────────────────────────────────────────────────────── */

.back-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  font-weight: 500;
}

.back-link:hover {
  color: var(--text-dark);
}

/* ── ERS wrapper ────────────────────────────────────────────────────── */

#ers-border {
  --glow-color: var(--ers-neutral);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
  transition: opacity 0.6s ease;
  opacity: 0;
}

#ers-border.visible {
  opacity: 1;
}

/* ── Pool height markers ────────────────────────────────────────────── */

#pool-markers {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.pool-marker {
  position: absolute;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 0;
}

.pool-marker::before {
  content: "";
  display: block;
  width: 18px;
  height: 2px;
  background: #D0D0D0;
  border-radius: 1px;
}

.pool-marker span {
  font-family: "Courier New", monospace;
  font-size: 11px;
  font-weight: 700;
  color: #C0C0C0;
  letter-spacing: 0.5px;
  padding-left: 4px;
}

/* ── ERS water level ────────────────────────────────────────────────── */

#chat-container {
  position: relative;
}

#water-level {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  height: 50%;
  pointer-events: none;
  z-index: 0;
  transition: height 1.2s ease-in-out;
  background: #D6EEFF;
  transform-origin: bottom center;
  clip-path: inset(-40px 0 0 0);
}

/* Wavy surface — white wave cuts into the water top edge */
#water-level::before {
  content: "";
  position: absolute;
  left: -100%;
  width: 400%;
  top: 0;
  height: 24px;
  background: repeat-x;
  background-size: 400px 24px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 24'%3E%3Crect width='400' height='24' fill='%23FFFFFF'/%3E%3Cpath d='M0 12 Q50 24 100 12 T200 12 T300 12 T400 12 V24 H0 Z' fill='%23D6EEFF'/%3E%3C/svg%3E");
  animation: surfaceRipple 6s linear infinite;
}

@keyframes surfaceRipple {
  0%   { transform: translateX(0); }
  100% { transform: translateX(400px); }
}

/* Pixel art rubber ducky floating on the water */
#water-duck {
  position: absolute;
  top: 20px;
  left: 30%;
  width: 3px;
  height: 3px;
  z-index: 2;
  image-rendering: pixelated;
  animation: duckBob 3s ease-in-out infinite, duckDrift 20s ease-in-out infinite;
  box-shadow:
    /* === head (round top) === */
                               9px -30px 0 #FFD700, 12px -30px 0 #FFD700,
     6px -27px 0 #FFD700,     9px -27px 0 #FFD700, 12px -27px 0 #FFD700, 15px -27px 0 #FFD700,
     6px -24px 0 #FFD700,     9px -24px 0 #FFD700, 12px -24px 0 #FFD700, 15px -24px 0 #FFD700,
    /* eye */
    12px -27px 0 #222222,
    /* beak */
    18px -24px 0 #FF6B00, 21px -24px 0 #FF6B00, 18px -21px 0 #FF6B00,
    /* === neck === */
     9px -21px 0 #FFD700, 12px -21px 0 #FFD700, 15px -21px 0 #FFD700,
    /* === body (wide round) === */
     3px -18px 0 #FFD700,  6px -18px 0 #FFD700,  9px -18px 0 #FFD700, 12px -18px 0 #FFD700, 15px -18px 0 #FFD700, 18px -18px 0 #FFD700,
     0px -15px 0 #FFD700,  3px -15px 0 #FFD700,  6px -15px 0 #FFD700,  9px -15px 0 #FFD700, 12px -15px 0 #FFD700, 15px -15px 0 #FFD700, 18px -15px 0 #FFD700, 21px -15px 0 #FFD700,
     0px -12px 0 #FFD700,  3px -12px 0 #FFD700,  6px -12px 0 #FFD700,  9px -12px 0 #FFD700, 12px -12px 0 #FFD700, 15px -12px 0 #FFD700, 18px -12px 0 #FFD700, 21px -12px 0 #FFD700,
     0px  -9px 0 #FFD700,  3px  -9px 0 #FFD700,  6px  -9px 0 #FFD700,  9px  -9px 0 #FFD700, 12px  -9px 0 #FFD700, 15px  -9px 0 #FFD700, 18px  -9px 0 #FFD700, 21px  -9px 0 #FFD700,
    /* === bottom (submerged - slightly darker) === */
     3px  -6px 0 #EEC900,  6px  -6px 0 #EEC900,  9px  -6px 0 #EEC900, 12px  -6px 0 #EEC900, 15px  -6px 0 #EEC900, 18px  -6px 0 #EEC900,
     6px  -3px 0 #EEC900,  9px  -3px 0 #EEC900, 12px  -3px 0 #EEC900, 15px  -3px 0 #EEC900,
    /* === tail (small bump at back) === */
    -3px -15px 0 #FFD700, -3px -12px 0 #FFD700;
}

@keyframes duckBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-2px); }
}

@keyframes duckDrift {
  0%, 100% { left: 20%; }
  50%      { left: 65%; }
}

/* Slosh effect — tilts side to side like water sloshing in a container */
#water-level.sloshing {
  animation: slosh 2s ease-out;
}

@keyframes slosh {
  0%   { transform: translateX(-50%) skewY(0deg); }
  10%  { transform: translateX(-50%) skewY(2.5deg); }
  25%  { transform: translateX(-50%) skewY(-2deg); }
  40%  { transform: translateX(-50%) skewY(1.5deg); }
  55%  { transform: translateX(-50%) skewY(-1deg); }
  70%  { transform: translateX(-50%) skewY(0.5deg); }
  85%  { transform: translateX(-50%) skewY(-0.2deg); }
  100% { transform: translateX(-50%) skewY(0deg); }
}

/* ── Header ──────────────────────────────────────────────────────────── */

#header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 0;
  background: linear-gradient(135deg, var(--gradient-start) 0%, var(--gradient-end) 100%);
  position: sticky;
  top: 0;
  z-index: 10;
}

#header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

#chat-duck-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  margin-left: 10px;
}

#ers-version {
  font-size: 18px;
  font-weight: 500;
  color: var(--white);
  letter-spacing: 0.3px;
}

#end-btn {
  padding: 6px 16px;
  background: rgba(255,255,255,0.2);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

#end-btn:hover {
  background: rgba(255,255,255,0.35);
}

#end-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#phase-indicator {
  width: 100%;
  text-align: center;
  padding: 8px 0;
}

.phase-pill {
  display: inline-block;
  padding: 4px 14px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--white);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 50px;
  box-shadow: 0 2px 8px rgba(84, 92, 255, 0.25);
}

/* Phase transition announcement — appears big & centered, drifts straight
   up into the header pill position while shrinking via scale only.
   We avoid animating font-size/padding because those change the element's
   intrinsic size mid-transition, which warps the translate(-50%) offset
   and creates a diagonal drift. scale() keeps the box stable. */
#phase-announce {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  padding: 18px 36px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: var(--white);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(84, 92, 255, 0.35);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
  transition: top 0.9s cubic-bezier(0.4, 0.0, 0.2, 1),
              transform 0.9s cubic-bezier(0.4, 0.0, 0.2, 1),
              box-shadow 0.9s cubic-bezier(0.4, 0.0, 0.2, 1),
              opacity 0.3s ease-out;
}
#phase-announce.hidden { display: none; }

#phase-announce.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#phase-announce.drift {
  top: var(--phase-target-y, 42px);
  transform: translate(-50%, 0) scale(0.36);
  transform-origin: center top;
  box-shadow: 0 2px 8px rgba(84, 92, 255, 0.25);
}

#logo {
  height: 80px;
  object-fit: contain;
}

/* ── Chat container ──────────────────────────────────────────────────── */

#chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

#messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
  padding-bottom: 80px;
}

/* ── Message bubbles ─────────────────────────────────────────────────── */

.message {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.5;
  font-weight: 400;
  word-wrap: break-word;
}

.message.no-animate { animation: none !important; }

@keyframes balloon-up {
  0%   { opacity: 0; transform: translateY(24px) scale(0.96); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sweep-in {
  0%   { opacity: 0.35; clip-path: inset(0 100% 0 0); }
  30%  { opacity: 1; }
  100% { opacity: 1; clip-path: inset(0 0 0 0); }
}

.message.user1 {
  align-self: flex-end;
  background: var(--skwky-blue);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

.message.user2 {
  align-self: flex-start;
  background: var(--bubble-other);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
}

/* iMessage-style: "mine" = right/gradient, "theirs" = left/gray (per-user perspective) */
.message.mine {
  align-self: flex-end;
  background: var(--gradient-btn);
  color: var(--white);
  border-bottom-right-radius: 4px;
  animation: balloon-up 0.5s cubic-bezier(0.25, 0.8, 0.35, 1.02) both;
}

.message.theirs {
  align-self: flex-start;
  background: var(--bubble-other);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
  animation: sweep-in 1s cubic-bezier(0.4, 0.0, 0.2, 1) both;
}

.speaker-tag {
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 2px;
  padding: 0 14px;
}

.speaker-tag.user1 {
  align-self: flex-end;
  color: var(--skwky-blue);
}

.speaker-tag.user2 {
  align-self: flex-start;
  color: var(--skwky-yellow);
}

.speaker-tag.mine {
  align-self: flex-end;
  color: var(--gradient-end);
}

.speaker-tag.theirs {
  align-self: flex-start;
  color: var(--gradient-start);
}

/* ── Mediator intervention ───────────────────────────────────────────── */

.mediator-bubble {
  align-self: center;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #FFE14A 0%, #FFD700 60%, #FFB14A 100%);
  border-left: none;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-dark);
  /* Top margin = duck height (~14px) + breathing room so the duck perched on
     this bubble (chat.js .duck-on-bubble at top:-14px) never overlaps the
     preceding message. */
  margin: 22px 0 8px 0;
  box-shadow: 0 2px 8px rgba(255, 140, 43, 0.25);
  animation: fadeIn 0.3s ease;
}

.mediator-label {
  font-size: 11px;
  font-weight: 700;
  color: #6B3410;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

/* ── Suggestion overlay ─────────────────────────────────────────────── */

.suggestion-overlay {
  align-self: center;
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  background: #FFF8E1;
  border-left: 3px solid #FFB300;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-dark);
  margin: 8px 0;
  animation: fadeIn 0.3s ease;
}

.suggestion-label {
  font-size: 11px;
  font-weight: 700;
  color: #F57F17;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.suggestion-text {
  margin-bottom: 10px;
  font-style: italic;
}

.suggestion-buttons {
  display: flex;
  gap: 8px;
}

.suggestion-btn {
  flex: 1;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  font-family: inherit;
}

.suggestion-btn.accept {
  background: #FFB300;
  color: var(--white);
}

.suggestion-btn.accept:hover {
  background: #FFA000;
}

.suggestion-btn.dismiss {
  background: none;
  border: 1.5px solid #D0D0D0;
  color: var(--text-muted);
}

.suggestion-btn.dismiss:hover {
  border-color: var(--text-dark);
  color: var(--text-dark);
}

/* Tier-2 language warning — confirmation step */
.tier2-warning-text {
  color: #E53935;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 8px 0 4px;
}
.suggestion-btn.tier2-confirm {
  background: #E53935;
  color: #fff;
  border: none;
}
.suggestion-btn.tier2-confirm:hover {
  background: #C62828;
}

/* ── Processing indicator (walking duck) ─────────────────────────────── */

.processing-indicator {
  align-self: center;
  padding: 12px 0;
  width: 200px;
  height: 32px;
  position: relative;
  overflow: hidden;
}

.duck-walker {
  position: absolute;
  top: 4px;
  animation: duckWalk 3s linear infinite alternate;
}

/* Flip duck when walking back */
@keyframes duckWalk {
  0%   { left: 0;    transform: scaleX(1); }
  100% { left: calc(100% - 24px); transform: scaleX(1); }
}

.duck-walker.returning {
  animation: duckReturn 3s linear infinite alternate;
}

@keyframes duckReturn {
  0%   { left: calc(100% - 24px); transform: scaleX(-1); }
  100% { left: 0; transform: scaleX(-1); }
}

/* Pixel duck built with box-shadow on a single pixel */
.pixel-duck {
  width: 2px;
  height: 2px;
  position: relative;
  image-rendering: pixelated;
  box-shadow:
    /* head */
     4px 0 0 #FFD700,  6px 0 0 #FFD700,  8px 0 0 #FFD700,
     2px 2px 0 #FFD700,  4px 2px 0 #FFD700,  6px 2px 0 #FFD700,  8px 2px 0 #FFD700, 10px 2px 0 #FFD700,
    /* eye */
     8px 2px 0 #1565C0,
    /* beak */
    12px 4px 0 #E67E22, 14px 4px 0 #E67E22,
    /* neck + body */
     4px 4px 0 #FFD700,  6px 4px 0 #FFD700,  8px 4px 0 #FFD700, 10px 4px 0 #FFD700,
     2px 6px 0 #FFD700,  4px 6px 0 #FFD700,  6px 6px 0 #FFD700,  8px 6px 0 #FFD700, 10px 6px 0 #FFD700,
     0px 8px 0 #FFD700,  2px 8px 0 #FFD700,  4px 8px 0 #FFD700,  6px 8px 0 #FFD700,  8px 8px 0 #FFD700, 10px 8px 0 #FFD700,
    /* belly */
     2px 10px 0 #FFD700,  4px 10px 0 #FFD700,  6px 10px 0 #FFD700,  8px 10px 0 #FFD700,
    /* tail */
    -2px 6px 0 #1565C0, -2px 4px 0 #1565C0, -2px 2px 0 #1565C0,
    /* legs */
     4px 12px 0 #E67E22,  8px 12px 0 #E67E22,
     4px 14px 0 #E67E22,  8px 14px 0 #E67E22;
  animation: duckWaddle 0.4s step-end infinite;
}

@keyframes duckWaddle {
  0%, 100% {
    box-shadow:
       4px 0 0 #FFD700,  6px 0 0 #FFD700,  8px 0 0 #FFD700,
       2px 2px 0 #FFD700,  4px 2px 0 #FFD700,  6px 2px 0 #FFD700,  8px 2px 0 #FFD700, 10px 2px 0 #FFD700,
       8px 2px 0 #1565C0,
      12px 4px 0 #E67E22, 14px 4px 0 #E67E22,
       4px 4px 0 #FFD700,  6px 4px 0 #FFD700,  8px 4px 0 #FFD700, 10px 4px 0 #FFD700,
       2px 6px 0 #FFD700,  4px 6px 0 #FFD700,  6px 6px 0 #FFD700,  8px 6px 0 #FFD700, 10px 6px 0 #FFD700,
       0px 8px 0 #FFD700,  2px 8px 0 #FFD700,  4px 8px 0 #FFD700,  6px 8px 0 #FFD700,  8px 8px 0 #FFD700, 10px 8px 0 #FFD700,
       2px 10px 0 #FFD700,  4px 10px 0 #FFD700,  6px 10px 0 #FFD700,  8px 10px 0 #FFD700,
      -2px 6px 0 #1565C0, -2px 4px 0 #1565C0, -2px 2px 0 #1565C0,
       2px 12px 0 #E67E22,  8px 12px 0 #E67E22,
       2px 14px 0 #E67E22, 10px 14px 0 #E67E22;
  }
  50% {
    box-shadow:
       4px 0 0 #FFD700,  6px 0 0 #FFD700,  8px 0 0 #FFD700,
       2px 2px 0 #FFD700,  4px 2px 0 #FFD700,  6px 2px 0 #FFD700,  8px 2px 0 #FFD700, 10px 2px 0 #FFD700,
       8px 2px 0 #1565C0,
      12px 4px 0 #E67E22, 14px 4px 0 #E67E22,
       4px 4px 0 #FFD700,  6px 4px 0 #FFD700,  8px 4px 0 #FFD700, 10px 4px 0 #FFD700,
       2px 6px 0 #FFD700,  4px 6px 0 #FFD700,  6px 6px 0 #FFD700,  8px 6px 0 #FFD700, 10px 6px 0 #FFD700,
       0px 8px 0 #FFD700,  2px 8px 0 #FFD700,  4px 8px 0 #FFD700,  6px 8px 0 #FFD700,  8px 8px 0 #FFD700, 10px 8px 0 #FFD700,
       2px 10px 0 #FFD700,  4px 10px 0 #FFD700,  6px 10px 0 #FFD700,  8px 10px 0 #FFD700,
      -2px 6px 0 #1565C0, -2px 4px 0 #1565C0, -2px 2px 0 #1565C0,
       6px 12px 0 #E67E22, 10px 12px 0 #E67E22,
       4px 14px 0 #E67E22,  8px 14px 0 #E67E22;
  }
}

/* ── Duck Easter eggs (every 4th message) ────────────────────────────── */

.duck-pose {
  width: 2px;
  height: 2px;
  position: absolute;
  image-rendering: pixelated;
}

.duck-on-bubble {
  bottom: 0;
  animation: fadeIn 0.4s ease;
}

/* Standing — just chilling */
.duck-standing {
  box-shadow:
    /* head */
     4px 0 0 #FFD700,  6px 0 0 #FFD700,  8px 0 0 #FFD700,
     2px 2px 0 #FFD700,  4px 2px 0 #FFD700,  6px 2px 0 #FFD700,  8px 2px 0 #FFD700, 10px 2px 0 #FFD700,
     8px 2px 0 #1565C0,
    12px 4px 0 #E67E22, 14px 4px 0 #E67E22,
     4px 4px 0 #FFD700,  6px 4px 0 #FFD700,  8px 4px 0 #FFD700, 10px 4px 0 #FFD700,
     2px 6px 0 #FFD700,  4px 6px 0 #FFD700,  6px 6px 0 #FFD700,  8px 6px 0 #FFD700, 10px 6px 0 #FFD700,
     0px 8px 0 #FFD700,  2px 8px 0 #FFD700,  4px 8px 0 #FFD700,  6px 8px 0 #FFD700,  8px 8px 0 #FFD700, 10px 8px 0 #FFD700,
     2px 10px 0 #FFD700,  4px 10px 0 #FFD700,  6px 10px 0 #FFD700,  8px 10px 0 #FFD700,
    -2px 6px 0 #1565C0, -2px 4px 0 #1565C0, -2px 2px 0 #1565C0,
     4px 12px 0 #E67E22,  8px 12px 0 #E67E22,
     4px 14px 0 #E67E22,  8px 14px 0 #E67E22;
}

/* Fishing — rod extends right, line drops down */
.duck-fishing {
  box-shadow:
    /* head */
     4px 0 0 #FFD700,  6px 0 0 #FFD700,  8px 0 0 #FFD700,
     2px 2px 0 #FFD700,  4px 2px 0 #FFD700,  6px 2px 0 #FFD700,  8px 2px 0 #FFD700, 10px 2px 0 #FFD700,
     8px 2px 0 #1565C0,
    12px 4px 0 #E67E22, 14px 4px 0 #E67E22,
     4px 4px 0 #FFD700,  6px 4px 0 #FFD700,  8px 4px 0 #FFD700, 10px 4px 0 #FFD700,
     2px 6px 0 #FFD700,  4px 6px 0 #FFD700,  6px 6px 0 #FFD700,  8px 6px 0 #FFD700, 10px 6px 0 #FFD700,
     0px 8px 0 #FFD700,  2px 8px 0 #FFD700,  4px 8px 0 #FFD700,  6px 8px 0 #FFD700,  8px 8px 0 #FFD700, 10px 8px 0 #FFD700,
     2px 10px 0 #FFD700,  4px 10px 0 #FFD700,  6px 10px 0 #FFD700,  8px 10px 0 #FFD700,
    -2px 6px 0 #1565C0, -2px 4px 0 #1565C0, -2px 2px 0 #1565C0,
     4px 12px 0 #E67E22,  8px 12px 0 #E67E22,
     4px 14px 0 #E67E22,  8px 14px 0 #E67E22,
    /* rod */
    12px 2px 0 #8B4513, 14px 0 0 #8B4513, 16px -2px 0 #8B4513, 18px -4px 0 #8B4513,
    20px -6px 0 #8B4513, 22px -8px 0 #8B4513, 24px -10px 0 #8B4513,
    /* line */
    24px -8px 0 #999, 24px -6px 0 #999, 24px -4px 0 #999, 24px -2px 0 #999,
    24px 0 0 #999, 24px 2px 0 #999, 24px 4px 0 #999, 24px 6px 0 #999,
    24px 8px 0 #999, 24px 10px 0 #999, 24px 12px 0 #999, 24px 14px 0 #999;
}

/* Kite — string goes up diagonally, diamond kite at top */
.duck-kite {
  box-shadow:
    /* head */
     4px 0 0 #FFD700,  6px 0 0 #FFD700,  8px 0 0 #FFD700,
     2px 2px 0 #FFD700,  4px 2px 0 #FFD700,  6px 2px 0 #FFD700,  8px 2px 0 #FFD700, 10px 2px 0 #FFD700,
     8px 2px 0 #1565C0,
    12px 4px 0 #E67E22, 14px 4px 0 #E67E22,
     4px 4px 0 #FFD700,  6px 4px 0 #FFD700,  8px 4px 0 #FFD700, 10px 4px 0 #FFD700,
     2px 6px 0 #FFD700,  4px 6px 0 #FFD700,  6px 6px 0 #FFD700,  8px 6px 0 #FFD700, 10px 6px 0 #FFD700,
     0px 8px 0 #FFD700,  2px 8px 0 #FFD700,  4px 8px 0 #FFD700,  6px 8px 0 #FFD700,  8px 8px 0 #FFD700, 10px 8px 0 #FFD700,
     2px 10px 0 #FFD700,  4px 10px 0 #FFD700,  6px 10px 0 #FFD700,  8px 10px 0 #FFD700,
    -2px 6px 0 #1565C0, -2px 4px 0 #1565C0, -2px 2px 0 #1565C0,
     4px 12px 0 #E67E22,  8px 12px 0 #E67E22,
     4px 14px 0 #E67E22,  8px 14px 0 #E67E22,
    /* string */
    10px 0 0 #999, 12px -2px 0 #999, 14px -4px 0 #999, 16px -6px 0 #999,
    18px -8px 0 #999, 20px -10px 0 #999, 22px -12px 0 #999,
    /* kite diamond */
    24px -14px 0 #E74C3C, 22px -16px 0 #E74C3C, 24px -16px 0 #E74C3C, 26px -16px 0 #E74C3C,
    24px -18px 0 #E74C3C, 22px -14px 0 #E74C3C, 26px -14px 0 #E74C3C,
    /* kite tail */
    24px -12px 0 #3498DB, 26px -10px 0 #3498DB, 24px -8px 0 #3498DB;
}

/* Painting — easel in front */
.duck-painting {
  box-shadow:
    /* head */
     4px 0 0 #FFD700,  6px 0 0 #FFD700,  8px 0 0 #FFD700,
     2px 2px 0 #FFD700,  4px 2px 0 #FFD700,  6px 2px 0 #FFD700,  8px 2px 0 #FFD700, 10px 2px 0 #FFD700,
     8px 2px 0 #1565C0,
    12px 4px 0 #E67E22, 14px 4px 0 #E67E22,
     4px 4px 0 #FFD700,  6px 4px 0 #FFD700,  8px 4px 0 #FFD700, 10px 4px 0 #FFD700,
     2px 6px 0 #FFD700,  4px 6px 0 #FFD700,  6px 6px 0 #FFD700,  8px 6px 0 #FFD700, 10px 6px 0 #FFD700,
     0px 8px 0 #FFD700,  2px 8px 0 #FFD700,  4px 8px 0 #FFD700,  6px 8px 0 #FFD700,  8px 8px 0 #FFD700, 10px 8px 0 #FFD700,
     2px 10px 0 #FFD700,  4px 10px 0 #FFD700,  6px 10px 0 #FFD700,  8px 10px 0 #FFD700,
    -2px 6px 0 #1565C0, -2px 4px 0 #1565C0, -2px 2px 0 #1565C0,
     4px 12px 0 #E67E22,  8px 12px 0 #E67E22,
     4px 14px 0 #E67E22,  8px 14px 0 #E67E22,
    /* easel legs */
    18px 14px 0 #8B4513, 20px 12px 0 #8B4513, 22px 10px 0 #8B4513,
    26px 14px 0 #8B4513, 24px 12px 0 #8B4513, 22px 10px 0 #8B4513,
    /* canvas */
    18px 0 0 #FFF, 20px 0 0 #FFF, 22px 0 0 #FFF, 24px 0 0 #FFF, 26px 0 0 #FFF,
    18px 2px 0 #FFF, 20px 2px 0 #87CEEB, 22px 2px 0 #87CEEB, 24px 2px 0 #87CEEB, 26px 2px 0 #FFF,
    18px 4px 0 #FFF, 20px 4px 0 #87CEEB, 22px 4px 0 #F1C40F, 24px 4px 0 #87CEEB, 26px 4px 0 #FFF,
    18px 6px 0 #FFF, 20px 6px 0 #2ECC71, 22px 6px 0 #2ECC71, 24px 6px 0 #2ECC71, 26px 6px 0 #FFF,
    18px 8px 0 #FFF, 20px 8px 0 #FFF, 22px 8px 0 #FFF, 24px 8px 0 #FFF, 26px 8px 0 #FFF;
}

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

/* ── Hard stop ───────────────────────────────────────────────────────── */

.hard-stop-container {
  align-self: center;
  max-width: 360px;
  margin: 24px auto;
  animation: fadeSlideIn 0.4s ease-out both;
}

.hard-stop-banner {
  background: #FDECEA;
  border: 1px solid #E74C3C;
  border-radius: 12px;
  padding: 14px 18px;
  text-align: center;
  font-size: 15px;
  color: #C0392B;
  font-weight: 600;
}

.hard-stop-support {
  background: var(--surface, #F8F9FA);
  border-radius: 12px;
  padding: 18px;
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
  color: var(--text-primary, #333);
  line-height: 1.5;
}

.hard-stop-support > p:first-child {
  margin: 0 0 12px;
}

.hard-stop-helpline {
  background: #fff;
  border: 2px solid var(--accent, #545CFF);
  border-radius: 10px;
  padding: 14px;
  margin: 14px 0;
  line-height: 1.6;
}

.hard-stop-helpline strong {
  font-size: 15px;
}

.hard-stop-helpline a {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent, #545CFF);
  text-decoration: none;
}

.hard-stop-helpline span {
  font-size: 13px;
  color: var(--text-muted, #888);
}

.hard-stop-reassurance {
  font-style: italic;
  color: var(--text-muted, #666);
  margin: 10px 0 0;
  font-size: 13px;
}

/* ── Input area ──────────────────────────────────────────────────────── */

#input-area {
  padding: 8px 10px 12px;
  background: transparent;
  border-top: none;
  position: sticky;
  bottom: 0;
  z-index: 5;
}

#input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-break-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid #D0D0D0;
  background: #E0E0E0;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-break-icon:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--gradient-start);
}

#input-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

#message-input {
  flex: 1;
  padding: 10px 14px;
  padding-right: 46px;
  border: 1.5px solid #D0D0D0;
  border-radius: 20px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  background: var(--white);
  /* iMessage-style auto-grow: textarea, no manual resize, capped height. */
  resize: none;
  overflow-y: auto;
  min-height: 42px;
  max-height: 132px;   /* ~5 lines, then internal scroll */
  line-height: 1.4;
  box-sizing: border-box;
}

#message-input:focus {
  border-color: var(--skwky-blue);
}

#message-input:disabled {
  background: var(--white);
  color: var(--text-muted);
}

#send-btn {
  position: absolute;
  right: 5px;
  bottom: 5px;   /* anchor to the last line as the textarea grows */
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bubble-other);   /* quiet affordance when input is empty */
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  flex-shrink: 0;
  transition: background-color 0.15s ease, color 0.15s ease,
              transform 0.15s ease, box-shadow 0.15s ease;
}

#send-btn.visible {
  background: var(--gradient-btn);
  color: var(--white);
  pointer-events: auto;
  box-shadow: 0 2px 8px rgba(84, 92, 255, 0.35);
}

#send-btn.visible:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(84, 92, 255, 0.45);
}

#send-btn.visible:active:not(:disabled) {
  transform: scale(0.92);
  box-shadow: 0 1px 4px rgba(84, 92, 255, 0.3);
}

/* Not your turn / input locked — keep after .visible so it always wins */
#send-btn:disabled {
  background: var(--bubble-other);
  color: var(--text-muted);
  box-shadow: none;
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

/* (end-btn styles moved to header section) */

/* ── Report overlay ──────────────────────────────────────────────────── */

#report-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s ease;
  padding: 40px 24px;
}

#report-overlay.hidden {
  display: none;
}

#report-card {
  background: var(--white);
  border-radius: 18px;
  padding: 40px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

#report-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-dark);
}

#report-card .btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: var(--gradient-btn);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
  font-family: inherit;
}

#report-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

.report-logo {
  height: 40px;
  margin-bottom: 16px;
}

#final-ers-indicator {
  display: block;
  width: auto;
  height: 72px;
  margin: 0 auto 20px;
  object-fit: contain;
}

#report-link {
  display: block;
  padding: 14px 24px;
  background: var(--gradient-btn);
  color: var(--white);
  border-radius: 50px;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

#report-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

/* ── Landing / Auth pages ─────────────────────────────────────────────── */

.page-centered {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  max-width: none;
  padding-top: 80px;
  padding-bottom: 32px;
  flex-direction: column;
}

.auth-card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 32px;
  max-width: 380px;
  width: 90%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.auth-logo {
  height: 48px;
  width: auto;
  margin-bottom: 20px;
}

.auth-card h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-card input {
  padding: 12px 14px;
  border: 1px solid #DDD;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border 0.2s;
}

.auth-card input:focus {
  border-color: var(--skwky-blue);
}

.auth-card .btn-primary {
  background: var(--gradient-btn);
  color: var(--white);
  border: none;
  padding: 14px 24px;
  /* Rectangular like the login Sign in button + the Google button —
     consistent shape across all auth pages (login, signup, forgot,
     reset). Was 50px (pill). */
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

.auth-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

.error-text {
  color: #E74C3C;
  font-size: 13px;
  margin-top: 4px;
}

.error-text.hidden {
  display: none;
}

.info-text {
  color: var(--gradient-start, #545CFF);
  font-size: 13px;
  margin-top: 4px;
}

.info-text.hidden {
  display: none;
}

.success-text {
  color: #2ECC71;
  font-size: 14px;
  margin-top: 8px;
  font-weight: 500;
}

.success-text.hidden {
  display: none;
}

/* Auth links row beneath the login form */
.auth-links {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-link {
  color: var(--gradient-start, #545CFF);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-link-sep {
  margin: 0 6px;
  color: var(--text-muted);
}

/* ── Login screen layout (`/admin`) — left-aligned reorder ─────────────
 * Scoped via `.auth-card.login-rect` so signup / forgot / reset pages
 * (which keep the original centred layout) are unaffected.
 */

.auth-card.login-rect {
  text-align: left;
  padding: 36px 32px 28px;
}

.auth-card.login-rect .auth-subheader {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 4px;
  font-weight: 400;
  text-align: center;
}

.auth-card.login-rect .auth-heading {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 24px;
  line-height: 1.2;
  text-align: center;
}

.auth-card.login-rect form {
  gap: 14px;
}

.auth-card.login-rect .remember-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  margin: -2px 0 6px;
  flex-wrap: wrap;
  gap: 8px;
}
.auth-card.login-rect .remember-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dark);
  cursor: pointer;
  user-select: none;
}
.auth-card.login-rect .remember-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--gradient-start, #545CFF);
  cursor: pointer;
}

/* Rectangular Sign in button — full width, gradient + font preserved.
   Overrides the default 50px pill on .auth-card .btn-primary. */
.auth-card.login-rect .btn-primary {
  width: 100%;
  border-radius: 8px;
  padding: 12px 24px;
  margin-top: 4px;
  font-size: 15px;
  /* gradient/font/colour inherited from .auth-card .btn-primary */
}

/* Google button row — sits directly under the Sign in button */
.auth-card.login-rect .gsi-button-row {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

/* "Don't have an account? Sign up" line at the bottom */
.auth-card.login-rect .auth-bottom-link {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* Back link — centred at the very bottom of the card. The parent has
   text-align:left for the rest of the form, so override here. */
.auth-card.login-rect .back-link {
  display: block;
  text-align: center;
  margin-top: 12px;
}

/* "or" divider between the email/password form and the Google button */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #E4E4EA;
}
.auth-divider span {
  padding: 0 12px;
}

/* ── User-menu avatar widget (top-right of dashboard + super-admin) ── */

.user-menu {
  position: relative;
  display: inline-block;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  /* Background colour set inline per-user (auto-derived from email
     hash) so each admin gets a stable personal colour. */
  transition: filter 0.15s, transform 0.1s;
}
.user-avatar:hover { filter: brightness(1.08); }
.user-avatar:active { transform: scale(0.96); }
.user-avatar:focus-visible {
  outline: 2px solid var(--gradient-start, #545CFF);
  outline-offset: 2px;
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.16),
              0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  z-index: 200;
  animation: user-menu-fade 0.12s ease-out;
}
@keyframes user-menu-fade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.user-menu-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #F0F0F4;
}
.user-menu-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.3;
}
.user-menu-email {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 2px;
  word-break: break-all;
}

.user-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
  font-size: 14px;
  color: var(--text-dark);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}
.user-menu-item:hover { background: #F5F5F7; }
.user-menu-item.user-menu-logout { color: #E74C3C; }
.user-menu-item.user-menu-logout:hover { background: #FCE3E3; }

.user-menu-divider {
  height: 1px;
  background: #F0F0F4;
  margin: 0;
}

.admin-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.admin-link:hover {
  color: var(--skwky-blue);
}

/* ── Waiting overlay ─────────────────────────────────────────────────── */

#waiting-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

#waiting-overlay.hidden {
  display: none;
}

.waiting-card {
  text-align: center;
}

.waiting-card p {
  margin-top: 16px;
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

.waiting-duck {
  display: inline-block;
}

#waiting-section {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding-top: 80px;
  padding-bottom: 48px;
}

#waiting-section .waiting-duck-wrap {
  width: 120px;
  height: 40px;
  margin: 0 auto 24px;
  position: relative;
  overflow: visible;
}

#waiting-section .duck-walker {
  position: absolute;
  top: 0;
  transform: scale(3);
  transform-origin: top left;
}

/* ── Onboarding carousel ────────────────────────────────────────────── */

#onboarding-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-self: center;
}

.onboarding-card {
  background: var(--white);
  border-radius: 16px;
  padding: 20px 0 16px;
  max-width: 380px;
  width: 90%;
  margin: 0 auto;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  overflow: hidden;
}

.slides-viewport {
  overflow: hidden;
  width: 100%;
  touch-action: pan-y;
}

.slides-track {
  display: flex;
  transition: transform 0.3s ease;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.slides-track:active {
  cursor: grabbing;
}

.slide {
  flex: 0 0 100%;
  min-width: 100%;
  padding: 0 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-sizing: border-box;
}

.slide-graphic {
  margin: 0 auto 10px;
  width: 200px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide-graphic svg,
.slide-graphic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

/* Slide 1 logo is more square — keep it tidy, not dominant */
.slide-graphic img[src*="duck-skwky-logo"] {
  width: auto;
  height: auto;
  max-width: 92px;
  max-height: 92px;
}

/* Slide PNGs are pre-cropped to their content bbox, so object-fit: contain
   centers them naturally — no per-slide nudges needed. */

.slide-graphic-break {
  height: 110px;
}
.slide-graphic-break .btn-break-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid #D0D0D0;
  background: var(--white);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.slide-graphic-break .btn-break-icon svg {
  width: 36px;
  height: 36px;
  image-rendering: auto;
}

.slide h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-dark);
}

.slide p {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 300px;
}

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 18px;
}

.slide-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D1D5DB;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.slide-dots .dot.active {
  background: var(--skwky-blue);
  transform: scale(1.25);
}

/* Agree & Continue button — prominent, exciting */
.agree-btn {
  display: block;
  margin: 4px 24px 0;
  width: calc(100% - 48px);
  padding: 16px 24px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--white);
  background: var(--gradient-btn);
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.agree-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(21, 101, 192, 0.25);
}

.agree-btn.hidden {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}

/* ── Name + description form ───────────────────────────────────────── */

#name-section {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding-top: 80px;
  padding-bottom: 48px;
}

#name-section .auth-card {
  max-width: 380px;
  width: 90%;
}

#name-section textarea {
  padding: 12px 14px;
  border: 1px solid #DDD;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  width: 100%;
  resize: vertical;
  min-height: 140px;
  outline: none;
  transition: border-color 0.2s;
}

#name-section textarea:focus {
  border-color: var(--skwky-blue);
}

#name-section .btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Emotion scale ─────────────────────────────────────────────────── */

.emotion-scale {
  margin: 16px 0;
}

.emotion-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.emotion-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.emotion-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 56px;
  font-family: inherit;
}

.emotion-btn[data-value="1"] { background: linear-gradient(135deg, #F5C842, #E8B830); }
.emotion-btn[data-value="2"] { background: linear-gradient(135deg, #C4D86E, #A8C858); }
.emotion-btn[data-value="3"] { background: linear-gradient(135deg, #6BBF5B, #52A843); }
.emotion-btn[data-value="4"] { background: linear-gradient(135deg, #4EBFA5, #3AAA90); }
.emotion-btn[data-value="5"] { background: linear-gradient(135deg, #7B68EE, #6A55DD); }

.emotion-btn:hover {
  transform: scale(1.05);
}

.emotion-btn.active {
  transform: scale(1.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.emotion-icon {
  font-size: 22px;
  font-weight: 700;
  color: var(--white);
}

.emotion-text {
  font-size: 9px;
  font-weight: 600;
  color: var(--white);
  opacity: 0.9;
}

/* ── Breathing exercise page ───────────────────────────────────────── */

.breathing-page {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 56px);
}

.breathing-card {
  background: var(--white);
  border-radius: 18px;
  padding: 40px 32px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.breathing-page h2 {
  font-size: 22px;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.breathing-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breathing-counter {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

.skip-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.skip-link:hover {
  color: var(--text-dark);
}

/* ── Tile matching game ────────────────────────────────────────────── */

.tile-game {
  margin-top: 20px;
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-width: 280px;
  margin: 0 auto;
}

.tile {
  aspect-ratio: 1;
  width: 100%;
  height: 0;
  padding-bottom: 100%;
  border-radius: 14px;
  background: linear-gradient(145deg, #C8C8CE, #B0B0B8);
  cursor: pointer;
  transition: background 0.3s, transform 0.2s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.3);
}

.tile:hover {
  transform: scale(1.05);
}

.tile.flipped {
  transform: scale(0.95);
}

.tile-score {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 12px;
  text-align: center;
}

.waiting-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
}

/* ── Turn indicator ──────────────────────────────────────────────────── */

#turn-indicator {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 4px 0;
  font-style: italic;
}

#turn-indicator.hidden {
  display: none;
}

/* ── System bubble ───────────────────────────────────────────────────── */

.system-bubble {
  text-align: center;
  padding: 8px 16px;
  margin: 8px 0;
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Thank you text ──────────────────────────────────────────────────── */

.thankyou-text {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 12px;
  margin-bottom: 24px;
  line-height: 1.5;
}

/* ── "I've said my piece" floating button ────────────────────────────── */

#opening-done-wrap {
  position: sticky;
  bottom: 56px;
  z-index: 6;
  text-align: center;
  padding: 6px 0;
  pointer-events: none;
}

#opening-done-wrap.hidden {
  display: none;
}

/* "Ready to wrap up" button (discussion phase). Mirrors opening-done
   positioning + reuses .btn-opening-done class on the button itself. */
#wrap-up-ready-wrap {
  position: sticky;
  bottom: 56px;
  z-index: 6;
  text-align: center;
  padding: 6px 0;
  pointer-events: none;
  /* relative for tooltip positioning */
}

#wrap-up-ready-wrap.hidden {
  display: none;
}

/* Tooltip shown when wrap-up button tapped before thresholds met */
.wrap-up-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 40, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  border-radius: 12px;
  max-width: 260px;
  text-align: center;
  pointer-events: none;
  animation: tooltipIn 0.2s ease;
  z-index: 10;
}
.wrap-up-tooltip.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}
@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.btn-opening-done {
  pointer-events: auto;
  padding: 12px 36px;
  background: linear-gradient(135deg, rgba(180, 180, 190, 0.6), rgba(160, 160, 175, 0.6));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.btn-opening-done:hover {
  background: linear-gradient(135deg, rgba(160, 160, 175, 0.75), rgba(140, 140, 160, 0.75));
}

.btn-opening-done:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-opening-done.active {
  background: var(--gradient-btn);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

.btn-opening-done.active:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 18px rgba(84, 92, 255, 0.45);
}

/* ── Break room overlay ─────────────────────────────────────────────── */

#break-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  animation: fadeIn 0.3s ease;
  padding: 40px 24px;
}

.break-card {
  background: var(--white);
  border-radius: 18px;
  padding: 40px 32px 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.break-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.break-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.break-timer {
  font-size: 13px;
  color: var(--text-muted);
  margin: 16px 0;
}

.break-card .btn-primary {
  margin-top: 8px;
  background: #C0C0C0;
  color: var(--white);
  border: none;
  padding: 14px 24px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.3s;
  box-shadow: none;
  width: 100%;
  font-family: inherit;
}

.break-card .btn-primary:disabled {
  background: #C0C0C0;
  color: var(--white);
  opacity: 1;
  cursor: not-allowed;
}

.break-card .btn-primary:not(:disabled) {
  background: var(--gradient-btn);
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

.break-card .btn-primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

/* ── Breathing circle animation ─────────────────────────────────────── */

.breathing-circle-wrap {
  display: flex;
  justify-content: center;
  margin: 24px 0 24px;
}

.breathing-circle {
  width: 120px;
  height: 120px;
  border-radius: 63% 37% 54% 46% / 40% 45% 55% 60%;
  background: linear-gradient(135deg, #BBDEFB, #90CAF9);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: transform 4s ease-in-out;
  animation: blob-morph 14s ease-in-out infinite;
}

/* 4-7-8 breathing: per-phase transition-duration drives the scale pace.
   Color blending is driven from JS (animateBreathColors) to interpolate
   gradient stops smoothly across phases — CSS keyframes can't reliably
   interpolate `linear-gradient` between stops. */
.breathing-circle.inhale {
  transform: scale(1.2);
  transition-duration: 4s;
}

.breathing-circle.hold-in {
  transform: scale(1.2);
  transition-duration: 0.6s;
}

.breathing-circle.exhale {
  transform: scale(0.8);
  transition-duration: 8s;
}

@keyframes blob-morph {
  0%,
  100% { border-radius: 63% 37% 54% 46% / 40% 45% 55% 60%; }
  20%  { border-radius: 48% 52% 61% 39% / 55% 45% 52% 48%; }
  40%  { border-radius: 55% 45% 38% 62% / 44% 58% 42% 56%; }
  60%  { border-radius: 42% 58% 53% 47% / 61% 39% 55% 45%; }
  80%  { border-radius: 58% 42% 45% 55% / 52% 48% 60% 40%; }
}

.breathing-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
  pointer-events: none;
}

/* ── Phase vote overlay ─────────────────────────────────────────────── */

#phase-vote-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  animation: fadeIn 0.3s ease;
  padding: 40px 24px;
}

.phase-vote-card {
  background: var(--white);
  border-radius: 18px;
  padding: 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.phase-vote-card p {
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 24px;
  line-height: 1.5;
}

.phase-vote-buttons {
  display: flex;
  gap: 12px;
}

.phase-vote-buttons .btn-primary,
.phase-vote-buttons .btn-outline {
  flex: 1;
  padding: 14px 16px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.phase-vote-buttons .btn-primary {
  background: var(--gradient-btn);
  color: var(--white);
  border: none;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

.phase-vote-buttons .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

.phase-vote-buttons .btn-outline {
  background: none;
  color: var(--text-muted);
  border: 1.5px solid #D0D0D0;
}

.phase-vote-buttons .btn-outline:hover {
  border-color: var(--text-dark);
  color: var(--text-dark);
}

/* ── Opening-statements explainer overlay (one-time, after phase pill) ── */

#opening-explainer-overlay {
  position: fixed;
  inset: 0;
  /* Match the dim+blur backdrop pattern used by every other modal. */
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 170;
  animation: fadeIn 0.3s ease;
  padding: 40px 24px;
}

.opening-explainer-card {
  background: var(--white);
  border-radius: 18px;
  padding: 28px 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: left;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
}

.opening-explainer-card h2 {
  font-size: 20px;
  margin: 0 0 12px;
  color: var(--text-dark);
  text-align: center;
}

.opening-explainer-card p {
  font-size: 15px;
  color: var(--text-dark);
  margin: 0 0 14px;
  line-height: 1.5;
}

.opening-explainer-card .btn-primary {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 24px;
  background: var(--gradient-btn);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}

.opening-explainer-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

/* ── Break suggestion overlay (mediator-suggested break) ────────────── */

#break-suggest-overlay {
  position: fixed;
  inset: 0;
  /* Match the dim+blur backdrop used by every other modal in the app
     (#phase-vote-overlay, #feedback-overlay, #report-overlay). */
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 160;
  animation: fadeIn 0.3s ease;
  padding: 40px 24px;
}

.break-suggest-card {
  background: var(--white);
  border-radius: 18px;
  padding: 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.break-suggest-card p {
  font-size: 15px;
  color: var(--text-dark);
  margin-bottom: 24px;
  line-height: 1.5;
}

.break-suggest-buttons {
  display: flex;
  gap: 12px;
}

.break-suggest-buttons .btn-primary,
.break-suggest-buttons .btn-outline {
  flex: 1;
  padding: 14px 16px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.break-suggest-buttons .btn-primary {
  background: var(--gradient-btn);
  color: var(--white);
  border: none;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

.break-suggest-buttons .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

.break-suggest-buttons .btn-outline {
  background: none;
  color: var(--text-muted);
  border: 1.5px solid #D0D0D0;
}

.break-suggest-buttons .btn-outline:hover {
  border-color: var(--text-dark);
  color: var(--text-dark);
}

/* ── Resolution overlay ─────────────────────────────────────────────── */

#resolution-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  animation: fadeIn 0.3s ease;
  padding: 40px 24px;
}

.resolution-card {
  background: var(--white);
  border-radius: 18px;
  padding: 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  max-height: 80vh;
  overflow-y: auto;
}

.resolution-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.resolution-body {
  text-align: left;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 24px;
  white-space: pre-wrap;
}

.resolution-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.resolution-buttons .btn-primary,
.resolution-buttons .btn-outline {
  flex: 1;
  padding: 14px 16px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.resolution-buttons .btn-primary {
  background: var(--gradient-btn);
  color: var(--white);
  border: none;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

.resolution-buttons .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

.resolution-buttons .btn-outline {
  background: none;
  color: var(--text-muted);
  border: 1.5px solid #D0D0D0;
}

.resolution-buttons .btn-outline:hover {
  border-color: #E74C3C;
  color: #E74C3C;
}

.resolution-status {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
  margin-top: 8px;
}

/* ── Feedback overlay ───────────────────────────────────────────────── */

#feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 150;
  animation: fadeIn 0.3s ease;
  padding: 40px 24px;
}

.feedback-card {
  background: var(--white);
  border-radius: 18px;
  padding: 32px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.feedback-card h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 24px;
}

.feedback-rating {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.feedback-star {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #D0D0D0;
  background: none;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.feedback-star:hover {
  border-color: var(--gradient-start);
  color: var(--gradient-start);
}

.feedback-star.active {
  background: var(--gradient-btn);
  border-color: transparent;
  color: var(--white);
}

.feedback-card textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #D0D0D0;
  border-radius: 14px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
  margin-bottom: 20px;
  transition: border-color 0.2s;
}

.feedback-card textarea:focus {
  border-color: var(--gradient-start);
}

.feedback-card .btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--gradient-btn);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(84, 92, 255, 0.35);
}

.feedback-card .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(84, 92, 255, 0.4);
}

.feedback-card .btn-primary:disabled {
  background: #C0C0C0;
  box-shadow: none;
  cursor: not-allowed;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  body {
    max-width: 100%;
  }
}
