@import url("https://fonts.googleapis.com/css2?family=Special+Gothic+Expanded+One&display=swap");

:root {
  --bg-1: #241855;
  --bg-2: #1a1350;
  --bg-3: #120d39;
  --card: rgba(24, 22, 64, 0.72);
  --card-strong: rgba(255, 255, 255, 0.18);
  --text: #f4f1ff;
  --muted: rgba(228, 222, 255, 0.72);
  --accent: #ff8b00;
  --accent-2: #ffb800;
  --accent-3: #ff5f1f;
  --accent-4: #ffd166;
  --danger: #ff6b6b;
  --shadow: 0 24px 56px rgba(8, 6, 24, 0.55);
  --radius: 24px;
  --font-title: "Special Gothic Expanded One", "Avenir Next", "Futura", "Segoe UI", sans-serif;
  --font-body: "Special Gothic Expanded One", "Avenir", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-1);
  overflow-x: hidden;
  letter-spacing: 0.01em;
}

.bg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(46% 38% at 8% 6%, rgba(255, 172, 64, 0.36), transparent 72%),
    radial-gradient(36% 34% at 90% 12%, rgba(89, 136, 255, 0.32), transparent 74%),
    radial-gradient(38% 36% at 82% 86%, rgba(255, 102, 51, 0.28), transparent 74%),
    radial-gradient(40% 46% at 22% 82%, rgba(105, 78, 255, 0.34), transparent 74%),
    linear-gradient(160deg, #2a1a72 0%, #1d165b 48%, #130d3e 100%);
  background-attachment: fixed;
  z-index: -1;
}

.app {
  max-width: 940px;
  margin: 0 auto;
  padding: 20px 16px calc(40px + env(safe-area-inset-bottom));
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: app-in 420ms ease-out both;
}

@keyframes app-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 2px 2px 0;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#btnMute {
  padding-inline: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent-3));
  display: grid;
  place-items: center;
  box-shadow:
    0 14px 26px rgba(255, 111, 31, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
  overflow: hidden;
}

.logo-img img {
  width: 90%;
  height: auto;
  display: block;
}

.title {
  font-size: 1.36rem;
  font-weight: 800;
  font-family: var(--font-title);
}

.subtitle {
  font-size: 0.84rem;
  color: var(--muted);
}

.screen {
  display: grid;
  gap: 16px;
}

#screenGame {
  display: none;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.card.statement {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.mode-picker h2 {
  margin: 0 0 8px;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.mode-picker .hint {
  margin-bottom: 14px;
}

.card.hero h1 {
  font-family: var(--font-title);
  font-size: 2.1rem;
  margin: 0 0 10px;
}

.card.hero p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 1rem;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.custom-grid {
  display: grid;
  gap: 10px;
}

.custom-grid input,
.custom-grid select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
}

.submit-card input,
.submit-card select {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
}

.submit-card textarea {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font-body);
  resize: vertical;
  min-height: 120px;
}

.submit-card input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.submit-card textarea::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.custom-grid input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

.custom-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.custom-list {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.custom-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.custom-item-label {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.custom-item-text {
  font-size: 0.9rem;
}

.custom-item-actions {
  display: inline-flex;
  gap: 6px;
}

.custom-item-actions .ghost {
  padding: 6px 8px;
  font-size: 0.8rem;
}

.custom-item-editing {
  background: rgba(255, 255, 255, 0.12);
}

.custom-item-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.92rem;
}

.custom-empty {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 6px 0;
}

.mode-custom {
  background: linear-gradient(135deg, rgba(255, 176, 0, 0.2), rgba(255, 138, 0, 0.18));
  border: 1px solid rgba(255, 176, 0, 0.45);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(7, 5, 25, 0.55);
  display: none;
  place-items: center;
  z-index: 1200;
  padding: 16px;
}

.drawer-backdrop.open {
  display: grid;
}

.drawer {
  width: min(760px, 100%);
  max-height: 85vh;
  overflow: auto;
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(180deg, rgba(42, 33, 110, 0.98), rgba(29, 23, 84, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 32px 56px rgba(8, 6, 28, 0.64);
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-head h2 {
  margin: 0;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero-highlights {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hero-highlights span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.85rem;
}

.hero {
  background: linear-gradient(135deg, rgba(255, 176, 0, 0.18), rgba(255, 138, 0, 0.18));
  border: 1px solid rgba(255, 176, 0, 0.28);
}

.modes {
  display: grid;
  gap: 12px;
}

.game-setup {
  display: grid;
  gap: 14px;
}

.setup-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.setup-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.length-options {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.length-option {
  min-width: 0;
  padding: 12px 10px;
  border-radius: 14px;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.06));
  color: var(--text);
  display: grid;
  gap: 4px;
  text-align: center;
  transition: transform 0.18s ease, border-color 0.2s ease, background 0.2s ease;
}

.length-option:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.42);
}

.length-option[aria-checked="true"] {
  background: linear-gradient(145deg, rgba(255, 170, 44, 0.32), rgba(255, 98, 31, 0.3));
  border-color: rgba(255, 191, 86, 0.95);
  box-shadow: 0 0 0 1px rgba(255, 166, 39, 0.34), 0 10px 20px rgba(255, 98, 31, 0.26);
}

.length-title {
  font-weight: 700;
  font-family: var(--font-title);
}

.length-sub {
  color: var(--muted);
  font-size: 0.84rem;
}

.pool-info {
  font-size: 0.94rem;
  color: rgba(255, 224, 177, 0.96);
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 184, 0, 0.36);
  background: linear-gradient(135deg, rgba(255, 154, 34, 0.18), rgba(255, 100, 40, 0.16));
  font-weight: 600;
}

.include-custom-toggle {
  padding: 2px 0;
  color: var(--text);
}

.include-adult-toggle {
  padding: 2px 0;
  color: var(--text);
}

.include-adult-toggle input {
  accent-color: var(--danger);
}

.mode {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: 0 14px 26px rgba(25, 14, 65, 0.25);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.2s ease, border 0.2s ease, background 0.2s ease;
}

.mode:focus-visible,
.mode:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.mode[aria-checked="true"] {
  background: linear-gradient(135deg, rgba(255, 176, 0, 0.3), rgba(255, 138, 0, 0.25));
  border-color: rgba(255, 176, 0, 0.9);
  box-shadow: 0 0 0 2px rgba(255, 176, 0, 0.4), 0 14px 26px rgba(25, 14, 65, 0.35);
}

.mode-emoji {
  font-size: 1.4rem;
}

.mode-title {
  font-weight: 700;
  font-family: var(--font-title);
}

.mode-desc {
  color: var(--muted);
  font-size: 0.9rem;
}

.statement {
  min-height: 45vh;
  position: relative;
  overflow: hidden;
  perspective: 1200px;
  filter: drop-shadow(0 22px 42px rgba(5, 4, 20, 0.46));
  border-radius: var(--radius);
}


.statement.flip {
  animation: flip-snap 0.62s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-face {
  position: absolute;
  inset: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backface-visibility: hidden;
  transform-style: preserve-3d;
  transition: transform 0.7s ease;
  z-index: 1;
  border-radius: var(--radius);
}

.card-front {
  background: linear-gradient(145deg, #ffba21, #ff7b21 58%, #ff5720);
  border-radius: var(--radius);
  z-index: 2;
  border: 3px solid rgba(255, 255, 255, 0.94);
  box-shadow: 0 20px 34px rgba(33, 20, 80, 0.24);
  overflow: hidden;
}

.card-front::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 80% at 10% 0%, rgba(255, 255, 255, 0.38), transparent 55%),
    radial-gradient(40% 45% at 100% 100%, rgba(131, 44, 0, 0.2), transparent 70%);
  pointer-events: none;
}

.card-back {
  transform: rotateY(180deg);
  border-radius: var(--radius);
  z-index: 1;
  border: 3px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(165deg, rgba(113, 95, 255, 0.38), rgba(87, 67, 217, 0.28));
  box-shadow: 0 20px 32px rgba(20, 10, 60, 0.22);
  padding-top: 0;
  display: block;
}

.statement.flipped .card-front {
  transform: rotateY(180deg);
  z-index: 1;
}

.statement.flipped .card-back {
  transform: rotateY(360deg);
  z-index: 2;
}

.front-bg {
  position: absolute;
  inset: 0;
  background: transparent;
  z-index: 0;
}

.front-logo-main {
  position: relative;
  z-index: 2;
  margin: auto;
  width: min(58%, 280px);
}

.front-logo-main img {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.25));
}

.front-content {
  position: relative;
  z-index: 1;
  margin-top: auto;
  margin-bottom: auto;
  text-align: center;
  display: grid;
  gap: 6px;
}

.front-title {
  font-family: var(--font-title);
  font-size: clamp(2.2rem, 6vw, 3.4rem);
  letter-spacing: 0.01em;
}

.front-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.card-back::after {
  content: "";
  position: absolute;
  inset: auto -30% -30% auto;
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(255, 207, 74, 0.2), transparent 60%);
}

.pill {
  align-self: flex-start;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  max-width: calc(100% - 78px);
  white-space: normal;
  overflow: visible;
  line-height: 1.2;
  z-index: 2;
}

.pill.pill-adult {
  background: rgba(255, 107, 107, 0.22);
  border-color: rgba(255, 107, 107, 0.45);
  color: #ffd9d9;
}

.statement-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(1.85rem, 3.8vw, 2.9rem);
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -0.01em;
  text-align: center;
  margin: 0;
  overflow: auto;
  padding: clamp(26px, 5.4vw, 46px) clamp(22px, 4.8vw, 54px);
  text-wrap: balance;
  scrollbar-width: thin;
  z-index: 1;
}

.statement-text.size-md {
  font-size: clamp(1.65rem, 3.3vw, 2.45rem);
}

.statement-text.size-sm {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
}

.statement-text.size-xs {
  font-size: clamp(1.25rem, 2.7vw, 1.82rem);
  line-height: 1.22;
}

.favorite {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(145deg, rgba(26, 22, 82, 0.76), rgba(20, 17, 66, 0.62));
  backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.42);
  padding: 7px 11px;
  border-radius: 12px;
  font-size: 1.1rem;
  box-shadow: 0 8px 16px rgba(6, 5, 24, 0.28);
}

.read-current {
  position: absolute;
  top: 16px;
  right: 74px;
  width: 42px;
  height: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  line-height: 0;
  z-index: 2;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 12px;
  appearance: none;
  cursor: pointer;
}

.read-current::before {
  content: "";
  width: 22px;
  height: 22px;
  background: rgba(255, 241, 214, 0.94);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5z'/%3E%3Cpath d='M15.45 8.48a1 1 0 0 1 1.41 0 5 5 0 0 1 0 7.07 1 1 0 1 1-1.41-1.41 3 3 0 0 0 0-4.25 1 1 0 0 1 0-1.41z'/%3E%3Cpath d='M18.48 5.45a1 1 0 0 1 1.41 0 9 9 0 0 1 0 12.73 1 1 0 1 1-1.41-1.41 7 7 0 0 0 0-9.91 1 1 0 0 1 0-1.41z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5z'/%3E%3Cpath d='M15.45 8.48a1 1 0 0 1 1.41 0 5 5 0 0 1 0 7.07 1 1 0 1 1-1.41-1.41 3 3 0 0 0 0-4.25 1 1 0 0 1 0-1.41z'/%3E%3Cpath d='M18.48 5.45a1 1 0 0 1 1.41 0 9 9 0 0 1 0 12.73 1 1 0 1 1-1.41-1.41 7 7 0 0 0 0-9.91 1 1 0 0 1 0-1.41z'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: transform 0.18s ease, background 0.18s ease, opacity 0.18s ease;
}

.favorite:hover {
  color: #ffffff;
}

.read-current:hover::before {
  background: #ffffff;
  transform: scale(1.06);
}

.favorite[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(255, 176, 0, 0.45), rgba(255, 107, 214, 0.35));
  border-color: rgba(255, 176, 0, 0.8);
}

.ad-slot {
  margin-top: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: none;
  display: none;
  gap: 10px;
  align-items: center;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
}

.ad-slot.show {
  display: grid;
}

.swipe-hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(6px);
  padding: 8px 13px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: rgba(255, 243, 220, 0.98);
  background: linear-gradient(145deg, rgba(255, 164, 36, 0.35), rgba(255, 96, 25, 0.28));
  border: 1px solid rgba(255, 214, 145, 0.7);
  box-shadow: 0 12px 24px rgba(8, 6, 24, 0.42);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  z-index: 6;
  white-space: nowrap;
}

.swipe-hint.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ad-slot[data-ad-type="banner"] {
  margin: auto -22px -22px;
  padding: 16px 22px;
  background-size: cover;
  background-position: center;
  border: none;
  border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden;
}

.ad-slot[data-ad-type="banner"]::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.15)),
    radial-gradient(60% 100% at 100% 0%, rgba(255, 255, 255, 0.15), transparent 60%);
  z-index: 0;
}

.ad-slot[data-ad-type="banner"]::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
  pointer-events: none;
}

.ad-slot[data-ad-type="banner"] .ad-media {
  display: none;
}

.ad-slot[data-ad-type="banner"] .ad-content {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 6px;
}

.ad-slot[data-ad-type="logo"] {
  background: transparent;
  border: none;
  padding: 0;
  gap: 8px;
  align-items: center;
}

.ad-slot[data-ad-type="logo"] .ad-content {
  display: none;
}

.ad-slot[data-ad-type="logo"] .ad-media {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ad-slot[data-ad-type="logo"] {
  position: absolute;
  right: 18px;
  bottom: 18px;
}

.ad-media {
  width: 110px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 207, 74, 0.35), rgba(53, 240, 200, 0.35));
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.ad-media-link {
  text-decoration: none;
  color: inherit;
}

.ad-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ad-slot[data-ad-type="partner"] {
  margin: 0;
  padding: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(20, 16, 64, 0.6), rgba(20, 16, 64, 0.72));
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 0;
}

.ad-slot[data-ad-type="partner"] .ad-media-link {
  width: 100%;
}

.ad-slot[data-ad-type="partner"] .ad-media {
  width: 100%;
  height: auto;
  background: rgba(8, 8, 24, 0.35);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  aspect-ratio: 930 / 180;
}

.ad-slot[data-ad-type="partner"] .ad-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ad-slot[data-ad-type="partner"] .ad-content {
  display: none;
}

.card-back.ad-card-active {
  grid-template-rows: auto auto;
  align-content: center;
}

.card-back.ad-card-active .statement-text {
  max-width: 100%;
  text-align: center;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  margin-bottom: 6px;
}

.ad-slot[data-ad-type="logo"] .ad-media {
  width: 52px;
  height: 52px;
  border-radius: 999px;
}

.ad-content {
  display: grid;
  gap: 4px;
}

.ad-label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.6);
}

.ad-label.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: fit-content;
}

.ad-slot a {
  color: var(--accent-2);
  text-decoration: none;
  font-weight: 600;
}

.ad-slot a:hover {
  text-decoration: underline;
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 2px;
}

.controls .primary {
  box-shadow:
    0 18px 34px rgba(255, 110, 28, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.controls .secondary {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.09));
  border-color: rgba(255, 255, 255, 0.3);
}

.round-complete {
  display: none;
  margin-top: 4px;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 188, 58, 0.2), rgba(255, 98, 31, 0.18));
  border: 1px solid rgba(255, 201, 112, 0.36);
}

.round-complete.show {
  display: grid;
  gap: 10px;
}

.round-complete h3 {
  margin: 0;
  font-size: 1.02rem;
  font-family: var(--font-title);
}

.round-complete-actions {
  display: flex;
  gap: 10px;
}

button {
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 1.05rem;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 700;
  transition: transform 0.16s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:focus-visible,
.length-option:focus-visible,
.ghost:focus-visible,
.footer-link:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(255, 201, 112, 0.95);
  outline-offset: 2px;
}

.primary {
  background: linear-gradient(145deg, #ffbe2f, #ff7a1f 62%, #ff5d1c);
  color: #ffffff;
  font-weight: 800;
  flex: 1;
  box-shadow:
    0 16px 30px rgba(255, 110, 28, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.58);
  border-color: rgba(255, 255, 255, 0.3);
  letter-spacing: 0.01em;
}

.secondary {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.08));
  color: var(--text);
  flex: 1;
  border-color: rgba(255, 255, 255, 0.24);
}

.ghost {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
}

.ghost-strong {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.24);
}

.ghost-accent {
  border-color: rgba(255, 176, 0, 0.55);
  background: linear-gradient(135deg, rgba(255, 176, 0, 0.16), rgba(255, 138, 0, 0.14));
}

.meta {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: space-between;
  flex-wrap: wrap;
  color: var(--muted);
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 24px rgba(10, 8, 30, 0.2);
}

.meta-left {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.seo {
  margin-top: 30px;
  padding: 26px;
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 24px rgba(10, 8, 30, 0.22);
  position: relative;
  overflow: hidden;
}

.seo::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, rgba(255, 184, 0, 0.22), transparent 70%);
  pointer-events: none;
}

.seo h2,
.seo h3 {
  color: var(--text);
  font-family: var(--font-title);
  margin: 0 0 8px;
  letter-spacing: 0.01em;
}

.seo p {
  margin: 0 0 14px;
  line-height: 1.7;
  max-width: 72ch;
}

.seo ul {
  margin: 0 0 16px;
  padding-left: 20px;
  display: grid;
  gap: 7px;
}

.seo li {
  margin: 0;
  line-height: 1.45;
}

.faq {
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.faq details {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.05));
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease;
}

.faq details:hover {
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--muted);
  font-weight: 700;
}

.faq details[open] summary::after {
  content: "–";
}

.faq p {
  margin: 10px 0 0;
  line-height: 1.62;
  color: rgba(238, 232, 255, 0.88);
}

.toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 0.9rem;
}

.toggle input {
  width: 18px;
  height: 18px;
}

@keyframes flip {
  0% { transform: rotateY(0deg); }
  50% { transform: rotateY(90deg) scale(0.98); }
  100% { transform: rotateY(0deg); }
}

@keyframes flip-snap {
  0% {
    transform: rotateY(0deg) scale(1);
    filter: brightness(1);
  }
  30% {
    transform: rotateY(-10deg) scale(0.986);
    filter: brightness(0.96);
  }
  62% {
    transform: rotateY(7deg) scale(1.012);
    filter: brightness(1.02);
  }
  100% {
    transform: rotateY(0deg) scale(1);
    filter: brightness(1);
  }
}

.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 10px 14px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  animation: toast 2.2s ease forwards;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 1400;
  display: none;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border-radius: 16px;
  background: rgba(22, 18, 52, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.4);
}

.cookie-banner.show {
  display: flex;
}

.cookie-text strong {
  display: block;
  margin-bottom: 4px;
}

.cookie-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.cookie-text a {
  color: var(--accent-2);
}

.cookie-actions {
  display: inline-flex;
  gap: 8px;
  flex-shrink: 0;
}

.age-gate {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 139, 0, 0.28), transparent 60%),
    var(--bg-3);
}

.age-gate-card {
  width: min(420px, 100%);
  background: rgba(26, 20, 58, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.age-gate-card .logo {
  margin: 0 auto 16px;
}

.age-gate-card h1 {
  font-family: var(--font-title);
  font-size: 1.5rem;
  margin: 0 0 10px;
  color: var(--text);
}

.age-gate-card p {
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.5;
}

.age-gate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.age-gate-actions button {
  width: 100%;
}

.age-gate-fineprint {
  margin: 14px 0 0 !important;
  font-size: 0.78rem;
  opacity: 0.7;
}

.cookie-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 24, 0.55);
  display: none;
  place-items: center;
  z-index: 1500;
  padding: 16px;
}

.cookie-modal-backdrop.open {
  display: grid;
}

.cookie-modal {
  width: min(560px, 100%);
  background: rgba(26, 20, 58, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
}

.cookie-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.cookie-modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
}

.cookie-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cookie-option:first-of-type {
  border-top: none;
}

.cookie-option p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.switch input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.switch input:disabled {
  opacity: 0.75;
}

.cookie-option strong {
  font-family: var(--font-title);
}

.cookie-modal-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cookie-modal-actions .primary,
.cookie-modal-actions .ghost {
  min-width: 130px;
}

.site-footer {
  margin-top: 12px;
  padding: 14px 0 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: rgba(247, 244, 255, 0.62);
  font-size: 0.86rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.site-footer a,
.site-footer .footer-link {
  color: rgba(247, 244, 255, 0.62);
  text-decoration: none;
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  display: inline-block;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.18s ease;
}

.site-footer a:hover,
.site-footer .footer-link:hover {
  color: rgba(247, 244, 255, 0.82);
  transform: translateY(-1px);
}

.policy-page .app {
  max-width: 860px;
}

.policy {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 16px 34px rgba(9, 8, 30, 0.25);
}

.policy h1 {
  margin-top: 0;
}

.policy h2 {
  margin-bottom: 8px;
}

.policy p,
.policy li {
  color: var(--muted);
}

@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, 10px); }
  15% { opacity: 1; transform: translate(-50%, 0); }
  85% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 10px); }
}

@media (min-width: 700px) {
  .modes {
    grid-template-columns: repeat(3, 1fr);
  }

  .mode {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 10px;
  }

  .seo {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    column-gap: 26px;
    row-gap: 8px;
    align-items: start;
  }

  .seo h2,
  .seo > p,
  .seo > h3:not(:first-of-type),
  .seo > ul {
    grid-column: 1;
  }

  .seo .faq {
    grid-column: 2;
    grid-row: 1 / span 8;
    align-self: stretch;
    padding-left: 4px;
  }
}

@media (max-width: 520px) {
  .app {
    padding: 14px 12px calc(32px + env(safe-area-inset-bottom));
    gap: 14px;
  }

  .title {
    font-size: 1.12rem;
  }

  .subtitle {
    font-size: 0.76rem;
  }

  .controls {
    flex-direction: column;
  }

  .top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 0;
  }

  .brand {
    gap: 8px;
    min-width: 0;
  }

  .top-actions {
    justify-content: flex-end;
    flex: 0 0 auto;
  }

  .brand-text {
    min-width: 0;
  }

  .title,
  .subtitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .statement {
    min-height: 52vh;
  }

  .primary,
  .secondary {
    width: 100%;
  }

  .meta {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .meta-left {
    justify-content: space-between;
  }

  .meta-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .meta-actions .ghost {
    width: 100%;
    padding: 10px 8px;
  }

  .modes {
    grid-template-columns: repeat(2, 1fr);
  }

  .setup-row {
    align-items: stretch;
  }

  .length-options {
    width: 100%;
    grid-template-columns: 1fr;
  }

  .length-option {
    width: 100%;
  }

  .round-complete-actions {
    flex-direction: column;
  }

  .mode {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    gap: 8px;
  }

  .mode-picker h2 {
    font-size: 1.3rem;
  }

  .seo {
    padding: 20px 16px;
  }

  .mode-title,
  .mode-desc {
    text-align: center;
  }

  .favorite {
    top: 12px;
    right: 12px;
  }

  .pill {
    max-width: calc(100% - 52px);
  }

  #btnMute {
    padding: 8px 10px;
    font-size: 0.85rem;
  }

  .read-current {
    top: 12px;
    right: 64px;
    width: 38px;
    height: 38px;
    font-size: 0.96rem;
  }

  .card-back {
    padding-top: 0;
  }

  .statement-text {
    line-height: 1.2;
    padding: 22px 18px;
  }

  .ad-slot[data-ad-type="partner"] {
    padding: 8px;
  }

  .ad-slot[data-ad-type="partner"] .ad-media {
    border-radius: 10px;
    aspect-ratio: 930 / 180;
  }

  .swipe-hint {
    bottom: 18px;
    font-size: 0.74rem;
    padding: 7px 11px;
  }

  .custom-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .custom-item-actions {
    justify-content: flex-start;
  }

  .drawer-backdrop {
    align-items: end;
    padding: 0;
  }

  .drawer {
    width: 100%;
    max-height: 88vh;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    padding: 16px 14px 20px;
  }

  .cookie-banner {
    flex-direction: column;
    align-items: flex-start;
    bottom: 10px;
    left: 10px;
    right: 10px;
  }

  .cookie-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .cookie-actions .ghost,
  .cookie-actions .primary {
    width: 100%;
  }

  .cookie-modal {
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 88vh;
    overflow: auto;
  }

  .cookie-option {
    flex-direction: column;
    align-items: flex-start;
  }

  .cookie-modal-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
