:root {
  color-scheme: light;
  --bg: #eef1f3;
  --surface: #ffffff;
  --ink: #151922;
  --muted: #6a7280;
  --line: #dfe4ea;
  --red: #d94242;
  --green: #1f8f68;
  --blue: #2563b8;
  --gold: #d69b22;
  --shadow: 0 14px 38px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

body {
  display: grid;
  place-items: center;
  padding: 20px;
}

button,
select {
  font: inherit;
}

.phone-shell {
  position: relative;
  width: min(430px, 100%);
  min-height: min(860px, calc(100vh - 40px));
  overflow: hidden;
  border: 1px solid rgba(21, 25, 34, 0.12);
  border-radius: 28px;
  background: #f7f8fa;
  box-shadow: var(--shadow);
}

#launchScreen,
#authScreen,
#appShell {
  display: none;
}

body.is-launching #launchScreen,
body.is-auth-required #authScreen,
body.is-app-ready #appShell {
  display: block;
}

.launch-screen {
  overflow: hidden;
  padding: 0;
  background: #fff;
  opacity: 0;
}

body.is-launching .launch-screen {
  animation: launchFade 3s ease-in-out forwards;
}

@keyframes launchFade {
  0% {
    opacity: 0;
  }

  20%,
  78% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

body.is-launching #launchScreen {
  display: block;
}

.launch-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-screen {
  padding: 42px 18px 28px;
}

.auth-hero {
  margin-bottom: 24px;
}

.auth-hero h1 {
  margin-bottom: 10px;
  font-size: 32px;
}

.auth-hero p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.screen {
  display: none;
  height: min(860px, calc(100vh - 40px));
  overflow-y: auto;
  padding: 24px 18px 98px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.screen::-webkit-scrollbar {
  display: none;
}

.screen.is-active {
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
  line-height: 1.25;
}

h3 {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.35;
}

.icon-button,
.text-button,
.tab,
.close-button {
  border: 0;
  background: transparent;
  color: inherit;
}

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #20242c;
  color: #f1c84b;
}

.banner-carousel {
  position: relative;
  margin-bottom: 4px;
}

.banner-rail {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.banner-rail::-webkit-scrollbar {
  display: none;
}

.hero-banner {
  flex: 0 0 100%;
  position: relative;
  min-height: 168px;
  overflow: hidden;
  border-radius: 8px;
  color: #fff;
  scroll-snap-align: start;
  cursor: pointer;
}

.banner-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  display: flex;
  gap: 7px;
  transform: translateX(-50%);
}

.banner-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
}

.banner-dot.is-active {
  background: #fff;
}

.hero-banner::before {
  content: "";
  position: absolute;
  inset: 18px 20px auto auto;
  width: 86px;
  height: 86px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 25% 25%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 75% 25%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 50% 50%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 25% 75%, #fff 0 5px, transparent 6px),
    radial-gradient(circle at 75% 75%, #fff 0 5px, transparent 6px),
    rgba(255, 255, 255, 0.22);
  transform: rotate(10deg);
}

.hero-banner div {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
}

.hero-banner p,
.hero-banner span {
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.hero-banner h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.banner-red {
  background: linear-gradient(135deg, #8f2525, var(--red));
}

.banner-green {
  background: linear-gradient(135deg, #0f5d48, var(--green));
}

.banner-blue {
  background: linear-gradient(135deg, #173c78, var(--blue));
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
}

.text-button {
  color: var(--blue);
  font-weight: 700;
}

.news-list,
.vote-list,
.community-list,
.post-list,
.vip-guide-list {
  display: grid;
  gap: 10px;
}

.news-item,
.vote-card,
.community-card,
.community-hero,
.post-composer,
.post-card,
.profile-card,
.account-settings-card,
.empty-state,
.vip-intro,
.vip-open-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.news-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  padding: 10px;
  cursor: pointer;
}

.news-item p,
.vote-card p,
.community-card p,
.community-hero p,
.post-card p,
.account-settings-card p,
.empty-state p,
.vip-intro p,
.vip-open-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.news-thumb {
  min-height: 70px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95) 0 6px, transparent 7px),
    radial-gradient(circle at 70% 70%, rgba(255, 255, 255, 0.95) 0 6px, transparent 7px),
    var(--blue);
}

.thumb-red {
  background-color: var(--red);
}

.thumb-green {
  background-color: var(--gold);
}

.thumb-blue {
  background-color: var(--blue);
}

.vote-list {
  margin-bottom: 16px;
}

.vote-card {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.vote-card h2 {
  margin-bottom: 2px;
}

.vote-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.source {
  border-radius: 999px;
  padding: 5px 9px;
  font-weight: 800;
}

.official {
  background: rgba(37, 99, 184, 0.12);
  color: #174a91;
}

.player {
  background: rgba(31, 143, 104, 0.12);
  color: #116246;
}

.vote-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 0 12px;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.vote-option span {
  color: var(--blue);
}

.community-list {
  gap: 12px;
}

.community-card {
  display: grid;
  grid-template-columns: 54px 1fr 64px;
  gap: 12px;
  align-items: center;
  padding: 12px;
}

.community-card.is-joined {
  border-color: rgba(31, 143, 104, 0.42);
}

.community-detail {
  display: none;
}

.community-detail.is-active {
  display: block;
  padding-top: 8px;
}

.community-list.is-hidden {
  display: none;
}

.screen[data-screen="community"] .topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  margin: -24px -18px 18px;
  padding: 14px 18px 8px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
}

.screen[data-screen="community"] .topbar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -80px;
  height: 80px;
  background: #f7f8fa;
}

.community-topbar {
  min-height: 64px;
}

.screen[data-screen="community"] .topbar .eyebrow {
  margin-bottom: 2px;
  font-size: 10px;
}

.screen[data-screen="community"] .topbar h1 {
  font-size: 22px;
}

.back-community {
  display: none;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  background: #20242c;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.screen[data-screen="community"].is-in-detail .back-community {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.community-hero {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  scroll-margin-top: 86px;
}

.community-hero h2 {
  margin-bottom: 6px;
}

.post-composer {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
}

.post-composer-fields {
  display: none;
  gap: 10px;
}

.post-composer.is-open .post-composer-fields {
  display: grid;
}

.post-composer.is-open #openPostComposerButton {
  background: #eef1f3;
  color: var(--ink);
}

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

.field-head label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.post-composer input,
.post-composer textarea,
.reply-composer textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}

.post-card {
  padding: 14px;
  cursor: pointer;
}

.post-card h3 {
  margin-bottom: 6px;
  font-size: 16px;
}

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

.post-head {
  margin-bottom: 8px;
}

.post-head strong {
  display: none;
}


.post-head span,
.post-actions {
  color: var(--muted);
  font-size: 12px;
}

.post-actions {
  justify-content: flex-start;
  margin-top: 10px;
}

.reply-link {
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

.post-detail {
  display: none;
}

.post-detail.is-active {
  display: block;
  padding-bottom: 92px;
}

.community-detail.is-reading .post-composer,
.community-detail.is-reading > .section-head,
.community-detail.is-reading > .post-list {
  display: none;
}

.back-post-list {
  position: sticky;
  top: 61px;
  z-index: 39;
  display: flex;
  align-items: center;
  width: calc(100% + 36px);
  min-height: 44px;
  margin: 0 -18px 14px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #f7f8fa;
  box-shadow: none;
}


.like-button {
  position: absolute;
  top: 14px;
  right: 14px;
  min-width: 64px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.like-button.is-liked {
  border-color: rgba(217, 66, 66, 0.22);
  background: rgba(217, 66, 66, 0.1);
  color: var(--red);
}

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

.reply-card,
.reply-composer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.reply-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.reply-card p {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
}

.reply-composer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 82px;
  z-index: 5;
  display: grid;
  gap: 10px;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.reply-fields {
  display: none;
  gap: 10px;
}

.reply-composer.is-open .reply-fields {
  display: grid;
}


.join-button {
  min-height: 38px;
}

.join-button:disabled {
  color: var(--muted);
  background: #f1f3f5;
}

.primary-button,
.secondary-button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.primary-button {
  background: #20242c;
  color: #fff;
}

.secondary-button {
  border: 1px solid var(--line);
  background: #fff;
  color: #20242c;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
}

.auth-card {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.auth-tab {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.auth-tab.is-active {
  border-color: #20242c;
  background: #20242c;
  color: #fff;
}

.auth-form,
.register-only,
.register-code-only,
.reset-only,
.account-form {
  display: grid;
  gap: 10px;
}

.auth-form label,
.account-form label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.auth-form input,
.account-form input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
}

.code-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  gap: 8px;
}

.code-row .secondary-button {
  min-height: 44px;
  padding: 0 10px;
  white-space: nowrap;
}

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

.register-only {
  display: none;
}

.auth-card.is-register .register-only {
  display: grid;
}

.register-code-only {
  display: none;
}

.auth-card.is-register .register-code-only {
  display: grid;
}

.reset-only {
  display: none;
}

.auth-card.is-reset .reset-only {
  display: grid;
}

.auth-card.is-register .login-only,
.auth-card.is-reset .login-only {
  display: none;
}

.forgot-password-button {
  justify-self: end;
  padding: 0;
  font-size: 13px;
}

.logout-button {
  display: none;
}

body.is-logged-in .logout-button {
  display: block;
}

.account-settings-card {
  display: none;
  margin-top: 14px;
  padding: 18px;
}

body.is-logged-in .account-settings-card {
  display: block;
}

.account-settings-card h2 {
  margin-bottom: 10px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: #20242c;
  color: #fff;
  font-weight: 900;
}

.empty-state {
  margin-top: 12px;
  padding: 18px;
  border-style: dashed;
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
}

.vip-intro {
  padding: 16px;
  margin-bottom: 14px;
}

.vip-intro strong {
  display: block;
  margin-bottom: 8px;
}

.vip-carousel {
  min-height: 142px;
}

.vip-banner {
  min-height: 142px;
  border-radius: 8px;
  padding: 18px;
  color: #fff;
}

.vip-banner p,
.vip-banner span {
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.vip-banner h2 {
  margin: 26px 0 8px;
  font-size: 24px;
}

.vip-pill,
.lock-badge {
  border-radius: 999px;
  background: rgba(214, 155, 34, 0.14);
  color: #8a5e0c;
  font-size: 12px;
  font-weight: 800;
}

.vip-pill {
  padding: 6px 10px;
}

.vip-locked {
  grid-template-columns: 76px 1fr 42px;
  align-items: center;
}

.lock-badge {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 26px;
}

.vip-open-card {
  margin-top: 14px;
  padding: 18px;
}

.vip-open-card h2 {
  margin-bottom: 8px;
}

.vip-plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 12px;
  padding: 12px;
  border-radius: 8px;
  background: #f5f6f8;
}

.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 10px 14px max(10px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.tab {
  min-height: 48px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.tab.is-active {
  background: #20242c;
  color: #fff;
}

.sheet {
  width: min(390px, calc(100% - 32px));
  border: 0;
  border-radius: 12px;
  padding: 24px;
  color: var(--ink);
  box-shadow: var(--shadow);
}

.sheet::backdrop {
  background: rgba(14, 18, 24, 0.48);
}

.close-button {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 24px;
}

.full {
  width: 100%;
  margin-top: 10px;
}

@media (max-width: 520px) {
  body {
    display: block;
    padding: 0;
  }

  .phone-shell {
    width: 100%;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .screen {
    height: 100vh;
  }
}

.home-news-detail,
.vote-detail {
  display: none;
}

.home-news-detail.is-active,
.vote-detail.is-active {
  display: block;
}

.screen.is-reading-news > .topbar,
.screen.is-reading-news > .banner-carousel,
.screen.is-reading-news > .section-head,
.screen.is-reading-news > .news-list,
.screen.is-reading-vote > .topbar,
.screen.is-reading-vote > .vip-intro,
.screen.is-reading-vote > .vote-list,
.screen.is-reading-vote > #createVoteButton {
  display: none;
}


.back-news-list,
.back-vote-list {
  margin: 12px 0;
  padding: 0;
}

.vote-card {
  cursor: pointer;
}

.vote-actions {
  gap: 14px;
}


.vote-detail-options {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

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

.vote-detail.is-active {
  padding-bottom: 92px;
}

.vote-reply-composer {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 82px;
  z-index: 5;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.16);
}

.vote-reply-fields {
  display: none;
  gap: 10px;
}

.vote-reply-composer.is-open .vote-reply-fields {
  display: grid;
}

.vote-reply-composer textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  color: var(--ink);
}


/* Detail pages are full-page reading surfaces, not feed cards. */
.news-detail-page,
.vote-detail-main,
.post-detail-main {
  position: relative;
  padding: 2px 0 18px;
  border: 0;
  background: transparent;
  cursor: default;
}

.news-detail-page,
.vote-detail-main {
  border-bottom: 1px solid var(--line);
}

.news-detail-page h2,
.vote-detail-main h2,
.post-detail-main h3 {
  margin: 8px 0 10px;
  font-size: 22px;
  line-height: 1.28;
}

.news-detail-page p:not(.eyebrow),
.post-detail-main p,
.vote-detail-main p {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.7;
}

.vote-detail-main,
.post-detail-main {
  padding-right: 0;
}

.vote-detail-main .vote-meta,
.post-detail-main .post-head {
  padding-right: 72px;
}

.vote-detail-main h2,
.post-detail-main h3 {
  padding-right: 88px;
}

.vote-detail-main .like-button,
.post-detail-main .like-button {
  top: 0;
  right: 0;
}

.game-art,
.image-fantasy,
.image-shooter,
.image-moba,
.image-racing {
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-color: #20242c;
}

.image-fantasy {
  background-image: url("./assets/game-open-world.png");
}

.image-shooter {
  background-image: url("./assets/game-tactical-shooter.png");
}

.image-moba {
  background-image: url("./assets/game-moba-arena.png");
}

.image-racing {
  background-image: url("./assets/game-neon-racing.png");
}

.hero-banner.image-fantasy::after,
.hero-banner.image-shooter::after,
.hero-banner.image-moba::after,
.hero-banner.image-racing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.68));
}

.hero-banner.image-fantasy::before,
.hero-banner.image-shooter::before,
.hero-banner.image-moba::before,
.hero-banner.image-racing::before {
  display: none;
}

.hero-banner div {
  z-index: 1;
}

.news-thumb {
  background-size: cover;
}

.detail-image,
.vote-cover,
.post-image {
  width: 100%;
  border-radius: 8px;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #20242c;
}

.detail-image {
  aspect-ratio: 16 / 9;
  margin: 12px 0 14px;
}

.vote-cover {
  aspect-ratio: 16 / 9;
  margin: 4px 0 2px;
}

.post-image {
  aspect-ratio: 16 / 9;
  margin: 10px 0;
}

.community-cover {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background-size: cover;
  background-repeat: no-repeat;
  background-color: #20242c;
}
