:root {
  --bg-deep: #050505;
  --bg-mid: #0a0a0c;
  --panel: rgba(12, 12, 14, 0.7);
  --panel-soft: rgba(255, 255, 255, 0.04);
  --line: rgba(255, 255, 255, 0.08);
  --text-strong: #ffffff;
  --text-soft: rgba(255, 255, 255, 0.65);
  --accent: #8b5cf6;
  --accent-strong: #d946ef;
  --mint: #34d399;
  --warning: #fbbf24;
  --shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text-strong);
  background-color: var(--bg-deep);
  background-image: 
    radial-gradient(ellipse at top, rgba(139, 92, 246, 0.15), transparent 50%),
    radial-gradient(ellipse at bottom left, rgba(217, 70, 239, 0.12), transparent 40%),
    radial-gradient(ellipse at bottom right, rgba(52, 211, 153, 0.08), transparent 40%);
  background-attachment: fixed;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
  padding: 22px 14px calc(16px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.aurora {
  position: absolute;
  border-radius: 999px;
  filter: blur(30px);
  opacity: 0.7;
  pointer-events: none;
}

.aurora-one {
  top: -100px;
  right: -50px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.4), transparent 70%);
  filter: blur(60px);
  animation: drift 12s ease-in-out infinite alternate;
}

.aurora-two {
  bottom: -50px;
  left: -50px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(217, 70, 239, 0.3), transparent 70%);
  filter: blur(80px);
  animation: drift 15s ease-in-out infinite alternate reverse;
}

.app-card {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  width: min(1080px, 100%);
  margin: 0 auto;
  min-height: 0;
}

.top-bar {
  order: 0;
}

.status-banner {
  order: 1;
}

.result-sheet {
  order: 2;
}

.chat-panel {
  order: 3;
}

.challenge-card {
  order: 4;
}

.composer {
  order: 5;
}

.leaderboard-sheet {
  order: 6;
}

.top-bar,
.challenge-card,
.result-sheet,
.chat-panel,
.composer,
.leaderboard-card,
.start-card,
.status-banner {
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  background: linear-gradient(145deg, rgba(20, 20, 22, 0.8), rgba(10, 10, 12, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: var(--shadow);
}

.top-bar {
  position: sticky;
  top: max(10px, env(safe-area-inset-top));
  z-index: 6;
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: 28px;
}

.top-bar-main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-lockup h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 5vw, 3.3rem);
  line-height: 0.95;
  background: linear-gradient(135deg, #fff, #a1a1aa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--text-soft);
}

.status-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-button {
  border: 0;
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-strong);
  cursor: pointer;
  white-space: nowrap;
}

.pill {
  min-width: 94px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  display: grid;
  gap: 2px;
}

.pill strong {
  font-size: 1.12rem;
}

.pill-label {
  font-size: 0.72rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.timer-pill {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(217, 70, 239, 0.15));
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: inset 0 0 12px rgba(251, 191, 36, 0.1);
}

.challenge-card {
  padding: 18px;
  border-radius: 30px;
  display: grid;
  gap: 16px;
}

.challenge-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.challenge-kicker,
.rules-title,
.target-label {
  margin: 0 0 6px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
}

.challenge-header h2 {
  margin: 0;
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.difficulty-chip,
.rule-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.88rem;
}

.difficulty-chip {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(217, 70, 239, 0.3);
  box-shadow: 0 0 10px rgba(217, 70, 239, 0.1);
  text-transform: capitalize;
}

.target-box {
  border-radius: 26px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.01)),
    linear-gradient(125deg, rgba(139, 92, 246, 0.1), rgba(217, 70, 239, 0.08));
  border: 1px solid rgba(217, 70, 239, 0.2);
  box-shadow: inset 0 0 20px rgba(139, 92, 246, 0.05);
  padding: 20px;
}

.target-text {
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 6vw, 3.2rem);
  line-height: 1.02;
  background: linear-gradient(135deg, #d946ef, #8b5cf6, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(217, 70, 239, 0.4));
}

.challenge-teaser {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.rules-grid {
  display: grid;
  gap: 12px;
}

.rules-column {
  padding: 16px;
  border-radius: 22px;
  background: var(--panel-soft);
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chat-panel {
  display: flex;
  min-height: 0;
  padding: 16px;
  border-radius: 30px;
}

.chat-log {
  flex: 1 1 auto;
  min-height: 290px;
  max-height: 46vh;
  overflow-y: auto;
  display: grid;
  gap: 14px;
  padding-right: 4px;
}

.empty-state {
  border-radius: 26px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.empty-title {
  margin: 0 0 8px;
  font-size: 1.08rem;
  font-weight: 700;
}

.empty-copy {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.55;
}

.empty-state-compact {
  padding: 14px 16px;
}

.empty-state-compact .empty-title {
  margin-bottom: 4px;
  font-size: 0.98rem;
}

.empty-state-compact .empty-copy {
  font-size: 0.92rem;
  line-height: 1.4;
}

.message {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 24px;
  max-width: min(92%, 720px);
  animation: rise 240ms ease;
}

.message.user {
  margin-left: auto;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(217, 70, 239, 0.2));
  border: 1px solid rgba(217, 70, 239, 0.2);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.1);
  border-bottom-right-radius: 6px;
}

.message.assistant {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 6px;
}

.message-thinking {
  border: 1px dashed rgba(255, 255, 255, 0.14);
}

.message-meta {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-soft);
}

.message-body {
  line-height: 1.55;
  white-space: pre-wrap;
}

.thinking-body {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.message-image {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.leaderboard-card {
  padding: 16px;
  border-radius: 26px;
}

.leaderboard-sheet {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: end center;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  background: rgba(5, 5, 5, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.leaderboard-modal {
  width: min(520px, 100%);
  max-height: min(72vh, 680px);
  overflow: auto;
}

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

.leaderboard-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.leaderboard-head h3 {
  margin: 0;
  font-size: 1rem;
}

.leaderboard-head button,
.link-button {
  border: 0;
  background: none;
  color: var(--mint);
  cursor: pointer;
}

.leaderboard-list {
  display: grid;
  gap: 10px;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.leaderboard-rank,
.leaderboard-meta,
.leaderboard-score strong,
.leaderboard-score span {
  margin: 0;
}

.leaderboard-rank {
  font-weight: 700;
}

.leaderboard-meta,
.leaderboard-score span,
.leaderboard-empty {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.leaderboard-score {
  text-align: right;
  display: grid;
  gap: 4px;
}

.composer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 28px;
}

.composer-input-wrap {
  display: block;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 200ms ease;
}

.composer-input-wrap:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.15);
}

.composer textarea,
.start-form input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text-strong);
  background: transparent;
}

.composer textarea {
  resize: none;
  min-height: 58px;
  max-height: 180px;
  padding: 16px;
}

.composer textarea::placeholder,
.start-form input::placeholder {
  color: rgba(247, 243, 235, 0.5);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.icon-button,
.send-button,
.primary-cta,
.secondary-cta {
  border: 0;
  border-radius: 18px;
  padding: 14px 18px;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.icon-button:active,
.send-button:active,
.primary-cta:active,
.secondary-cta:active {
  transform: scale(0.96);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-strong);
}

.icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

.send-button,
.primary-cta {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-weight: 700;
  min-width: 112px;
  box-shadow: 0 4px 14px rgba(217, 70, 239, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.send-button:hover,
.primary-cta:hover {
  box-shadow: 0 6px 20px rgba(217, 70, 239, 0.4);
  filter: brightness(1.1);
}

.secondary-cta {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-strong);
  font-weight: 700;
  min-width: 112px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.secondary-cta:hover {
  background: rgba(255, 255, 255, 0.08);
}

.send-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.inline-loader {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.inline-loader p {
  margin: 0;
}

.loader-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-top-color: var(--mint);
  animation: spin 0.8s linear infinite;
  flex: 0 0 auto;
}

.upload-preview {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.upload-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 16px;
}

.upload-meta {
  display: grid;
  gap: 6px;
}

.upload-meta p {
  margin: 0;
}

.status-banner {
  padding: 14px 16px;
  border-radius: 22px;
  font-weight: 600;
  animation: rise 220ms ease;
}

.status-continue {
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.status-win {
  background: rgba(52, 211, 153, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.3);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.1);
}

.status-loss,
.status-expired {
  background: rgba(217, 70, 239, 0.15);
  border: 1px solid rgba(217, 70, 239, 0.3);
  box-shadow: 0 0 12px rgba(217, 70, 239, 0.1);
}

.result-sheet {
  padding: 18px;
  border-radius: 28px;
  background:
    linear-gradient(150deg, rgba(255, 255, 255, 0.05), rgba(139, 92, 246, 0.05)),
    var(--panel);
  animation: scaleIn 400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.result-sheet-copy {
  display: grid;
  gap: 12px;
}

.result-sheet-copy h3,
.result-reason,
.result-score {
  margin: 0;
}

.result-sheet-copy h3 {
  font-family: "Fraunces", serif;
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  background: linear-gradient(135deg, #fff, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-reason {
  color: var(--text-soft);
  line-height: 1.55;
}

.result-score {
  font-size: 1.05rem;
  font-weight: 700;
}

.result-breakdown {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
}

.result-transcript {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
}

.result-transcript-list {
  display: grid;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.result-transcript-row {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
}

.result-transcript-row.user {
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(139, 92, 246, 0.12));
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-layout {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 16px;
  width: min(1100px, 100%);
  margin: 0 auto;
}

.share-hero,
.share-card {
  backdrop-filter: blur(18px);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.share-hero {
  display: grid;
  gap: 14px;
  padding: 22px;
  border-radius: 28px;
}

.share-hero h1 {
  margin: 0;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 5vw, 3.1rem);
  line-height: 0.95;
}

.share-copy {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
}

.share-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-grid {
  display: grid;
  gap: 16px;
}

.share-card {
  border-radius: 28px;
}

.share-transcript-card {
  padding: 18px;
}

.share-breakdown {
  margin-top: 2px;
}

.share-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.share-transcript-header {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.share-transcript-list {
  display: grid;
  gap: 12px;
}

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
}

.breakdown-row strong {
  color: var(--text-strong);
}

.start-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(5, 5, 5, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 3;
}

.start-card {
  width: min(460px, 100%);
  padding: 28px;
  border-radius: 32px;
  animation: scaleIn 400ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.start-card h2 {
  margin: 0 0 12px;
  font-family: "Fraunces", serif;
  font-size: clamp(2rem, 6vw, 3rem);
  line-height: 0.95;
  background: linear-gradient(135deg, #fff, #d946ef);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.start-copy {
  margin: 0 0 18px;
  line-height: 1.6;
  color: var(--text-soft);
}

.start-form {
  display: grid;
  gap: 16px;
}

.start-form label {
  display: grid;
  gap: 8px;
}

.start-form label span {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-soft);
}

.start-form input {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 200ms ease;
}

.start-form input:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.4);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.15);
}

.hidden {
  display: none !important;
  opacity: 0;
  pointer-events: none;
}

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

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

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(14px, 18px, 0) scale(1.08);
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 900px) {
  .rules-grid {
    grid-template-columns: 1fr 1fr;
  }

  .share-grid {
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    align-items: start;
  }
}

@media (max-width: 720px) {
  body:not(.share-page):not(.result-mode) {
    overflow: hidden;
  }

  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    padding: 12px 10px calc(10px + env(safe-area-inset-bottom));
  }

  .app-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 10px;
    min-height: 0;
  }

  .top-bar {
    padding: 10px 12px;
    border-radius: 20px;
    gap: 8px;
  }

  .top-bar-main {
    align-items: center;
  }

  .topbar-actions {
    gap: 8px;
  }

  .brand-lockup .eyebrow {
    display: none;
  }

  .brand-lockup h1 {
    font-size: 1.45rem;
    line-height: 1;
  }

  .topbar-button {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .status-pills {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: stretch;
    gap: 8px;
  }

  .pill {
    min-width: 0;
    padding: 8px 10px;
    border-radius: 16px;
  }

  .pill strong {
    font-size: 0.96rem;
  }

  .pill-label {
    font-size: 0.68rem;
  }

  .chat-log {
    min-height: 0;
    max-height: none;
    gap: 10px;
  }

  .challenge-card {
    padding: 14px;
    gap: 12px;
    border-radius: 22px;
    max-height: min(32vh, 280px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .target-box {
    padding: 14px;
    border-radius: 20px;
  }

  .target-text {
    font-size: clamp(1.2rem, 5.4vw, 1.8rem);
  }

  .rules-column {
    padding: 12px;
    border-radius: 16px;
  }

  .challenge-header {
    flex-direction: column;
    gap: 10px;
  }

  .challenge-header h2 {
    font-size: 1.14rem;
  }

  .challenge-kicker,
  .rules-title,
  .target-label {
    margin-bottom: 4px;
    font-size: 0.68rem;
  }

  .challenge-teaser {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .chip-row {
    gap: 8px;
  }

  .rule-chip {
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .chat-panel {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px;
    border-radius: 22px;
  }

  .chat-panel-idle {
    flex: 0 0 auto;
  }

  .chat-panel-idle .chat-log {
    max-height: 132px;
  }

  .message {
    max-width: 100%;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 20px;
  }

  .empty-state {
    padding: 14px;
    border-radius: 20px;
  }

  .empty-title {
    font-size: 0.98rem;
    margin-bottom: 6px;
  }

  .empty-copy {
    font-size: 0.92rem;
    line-height: 1.45;
  }

  .status-banner {
    padding: 10px 12px;
    border-radius: 18px;
    font-size: 0.93rem;
  }

  .result-sheet {
    padding: 16px;
    border-radius: 22px;
  }

  .result-transcript {
    padding: 12px;
    border-radius: 18px;
  }

  .result-transcript-list {
    max-height: 180px;
  }

  .result-transcript-row {
    padding: 11px 12px;
  }

  .composer {
    padding: 10px;
    gap: 10px;
    border-radius: 22px;
  }

  .composer-input-wrap {
    border-radius: 18px;
  }

  .composer textarea {
    min-height: 48px;
    max-height: 120px;
    padding: 14px 15px;
  }

  .composer-actions {
    flex-direction: row;
    align-items: center;
  }

  .upload-preview {
    padding: 8px;
    border-radius: 18px;
  }

  .upload-preview img {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .icon-button,
  .send-button,
  .primary-cta,
  .secondary-cta {
    justify-content: center;
  }

  .icon-button,
  .send-button,
  .secondary-cta {
    padding: 12px 14px;
    border-radius: 16px;
  }

  .icon-button {
    flex: 0 0 auto;
  }

  .send-button {
    flex: 1 1 auto;
    min-width: 0;
  }

  .leaderboard-sheet {
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom));
  }

  .result-actions {
    flex-direction: column-reverse;
  }

  body.result-mode .composer {
    display: none;
  }

  body.result-mode,
  body.share-page {
    overflow-y: auto;
  }

  body.result-mode .app-shell,
  body.share-page .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  body.result-mode .app-card {
    height: auto;
    min-height: 100dvh;
  }

  body.result-mode .result-sheet {
    overflow: visible;
  }

  body.share-page .challenge-card {
    max-height: none;
    overflow: visible;
  }

  .share-hero,
  .share-card {
    border-radius: 22px;
  }

  .share-transcript-card {
    padding: 14px;
  }
}

/* Custom Premium Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ------- Enhancements ------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #0f0a24;
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 8px 0;
  z-index: 9999;
}
.skip-link:focus {
  left: 0;
}

:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
  border-radius: 4px;
}

.hint-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.hint-text {
  flex: 1;
  min-width: 200px;
  margin: 0;
  color: var(--text-soft, #c5c0e4);
  font-size: 0.9rem;
  font-style: italic;
}
.hint-row button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.share-opt-in {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0;
  font-size: 0.88rem;
  color: var(--text-soft, #c5c0e4);
}
.share-opt-in input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #7c3aed;
}

#muteToggle {
  min-width: 40px;
}

#themeSelect {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: inherit;
  font-family: inherit;
  font-size: 0.95rem;
  margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
