:root {
  --hot-pink: #ff2d8e;
  --purple: #8a2be2;
  --yellow: #ffd93d;
  --cyan: #00e5ff;
  --orange: #ff8a3d;
  --off-white: #f7f7fb;
  --text: #1a1a1a;
  --muted: #667085;
  --line: #e5e7eb;
  --shadow: 0 18px 45px rgba(26, 26, 26, 0.1);
  color: var(--text);
  background: var(--off-white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

.auth-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at top, #29204d, #080811 62%);
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  background: rgba(16, 14, 29, 0.92);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.auth-form input,
.auth-form button {
  min-height: 48px;
  border-radius: 12px;
}

.auth-form input { padding: 0 14px; }
.auth-form button { border: 0; background: #ff4fd8; color: #fff; font-weight: 800; }
.auth-notice { margin-top: 16px; color: #d9d4ff; }

.account-dock {
  position: fixed;
  z-index: 80;
  top: max(10px, env(safe-area-inset-top));
  right: 10px;
  color: #fff;
}

.account-toggle,
.account-panel button {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(10, 9, 18, 0.72);
  color: #fff;
  font-weight: 800;
}

.account-panel {
  width: min(360px, calc(100vw - 20px));
  margin-top: 8px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  background: rgba(16, 14, 29, 0.97);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.account-panel h2 { margin: 0 0 8px; }
.account-panel p { color: #d9d4ff; line-height: 1.5; }
.account-panel button { width: 100%; border: 0; border-radius: 12px; background: #ff4fd8; }
.account-panel .secondary-button { margin-top: 10px; background: rgba(255, 255, 255, 0.1); }
.account-panel a { color: #76ecff; }
.policy-consent { display: grid; grid-template-columns: 22px 1fr; gap: 8px; align-items: start; font-size: 13px; line-height: 1.5; }
.policy-consent input { width: 18px; min-height: 18px; margin: 2px 0 0; }
.billing-summary { margin-bottom: 6px; font-size: 13px; }
.billing-links { margin-top: 0; font-size: 12px; }

@media (max-width: 640px) {
  .account-dock { top: max(6px, env(safe-area-inset-top)); right: 6px; }
  .account-panel { padding: 16px; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

#root {
  min-height: 100vh;
}

.app-shell {
  width: 100%;
  min-height: 100svh;
}

.storage-notice {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  z-index: 60;
  max-width: min(92vw, 520px);
  transform: translateX(-50%);
  border: 1px solid rgba(255, 45, 142, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 40px rgba(24, 16, 40, 0.18);
  color: var(--text);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.app-shell-create {
  width: min(1060px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.app-shell-play {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.app-shell-discover,
.app-shell-rank {
  width: min(980px, 100%);
  margin: 0 auto;
  padding: 18px 18px 104px;
}

.splash-screen {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 100svh;
  color: #fff;
  background: linear-gradient(135deg, rgba(255, 45, 142, 0.92), rgba(138, 43, 226, 0.94)), #1a1a1a;
}

.splash-mark {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border: 3px solid rgba(255, 255, 255, 0.28);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.26);
  animation: splash-pop 0.72s ease both;
}

.whimplay-mark {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.24));
}

.splash-screen h1 {
  margin: 0;
  font-size: clamp(38px, 10vw, 76px);
  line-height: 1;
}

.splash-screen p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 900;
}

.composer {
  border: 2px solid rgba(26, 26, 26, 0.08);
  border-radius: 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.hero-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  border-radius: 18px;
  padding: 18px;
  background: linear-gradient(135deg, #fff, #fff0f8 48%, #effcff);
}

.hero-strip h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.05;
}

.hero-strip p,
.generated-summary p,
.post-meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--hot-pink);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.field-label {
  display: block;
  margin: 0 0 8px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.prompt-box,
.comment-form textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 16px;
  resize: vertical;
  color: var(--text);
  background: #fff;
  padding: 13px;
  line-height: 1.55;
  outline: none;
}

.prompt-box:focus,
.comment-form textarea:focus {
  border-color: var(--hot-pink);
  box-shadow: 0 0 0 4px rgba(255, 45, 142, 0.14);
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.template-button {
  min-height: 110px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  text-align: left;
  color: var(--text);
}

.template-button span,
.template-button strong,
.template-button small {
  display: block;
}

.template-button span {
  color: var(--purple);
  font-size: 12px;
  font-weight: 950;
}

.template-button strong {
  margin: 7px 0;
  font-size: 16px;
}

.template-button small {
  color: var(--muted);
  line-height: 1.35;
}

.template-button.active {
  border-color: var(--hot-pink);
  background: #fff0f8;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.primary-button,
.secondary-button,
.publish-button,
.back-button,
.like-button,
.remix-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 14px;
  padding: 9px 14px;
  border: 2px solid transparent;
  font-weight: 950;
}

.primary-button {
  color: #fff;
  background: var(--hot-pink);
  border-color: var(--hot-pink);
}

.publish-button {
  color: var(--text);
  background: var(--yellow);
  border-color: var(--yellow);
}

.secondary-button,
.back-button,
.like-button {
  color: var(--text);
  background: #fff;
  border-color: var(--line);
}

.remix-button {
  color: #fff;
  background: var(--purple);
  border-color: var(--purple);
}

.animated-button {
  background: linear-gradient(90deg, var(--hot-pink), var(--purple), var(--cyan), var(--hot-pink));
  background-size: 240% 100%;
  animation: shimmer 4s linear infinite;
}

.creator-back {
  margin-bottom: 14px;
}

.flow-composer {
  display: grid;
  gap: 12px;
  min-height: calc(100svh - 36px);
  padding: 14px;
}

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

.flow-topbar .creator-back {
  margin: 0;
}

.flow-progress {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
}

.flow-progress span {
  min-height: 30px;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.flow-progress span.active {
  color: #fff;
  background: var(--purple);
}

.flow-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: min(720px, calc(100svh - 104px));
  border: 2px solid rgba(26, 26, 26, 0.08);
  border-radius: 20px;
  padding: 14px;
  background: #fff;
  box-shadow: var(--shadow);
}

.flow-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.flow-title-row h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  line-height: 1;
}

.preset-count {
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--text);
  background: var(--yellow);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.category-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.category-tabs button {
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
  font-weight: 950;
}

.category-tabs button.active {
  color: #fff;
  border-color: var(--hot-pink);
  background: var(--hot-pink);
}

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

.preset-grid button {
  display: grid;
  align-content: center;
  min-height: 104px;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.preset-grid button.active {
  border-color: var(--purple);
  background: #f8f4ff;
}

.preset-grid span,
.preset-grid strong,
.preset-grid small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preset-grid span {
  color: var(--purple);
  font-size: 12px;
  font-weight: 950;
}

.preset-grid strong {
  margin-top: 5px;
  font-size: 17px;
}

.preset-grid small {
  margin-top: 5px;
  color: var(--muted);
  font-weight: 850;
}

.compact-prompt {
  min-height: 128px;
  resize: none;
}

.flow-actions {
  margin-top: auto;
}

.generation-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.preview-workspace {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(280px, 1fr);
  gap: 14px;
  align-items: start;
}

.preview-game-pane {
  border-radius: 20px;
  overflow: hidden;
  background: #111827;
  box-shadow: var(--shadow);
}

.preview-game-pane .game-canvas {
  min-height: min(720px, calc(100svh - 116px));
  border-radius: 0;
}

.preview-control-pane {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: min(720px, calc(100svh - 116px));
  border: 2px solid rgba(26, 26, 26, 0.08);
  border-radius: 20px;
  padding: 12px;
  background: #fff;
  box-shadow: var(--shadow);
}

.compact-candidates {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.compact-candidates .candidate-grid {
  grid-template-columns: 1fr;
}

.compact-candidates .candidate-grid button {
  min-height: 58px;
}

.compact-summary {
  grid-template-columns: 62px minmax(0, 1fr);
  margin: 0;
  padding: 10px;
}

.compact-summary .thumbnail span {
  width: 38px;
  height: 38px;
  font-size: 13px;
}

.compact-summary h2 {
  margin-bottom: 2px;
  font-size: 16px;
}

.compact-summary p {
  font-size: 13px;
  line-height: 1.35;
}

.generated-summary {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 16px 0;
  padding: 14px;
  border: 2px dashed rgba(138, 43, 226, 0.28);
  border-radius: 18px;
  background: #fbf9ff;
}

.thumbnail {
  display: grid;
  place-items: center;
  aspect-ratio: 1.16 / 1;
  border-radius: 18px;
  overflow: hidden;
}

.thumbnail span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 18px;
  font-weight: 950;
}

.summary-title-row,
.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.generated-summary h2,
.post-meta h2 {
  margin: 0 0 6px;
  font-size: 20px;
  line-height: 1.2;
}

.preview-panel {
  margin-top: 16px;
  border-top: 2px solid #f0f1f4;
  padding-top: 16px;
}

.panel-heading span {
  font-weight: 950;
}

.candidate-panel {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border: 2px solid rgba(255, 45, 142, 0.18);
  border-radius: 18px;
  background: #fff7fb;
}

.panel-heading small {
  color: var(--muted);
  font-weight: 850;
}

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

.candidate-grid button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 76px;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.candidate-grid button.active {
  border-color: var(--hot-pink);
  box-shadow: 0 0 0 4px rgba(255, 45, 142, 0.12);
}

.candidate-grid strong,
.candidate-grid small {
  display: block;
  min-width: 0;
}

.candidate-grid small {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.candidate-thumb {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-weight: 950;
}

.asset-panel {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 14px;
  border: 2px solid rgba(0, 229, 255, 0.24);
  border-radius: 18px;
  background: #f0fdff;
}

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

.asset-upload-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 66px;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  color: var(--text);
  background: #fff;
  cursor: pointer;
}

.asset-upload-card svg {
  color: var(--purple);
}

.asset-upload-card strong,
.asset-upload-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-upload-card small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.asset-upload-card input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.asset-clear-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.asset-clear-row button {
  min-height: 32px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--hot-pink);
  background: #fff;
  font-size: 12px;
  font-weight: 950;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.tag,
.badge,
.sticker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.tag {
  min-height: 26px;
  padding: 4px 9px;
  color: #344054;
  background: #f2f4f7;
}

.badge {
  min-height: 27px;
  padding: 5px 9px;
  color: #fff;
  background: var(--hot-pink);
}

.badge-hot {
  background: var(--orange);
}

.badge-new-remix {
  background: var(--purple);
}

.badge-challenge {
  color: var(--text);
  background: var(--yellow);
}

.badge-vibe-check {
  color: var(--text);
  background: var(--cyan);
}

.sticker {
  min-height: 32px;
  padding: 7px 11px;
  border: 2px solid rgba(26, 26, 26, 0.12);
  box-shadow: 4px 5px 0 rgba(26, 26, 26, 0.08);
  transform: rotate(-2deg);
}

.sticker-pink {
  color: #fff;
  background: var(--hot-pink);
}

.sticker-yellow {
  color: var(--text);
  background: var(--yellow);
  transform: rotate(3deg);
}

.sticker-cyan {
  color: var(--text);
  background: var(--cyan);
}

.game-canvas {
  width: 100%;
  min-height: 520px;
  aspect-ratio: 9 / 16;
  border-radius: 18px;
  overflow: hidden;
  background: #111827;
  touch-action: none;
  user-select: none;
}

.game-canvas canvas {
  display: block;
  touch-action: none;
  user-select: none;
}

.tiktok-feed,
.tiktok-game-frame,
.detail-game-frame {
  min-height: 100svh;
}

.empty-play-feed {
  display: grid;
  place-items: center;
  gap: 14px;
  border: 2px dashed rgba(255, 45, 142, 0.28);
  background: #fff;
  padding: 24px;
}

.tiktok-game-frame,
.detail-game-frame {
  position: relative;
  display: block;
  height: 100svh;
  max-height: 100svh;
  overflow: hidden;
}

.tiktok-game-frame::before,
.detail-game-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6), transparent 24%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.74), transparent 38%);
  z-index: 2;
}

.tiktok-game-frame .game-canvas,
.detail-game-frame .game-canvas {
  position: absolute;
  inset: 0;
  width: min(100vw, 430px);
  height: 100svh;
  min-height: 0;
  margin: auto;
  border-radius: 0;
  box-shadow: none;
  z-index: 1;
}

.tiktok-topbar,
.tiktok-caption,
.feed-side-actions {
  position: relative;
  z-index: 3;
}

.tiktok-topbar {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 8px;
  color: #fff;
}

.tiktok-topbar .eyebrow {
  color: var(--cyan);
}

.tiktok-topbar h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1;
}

.tiktok-caption {
  position: absolute;
  right: 0;
  left: 0;
  top: calc(58px + env(safe-area-inset-top));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 0 86px 0 14px;
  color: #fff;
  pointer-events: none;
}

.tiktok-caption > div {
  max-height: 168px;
  overflow: hidden;
}

.tiktok-caption > div > p:not(.creator-line):not(.remix-source) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tiktok-caption .tag-row {
  max-height: 32px;
  overflow: hidden;
}

.play-minimal-meta {
  display: grid;
  gap: 2px;
  max-width: min(220px, calc(100vw - 148px));
  border-radius: 12px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

.play-minimal-meta strong,
.play-minimal-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play-minimal-meta strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.15;
}

.play-minimal-meta span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 850;
}

.tiktok-caption p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.45;
}

.tiktok-caption .creator-line,
.tiktok-caption .remix-source {
  color: #fff;
}

.tiktok-caption .tag {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

.creator-line {
  margin: 0;
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
}

.remix-source {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 900;
}

.feed-position,
.score-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 7px 11px;
  font-weight: 950;
}

.feed-position {
  min-height: 28px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  padding: 5px 9px;
  font-size: 12px;
}

.score-pill {
  gap: 7px;
  color: #064e3b;
  background: #dcfce7;
}

.hud-toggle {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 6;
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.32);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
}

.hud-toggle-immersive {
  opacity: 0.42;
}

.hud-toggle-immersive:hover,
.hud-toggle-immersive:focus-visible {
  opacity: 1;
}

.feed-side-actions {
  position: absolute;
  right: max(10px, env(safe-area-inset-right));
  top: 50%;
  display: grid;
  gap: 10px;
  pointer-events: auto;
  transform: translateY(-42%);
}

.feed-side-actions button,
.feed-side-actions .dock-link {
  display: grid;
  place-items: center;
  gap: 3px;
  width: 48px;
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  font-size: 11px;
  font-weight: 950;
  text-decoration: none;
}

.feed-side-actions small {
  font-size: 11px;
  line-height: 1;
}

.bottom-dock {
  position: fixed;
  right: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(62px, 1fr));
  gap: 6px;
  width: min(560px, calc(100% - 24px));
  padding: 8px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  background: rgba(20, 20, 22, 0.86);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  transform: translateX(50%);
  backdrop-filter: blur(18px);
}

.bottom-dock button {
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 54px;
  border: 0;
  border-radius: 16px;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  font-size: 11px;
  font-weight: 950;
}

.bottom-dock button.active,
.bottom-dock button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
}

.bottom-dock button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.bottom-dock .dock-create {
  color: #1a1a1a;
  background: var(--yellow);
}

.like-pop {
  animation: pop 0.48s ease;
  border-color: var(--hot-pink) !important;
  color: var(--hot-pink) !important;
}

.browse-screen {
  display: grid;
  gap: 14px;
  min-height: 100svh;
  padding-bottom: 10px;
}

.screen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 2px solid rgba(26, 26, 26, 0.08);
  border-radius: 24px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.screen-header h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.02;
}

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  border-radius: 999px;
  padding: 9px 13px;
  color: #fff;
  background: var(--text);
  font-weight: 950;
  text-decoration: none;
}

.ranking-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border-radius: 22px;
  padding: 18px;
  color: #1a1a1a;
  background: linear-gradient(135deg, var(--yellow), #fff0f8);
  box-shadow: var(--shadow);
}

.profile-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 2px solid rgba(26, 26, 26, 0.08);
  border-radius: 24px;
  padding: 18px;
  background: #fff;
  box-shadow: var(--shadow);
}

.profile-card h2,
.profile-card p {
  margin: 0;
}

.profile-card h2 {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1;
}

.profile-card p:not(.eyebrow) {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 28px;
  color: #fff;
  background: linear-gradient(135deg, var(--hot-pink), var(--purple));
  box-shadow: 8px 10px 0 rgba(0, 229, 255, 0.22);
}

.profile-avatar .whimplay-mark {
  width: 72px;
  height: 72px;
}

.profile-screen .metric-grid {
  grid-template-columns: repeat(4, 1fr);
}

.ranking-hero strong,
.ranking-hero span {
  display: block;
  min-width: 0;
}

.ranking-hero strong {
  font-size: clamp(22px, 4vw, 36px);
  line-height: 1.05;
}

.ranking-hero span {
  margin-top: 4px;
  font-weight: 950;
}

.discover-primary-controls,
.discover-secondary {
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: #fff;
}

.discover-primary-controls {
  display: grid;
  gap: 10px;
}

.discover-secondary {
  display: grid;
  gap: 12px;
}

.discover-secondary summary {
  cursor: pointer;
  color: var(--purple);
  font-weight: 950;
}

.discover-secondary[open] summary {
  margin-bottom: 12px;
}

.discover-sheet {
  position: fixed;
  right: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 18;
  display: grid;
  gap: 12px;
  width: min(720px, calc(100% - 24px));
  max-height: min(72svh, 680px);
  overflow: auto;
  padding: 16px;
  border: 2px solid rgba(26, 26, 26, 0.08);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
  transform: translateX(50%);
}

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

.sheet-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  min-height: 42px;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: #fff;
}

.search-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 10px 13px;
  background: #fff;
  color: var(--purple);
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-weight: 800;
}

.mode-tabs,
.tag-filter-row,
.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mode-tabs button,
.tag-filter-row button,
.filter-summary button {
  min-height: 34px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  color: var(--text);
  background: #fff;
  font-weight: 950;
}

.mode-tabs button.active,
.tag-filter-row button.active {
  color: #fff;
  border-color: var(--purple);
  background: var(--purple);
}

.filter-summary {
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.filter-summary button {
  color: var(--hot-pink);
}

.sheet-list {
  display: grid;
  gap: 8px;
}

.sheet-list button {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  color: var(--text);
  background: #fff;
  text-align: left;
}

.sheet-list strong,
.sheet-list small {
  display: block;
  min-width: 0;
}

.sheet-list small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.sheet-thumb {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  font-weight: 950;
}

.social-summary-grid,
.side-info-grid {
  display: grid;
  gap: 10px;
}

.social-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.side-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.social-summary-grid span,
.side-info-grid section {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fbfbfd;
}

.social-summary-grid span {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.social-summary-grid strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 18px;
}

.side-info-grid section {
  display: grid;
  gap: 8px;
  background: #fff;
}

.side-info-grid h3,
.side-info-grid p {
  margin: 0;
}

.side-info-grid h3 {
  font-size: 15px;
}

.side-info-grid p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.side-info-grid button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 9px;
  color: var(--text);
  background: #f8f4ff;
  text-align: left;
  font-weight: 850;
}

.detail-play-screen {
  min-height: 100svh;
  background: #0f1117;
}

.glass-back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  font-weight: 950;
  backdrop-filter: blur(10px);
}

.detail-caption h1 {
  margin: 0 0 6px;
  font-size: clamp(28px, 6vw, 56px);
  line-height: 1;
}

.comment-drawer {
  display: grid;
  gap: 14px;
  width: min(840px, calc(100% - 24px));
  margin: -22px auto 0;
  padding: 18px;
  border: 2px solid rgba(26, 26, 26, 0.08);
  border-radius: 24px 24px 0 0;
  background: #fff;
  box-shadow: 0 -18px 45px rgba(0, 0, 0, 0.12);
  position: relative;
  z-index: 5;
}

.post-meta,
.comment-form,
.comment-list {
  display: grid;
  gap: 10px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 6px 0;
}

.metric-grid span {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  color: var(--muted);
  background: #fbfbfd;
  font-size: 12px;
  font-weight: 850;
}

.metric-grid strong {
  display: block;
  color: var(--text);
  font-size: 22px;
}

.share-box {
  display: grid;
  gap: 6px;
  border: 2px dashed rgba(0, 229, 255, 0.36);
  border-radius: 16px;
  padding: 10px;
  background: #f0fdff;
}

.share-box span {
  color: var(--purple);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.share-box code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.comment-form {
  margin-top: 12px;
  padding-top: 18px;
  border-top: 2px solid #f0f1f4;
}

.comment-form .primary-button {
  width: fit-content;
}

.comment {
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px;
  background: #fbfbfd;
}

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

.comment p,
.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.created-at,
.comment time {
  color: var(--muted);
  font-size: 12px;
}

@keyframes shimmer {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 240% 50%;
  }
}

@keyframes pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.16) rotate(-4deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes splash-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.88);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 860px) {
  .app-shell-create,
  .app-shell-discover,
  .app-shell-rank {
    padding: 10px;
    padding-bottom: 94px;
  }

  .hero-strip,
  .generated-summary,
  .candidate-grid,
  .profile-card,
  .social-summary-grid,
  .side-info-grid {
    grid-template-columns: 1fr;
  }

  .candidate-grid button {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .asset-grid {
    grid-template-columns: 1fr;
  }

  .flow-composer {
    min-height: 100svh;
    padding: 10px;
  }

  .flow-topbar {
    align-items: start;
  }

  .flow-progress {
    max-width: calc(100vw - 104px);
  }

  .flow-card {
    min-height: calc(100svh - 88px);
    padding: 12px;
  }

  .flow-title-row h1 {
    font-size: 28px;
  }

  .category-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .category-tabs button {
    min-height: 38px;
    padding: 5px;
    font-size: 12px;
  }

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

  .preset-grid button {
    min-height: 92px;
    padding: 10px;
  }

  .preview-workspace {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .preview-game-pane .game-canvas {
    min-height: min(62svh, 560px);
  }

  .preview-control-pane {
    min-height: auto;
    padding: 10px;
  }

  .compact-candidates .candidate-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .compact-candidates .candidate-grid button {
    grid-template-columns: 1fr;
    justify-items: start;
    min-height: 72px;
    padding: 8px;
  }

  .compact-candidates .candidate-thumb,
  .compact-candidates .candidate-grid small {
    display: none;
  }

  .candidate-thumb {
    width: 48px;
    height: 48px;
  }

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

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

  .summary-title-row,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-canvas {
    min-height: 520px;
  }

  .tiktok-game-frame .game-canvas,
  .detail-game-frame .game-canvas {
    width: min(100vw, 430px);
    height: 100svh;
    min-height: 0;
  }

  .tiktok-topbar {
    padding: 14px 14px 6px;
  }

  .tiktok-caption {
    grid-template-columns: 1fr;
    top: calc(52px + env(safe-area-inset-top));
    padding-right: 82px;
    padding-left: 10px;
  }

  .tiktok-caption > div {
    max-height: 150px;
  }

  .feed-side-actions {
    right: max(8px, env(safe-area-inset-right));
    gap: 8px;
  }

  .feed-side-actions button,
  .feed-side-actions .dock-link {
    width: 46px;
    min-height: 46px;
  }

  .screen-header {
    align-items: flex-start;
    border-radius: 20px;
    padding: 14px;
  }

  .bottom-dock {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    width: calc(100% - 16px);
    padding: 6px;
    border-radius: 18px;
  }

  .bottom-dock button {
    min-height: 50px;
  }

  .sheet-list button {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .sheet-list .badge {
    grid-column: 2;
  }

  .sheet-thumb {
    width: 46px;
    height: 46px;
  }
}
