/* Mismatch web card — matches iOS AppColor + distribution room */

:root {
  --bg-top: rgb(26, 28, 46);
  --bg-bottom: rgb(15, 18, 31);
  --bg-elevated: rgb(26, 28, 51);
  --card: rgb(36, 38, 66);
  --card-border: rgba(255, 255, 255, 0.08);
  --label: #ffffff;
  --secondary: rgba(255, 255, 255, 0.62);
  --accent: rgb(140, 92, 255);
  --accent-secondary: rgb(250, 115, 140);
  --success: rgb(77, 217, 166);
  --warning: rgb(255, 184, 89);
  --hero-start: rgb(115, 71, 242);
  --hero-end: rgb(217, 82, 148);
  --insider: rgb(56, 224, 173);
  --mismatch: rgb(250, 97, 87);
  --ghost: rgb(173, 122, 250);
  --radius-md: 14px;
  --radius-lg: 16px;
  --radius-xl: 18px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-rounded: -apple-system, BlinkMacSystemFont, "SF Pro Rounded", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  color: var(--label);
  background: var(--bg-bottom);
  -webkit-font-smoothing: antialiased;
}

/* Party room background (distribution style) */
.room-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--bg-top) 0%, rgb(15, 18, 36) 55%, var(--bg-bottom) 100%);
  pointer-events: none;
  overflow: hidden;
}

.room-bg::before,
.room-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(56px);
  pointer-events: none;
}

.room-bg::before {
  width: min(80vw, 340px);
  height: min(80vw, 340px);
  left: -12%;
  bottom: 16%;
  background: rgba(250, 97, 87, 0.2);
}

.room-bg::after {
  width: min(72vw, 300px);
  height: min(72vw, 300px);
  right: -10%;
  bottom: 20%;
  background: rgba(173, 122, 250, 0.22);
}

.room-lights {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 184, 89, 0.16) 0, transparent 28%),
    radial-gradient(circle at 88% 10%, rgba(56, 224, 173, 0.14) 0, transparent 26%),
    radial-gradient(circle at 50% 0%, rgba(140, 92, 255, 0.12) 0, transparent 32%);
}

.room-vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, transparent 25%, rgba(0, 0, 0, 0.45) 100%);
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 2;
  max-width: 440px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100dvh;
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: fade-in 0.25s ease-out;
}

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

.brand {
  text-align: center;
  padding-top: 8px;
}

.brand-mark {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 12px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 10px 18px rgba(120, 70, 220, 0.32);
}

.brand-title {
  font-family: var(--font-rounded);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.brand-sub {
  font-family: var(--font-rounded);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--secondary);
  margin: 6px 0 0;
}

.panel {
  background: rgba(36, 38, 66, 0.92);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 18px 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.headline {
  font-family: var(--font-rounded);
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 6px;
  color: var(--label);
}

.sub {
  font-family: var(--font-rounded);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--secondary);
  margin: 0 0 16px;
  line-height: 1.45;
}

.loading {
  font-family: var(--font-rounded);
  font-size: 0.9375rem;
  color: var(--secondary);
  text-align: center;
  padding: 48px 16px;
}

.error {
  font-family: var(--font-rounded);
  font-size: 0.9375rem;
  color: rgb(248, 113, 113);
  text-align: center;
  padding: 24px 12px;
  line-height: 1.5;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-family: var(--font-rounded);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 4px 0;
  cursor: pointer;
}

.link-btn:active { opacity: 0.7; }

.player-tag {
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-family: var(--font-rounded);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--label);
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-btn {
  appearance: none;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  color: var(--label);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 500;
  padding: 15px 16px;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.player-btn:not(.picked):active {
  transform: scale(0.98);
  background: rgb(46, 48, 82);
}

.player-btn.picked {
  opacity: 0.55;
  cursor: default;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.card-back {
  appearance: none;
  border: 1.5px solid rgba(140, 92, 255, 0.28);
  border-radius: var(--radius-lg);
  height: 110px;
  cursor: pointer;
  background: linear-gradient(145deg, rgb(26, 28, 51) 0%, rgb(36, 38, 66) 100%);
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.card-back:active:not(:disabled) {
  transform: scale(0.97);
}

.card-back:disabled,
.card-back.claiming {
  opacity: 0.55;
  cursor: wait;
}

.card-back-icon {
  font-family: var(--font-rounded);
  font-size: 1.75rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1;
}

.card-taken {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  height: 110px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
}

.card-taken-icon {
  font-size: 1.375rem;
  color: var(--secondary);
  line-height: 1;
}

.card-taken .name {
  font-family: var(--font-rounded);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--label);
  text-align: center;
  line-height: 1.2;
  padding: 0 6px;
  word-break: break-word;
}

.card-still-open {
  border: 1px solid rgba(173, 122, 250, 0.45);
  background: rgba(36, 38, 66, 0.95);
}

.card-still-open .card-taken-icon {
  color: var(--ghost);
  font-size: 1.5rem;
}

.card-still-open .name {
  color: var(--secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.revealed {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.badge {
  display: inline-block;
  font-family: var(--font-rounded);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge.insider {
  background: rgba(48, 217, 166, 0.2);
  color: var(--insider);
}

.badge.mismatch {
  background: rgba(250, 97, 87, 0.2);
  color: var(--mismatch);
}

.badge.ghost {
  background: rgba(173, 122, 250, 0.2);
  color: var(--ghost);
}

.ghost-reveal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ghost-icon {
  font-size: 3rem;
  line-height: 1;
  color: var(--ghost);
  filter: drop-shadow(0 2px 8px rgba(173, 122, 250, 0.35));
}

.ghost-title {
  font-family: var(--font-rounded);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ghost);
  margin: 0;
  letter-spacing: 0.02em;
}

.role-callout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.reveal-copy {
  font-size: 1rem;
  color: var(--secondary);
  margin: 0;
  line-height: 1.45;
}

.reveal-copy.emphasis {
  font-family: var(--font-rounded);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--label);
}

.secret {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  min-height: 88px;
  font-family: var(--font-rounded);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--label);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  letter-spacing: 0.04em;
}

.secret.shown,
.secret.word-reveal {
  background: var(--bg-elevated);
  border-color: var(--card-border);
  letter-spacing: normal;
}

.secret.word-reveal {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--label);
}

.hint {
  font-family: var(--font-rounded);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--secondary);
  margin: 0;
  line-height: 1.45;
}

.primary-btn,
.secondary-btn {
  appearance: none;
  width: 100%;
  font-family: var(--font-rounded);
  font-size: 1.0625rem;
  font-weight: 600;
  padding: 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  border: none;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--hero-start), var(--hero-end));
  color: #fff;
  box-shadow: 0 6px 20px rgba(140, 92, 255, 0.35);
}

.secondary-btn {
  background: var(--card);
  color: var(--label);
  border: 1px solid var(--card-border);
}

.primary-btn:active,
.secondary-btn:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.vote-list {
  margin-top: 8px;
}

.vote-btn.selected {
  border-color: rgba(140, 92, 255, 0.95);
  background: rgba(140, 92, 255, 0.18);
}

.vote-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 0 0.35rem;
  margin-left: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.8125rem;
  font-weight: 700;
}

.vote-banner {
  appearance: none;
  width: 100%;
  margin-bottom: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(140, 92, 255, 0.45);
  border-radius: var(--radius-lg);
  background: rgba(140, 92, 255, 0.16);
  color: var(--label);
  font-family: var(--font-rounded);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.success-copy {
  color: var(--success);
}

.vote-casts {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.vote-casts-title {
  margin: 0 0 8px;
  font-weight: 600;
}

.vote-cast-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.vote-cast-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
}

.vote-cast-voter {
  color: var(--label);
  font-weight: 600;
}

.vote-cast-arrow {
  color: var(--secondary-label);
  opacity: 0.8;
}

.vote-cast-target {
  color: var(--accent);
  font-weight: 600;
}

/* Home-style room for the privacy page */
.room-bg.room-home {
  background: linear-gradient(180deg, rgb(56, 31, 87) 0%, rgb(36, 24, 64) 46%, rgb(31, 20, 51) 100%);
}

.room-bg.room-home::before {
  left: -18%;
  bottom: 6%;
  background: rgba(242, 115, 140, 0.32);
}

.room-bg.room-home::after {
  right: -14%;
  bottom: 10%;
  background: rgba(140, 92, 255, 0.34);
}

.string-lights {
  position: fixed;
  top: 10px;
  left: 0;
  right: 0;
  height: 28px;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255, 220, 160, 0.55), transparent) 0 8px / 100% 1px no-repeat,
    radial-gradient(circle at 8% 14px, #ffb859 0 3px, transparent 4px),
    radial-gradient(circle at 24% 10px, #38e0ad 0 3px, transparent 4px),
    radial-gradient(circle at 42% 16px, #fa6157 0 3px, transparent 4px),
    radial-gradient(circle at 60% 9px, #ad7afa 0 3px, transparent 4px),
    radial-gradient(circle at 78% 15px, #ffc72e 0 3px, transparent 4px),
    radial-gradient(circle at 92% 11px, #8c5cff 0 3px, transparent 4px);
}

.policy-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: rgba(22, 14, 36, 0.9);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.policy-tray {
  display: flex;
  align-items: center;
  gap: 10px;
}

.policy-tray img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
}

.policy-tray-name {
  font-family: var(--font-rounded);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.policy-page {
  position: relative;
  z-index: 2;
  width: 100%;
  padding: 12px max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

.policy.panel {
  padding: 22px 20px 28px;
}

.policy h1 {
  font-family: var(--font-rounded);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 2px;
}

.policy h2 {
  font-family: var(--font-rounded);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}

.policy p,
.policy li {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--secondary);
}

.policy p {
  margin: 0 0 12px;
}

.policy p:last-child {
  margin-bottom: 0;
}

.policy a {
  color: var(--accent-secondary);
}

.policy ul {
  margin: 0 0 8px;
  padding-left: 1.15rem;
}

.policy .updated {
  margin: 0 0 10px;
  color: var(--secondary);
  font-size: 0.8125rem;
}

.policy-sections {
  margin-top: 20px;
}

.policy-sections section {
  break-inside: avoid;
  margin: 0 0 28px;
}

.policy-sections section:last-child {
  margin-bottom: 0;
}

@media (min-width: 700px) {
  .policy-bar,
  .policy-page {
    padding-inline: 28px;
  }

  .policy.panel {
    padding: 32px 40px 36px;
  }
}

@media (min-width: 1100px) {
  .policy-bar,
  .policy-page {
    padding-inline: 40px;
  }
}
