:root {
  color-scheme: dark;
  --bg: #070914;
  --surface: rgba(20, 22, 45, .82);
  --surface-strong: #14162d;
  --text: #f8f7ff;
  --muted: #aaaec7;
  --line: rgba(255, 255, 255, .12);
  --violet: #a855f7;
  --blue: #38bdf8;
  --green: #34d399;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 14% 16%, rgba(168, 85, 247, .2), transparent 31rem),
    radial-gradient(circle at 88% 26%, rgba(56, 189, 248, .14), transparent 29rem),
    linear-gradient(180deg, #0a0c1c 0%, var(--bg) 75%);
  color: var(--text);
}

a { color: #8bdcff; text-underline-offset: 3px; }
button, input, textarea { font: inherit; }
.hidden { display: none !important; }

.aura {
  position: fixed;
  z-index: -1;
  width: 20rem;
  height: 20rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .18;
  pointer-events: none;
}
.aura-uno { top: 12%; left: -8rem; background: var(--violet); }
.aura-dos { right: -8rem; bottom: 5%; background: var(--blue); }

.topbar {
  width: min(calc(100% - 2rem), 1120px);
  min-height: 74px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .72rem;
  color: var(--text);
  font-weight: 850;
  text-decoration: none;
}
.brand img { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 0 30px rgba(168, 85, 247, .28); }
.top-link { padding: .55rem .85rem; border: 1px solid var(--line); border-radius: 999px; color: #d8dcf0; font-size: .82rem; font-weight: 800; text-decoration: none; }
.top-link:hover { border-color: rgba(125, 211, 252, .45); color: #fff; }

.shell { width: min(calc(100% - 2rem), 1120px); min-height: calc(100vh - 150px); margin: auto; padding: 1rem 0 2.5rem; }
.login-grid { display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(320px, .86fr); align-items: center; gap: clamp(2rem, 6vw, 5.5rem); }
.eyebrow { color: #c4b5fd; font-size: .75rem; font-weight: 900; letter-spacing: .16em; }
.intro h1 { max-width: 700px; margin: .9rem 0 1.1rem; font-size: clamp(3rem, 7.4vw, 6.2rem); line-height: .96; letter-spacing: -.065em; }
.intro h1 span { background: linear-gradient(95deg, #e9d5ff, #7dd3fc); background-clip: text; -webkit-background-clip: text; color: transparent; }
.lead { max-width: 650px; margin: 0; color: var(--muted); font-size: clamp(1.02rem, 2vw, 1.22rem); line-height: 1.62; }
.steps { margin-top: 2rem; display: grid; gap: .72rem; }
.steps div { display: flex; align-items: center; gap: .85rem; color: #d5d7e5; }
.steps b { width: 31px; height: 31px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 10px; background: rgba(168, 85, 247, .14); color: #e9d5ff; }

.panel { border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: 0 32px 100px rgba(0, 0, 0, .28); backdrop-filter: blur(18px); }
.compact { width: min(100%, 430px); margin: 10vh auto 0; padding: 2rem; text-align: center; color: var(--muted); }
.spinner { width: 40px; height: 40px; margin: auto; border: 3px solid rgba(255, 255, 255, .12); border-top-color: var(--violet); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.login-card { padding: clamp(1.5rem, 4vw, 2.4rem); }
.hero-logo { width: 74px; height: 74px; border-radius: 22px; box-shadow: 0 0 38px rgba(168, 85, 247, .32); }
.login-card h2 { margin: 1.1rem 0 .4rem; font-size: 1.75rem; letter-spacing: -.025em; }
.login-card > p { margin: 0; color: var(--muted); line-height: 1.55; }
.terms-check { margin: 1.5rem 0 1.1rem; display: flex; gap: .72rem; align-items: flex-start; color: #d1d3e2; font-size: .9rem; line-height: 1.45; cursor: pointer; }
.terms-check input { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--violet); flex: 0 0 auto; }
.google-wrap { min-height: 68px; padding: .75rem; display: grid; place-items: center; border: 1px solid transparent; border-radius: 15px; background: rgba(255, 255, 255, .035); transition: .2s ease; }
.google-wrap.disabled { border-color: rgba(255, 255, 255, .08); }
#googleHint { margin: 0; color: #8f93ac; font-size: .84rem; }
.status { min-height: 1.4rem; margin-top: .8rem !important; font-size: .88rem; }
.status.error { color: #fda4af; }
.status.success { color: #6ee7b7; }

.profile-setup { width: min(100%, 560px); margin: 2vh auto 0; padding: clamp(1.5rem, 5vw, 2.7rem); }
.profile-setup h1 { margin: .55rem 0 .65rem; font-size: clamp(2rem, 7vw, 3.2rem); letter-spacing: -.045em; }
.profile-setup > p:not(.eyebrow) { max-width: 500px; color: var(--muted); line-height: 1.6; }
.profile-setup form { margin-top: 1.5rem; }
.profile-setup small, form > small { display: block; margin-top: .48rem; color: #8f93ac; line-height: 1.45; }
.form-label { display: block; margin: 1rem 0 .48rem; color: #e4e4ef; font-size: .85rem; font-weight: 800; }
.alias-input { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: rgba(4, 6, 18, .68); }
.alias-input:focus-within { border-color: rgba(168, 85, 247, .7); box-shadow: 0 0 0 3px rgba(168, 85, 247, .12); }
.alias-input span { padding-left: .9rem; color: #c4b5fd; font-weight: 900; }
.alias-input input { border: 0; background: transparent; box-shadow: none; }

input[type="text"], input[type="search"], input[type="file"], textarea {
  width: 100%;
  min-height: 46px;
  padding: .75rem .85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(4, 6, 18, .68);
  color: var(--text);
}
input:focus, textarea:focus { border-color: rgba(168, 85, 247, .72); box-shadow: 0 0 0 3px rgba(168, 85, 247, .12); }
textarea { resize: vertical; line-height: 1.5; }
input[type="file"] { padding: .6rem; color: #c9cbda; }
input[type="file"]::file-selector-button { margin-right: .7rem; padding: .48rem .68rem; border: 0; border-radius: 8px; background: #262947; color: #fff; font-weight: 750; cursor: pointer; }

.dashboard { display: grid; gap: 1rem; }
.profile { padding: clamp(1.2rem, 3vw, 1.8rem); display: flex; align-items: center; gap: 1.1rem; }
.avatar { width: 76px; height: 76px; flex: 0 0 auto; border-radius: 22px; object-fit: cover; background: var(--surface-strong); }
.profile-copy { min-width: 0; flex: 1; }
.profile-copy h1 { margin: .28rem 0 .1rem; overflow: hidden; font-size: clamp(1.55rem, 4vw, 2.2rem); text-overflow: ellipsis; white-space: nowrap; }
.profile-copy p { margin: 0; color: #c4b5fd; }
.online { color: #6ee7b7; font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.online i { width: 7px; height: 7px; display: inline-block; margin-right: .35rem; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px var(--green); }
.ghost-button, .primary-button, .secondary-button, .danger-button { min-height: 44px; padding: .68rem 1rem; border-radius: 12px; color: var(--text); font-weight: 800; cursor: pointer; }
.ghost-button { border: 1px solid var(--line); background: rgba(255, 255, 255, .04); }
.primary-button { border: 0; background: linear-gradient(110deg, var(--violet), #2563eb); }
.secondary-button { border: 1px solid rgba(125, 211, 252, .3); background: rgba(56, 189, 248, .08); }
.danger-button { border: 1px solid rgba(251, 113, 133, .38); background: rgba(225, 29, 72, .1); color: #fecdd3; }
.primary-button:disabled { opacity: .52; cursor: not-allowed; }
.secondary-button:disabled, .ghost-button:disabled, .danger-button:disabled { opacity: .5; cursor: not-allowed; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.metric { padding: 1.4rem; }
.metric span { color: var(--muted); font-size: .86rem; }
.metric strong { display: block; margin: .2rem 0; font-size: 2.7rem; }
.metric small { color: #898da7; }
.next-step { padding: clamp(1.35rem, 4vw, 2rem); display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.next-step h2 { margin: .5rem 0 .4rem; font-size: clamp(1.4rem, 4vw, 2rem); }
.next-step p { margin: 0; color: var(--muted); }

.action-banner { padding: clamp(1.35rem, 4vw, 2rem); display: flex; justify-content: space-between; align-items: center; gap: 1.5rem; }
.action-banner h2 { margin: .5rem 0 .4rem; font-size: clamp(1.4rem, 4vw, 2rem); }
.action-banner p { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.5; }
.module { padding: clamp(1.15rem, 3.5vw, 1.8rem); }
.section-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.section-header h2 { margin: .35rem 0 1rem; font-size: clamp(1.3rem, 3vw, 1.75rem); }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .04); color: #fff; font-size: 1.7rem; cursor: pointer; }
.search-row { display: grid; grid-template-columns: 1fr auto; gap: .65rem; }
.user-results { display: grid; gap: .55rem; }
.user-row { display: flex; align-items: center; gap: .75rem; padding: .75rem; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 255, 255, .025); }
.mini-avatar { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.user-row strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row button, .selected-user button, .text-button { border: 0; background: transparent; color: #8bdcff; font-weight: 800; cursor: pointer; }
.selected-user { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.2rem; padding: .85rem; border: 1px solid rgba(168, 85, 247, .26); border-radius: 13px; background: rgba(168, 85, 247, .07); }
.selected-user span { color: var(--muted); font-size: .8rem; }
.selected-user strong { flex: 1; }
.progress { position: relative; height: 28px; margin: .8rem 0; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.progress i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--violet), #2563eb); transition: width .2s ease; }
.progress span { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; font-size: .75rem; font-weight: 900; }
.duel-list { display: grid; gap: .75rem; }
.duel-card { padding: 1rem; border: 1px solid var(--line); border-radius: 16px; background: rgba(5, 7, 20, .5); }
.duel-card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.duel-card h3 { margin: 0 0 .28rem; font-size: 1.05rem; }
.duel-card p { margin: .25rem 0; color: var(--muted); line-height: 1.45; }
.duel-card small { color: #898da7; }
.duel-badge { flex: 0 0 auto; padding: .3rem .5rem; border: 1px solid rgba(52, 211, 153, .22); border-radius: 999px; color: #6ee7b7; font-size: .68rem; font-weight: 850; letter-spacing: .08em; }
.duel-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: .9rem; }
.duel-actions input[type="file"] { flex: 1 1 260px; }
.duel-actions .primary-button, .duel-actions .secondary-button, .duel-actions .ghost-button, .duel-actions .danger-button { min-height: 40px; padding: .55rem .75rem; }
.card-status { min-height: 1.2rem; margin: .6rem 0 0 !important; font-size: .82rem; }
.empty { margin: 0; padding: 1rem; border: 1px dashed var(--line); border-radius: 14px; color: #898da7; text-align: center; }
.privacy-note { padding: .65rem .75rem; border-left: 3px solid #38bdf8; border-radius: 0 9px 9px 0; background: rgba(56, 189, 248, .07); color: #b8dff1 !important; font-size: .82rem; }

.community-feed { margin: 0 0 1.35rem; }
.feed-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .4rem; }
.feed-heading h2 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.035em; }
.feed-heading button { flex: 0 0 auto; }
.feed-heading .secondary-button { min-height: 38px; padding: .48rem .72rem; font-size: .8rem; }
.feed-status { min-height: 1rem; margin: 0 0 .4rem; color: #8f93ac; font-size: .75rem; }
.feed-status:empty { display: none; }
.feed-list {
  padding: 0;
}
.feed-duel {
  width: min(100%, 800px);
  margin: 0 auto 1rem;
  padding: clamp(.65rem, 2vw, .9rem);
  border-radius: 18px;
  background: rgba(10, 12, 30, .78);
  box-shadow: none;
  backdrop-filter: none;
}
.feed-duel-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: .45rem; padding: .1rem .15rem; }
.feed-duel-header h3 { margin: .18rem 0 .12rem; font-size: clamp(1.05rem, 2.4vw, 1.35rem); }
.feed-duel-header p { margin: 0; color: #c4b5fd; }
.feed-live { color: #6ee7b7; font-size: .68rem; font-weight: 900; letter-spacing: .12em; }
.feed-share-wrap { min-width: 86px; text-align: right; }
.feed-share { padding: .48rem .7rem; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .04); color: #fff; font-size: .76rem; font-weight: 800; cursor: pointer; }
.feed-share-status { display: block; min-height: 1rem; margin-top: .3rem; color: #6ee7b7; font-size: .68rem; }
.feed-carousel-nav { display: flex; justify-content: center; gap: .4rem; margin: 0 0 .45rem; }
.feed-carousel-dot { width: 31px; height: 27px; padding: 0; border: 1px solid rgba(255, 255, 255, .13); border-radius: 999px; background: rgba(255, 255, 255, .04); color: #9296ad; font-size: .72rem; font-weight: 900; cursor: pointer; }
.feed-carousel-dot.active { width: 43px; border-color: rgba(168, 85, 247, .55); background: rgba(168, 85, 247, .18); color: #fff; }
.feed-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-x pan-y;
  border-radius: 14px;
  background: #000;
}
.feed-carousel::-webkit-scrollbar { display: none; }
.feed-slide { position: relative; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.feed-slide-label {
  position: absolute;
  z-index: 3;
  top: .65rem;
  right: .65rem;
  left: .65rem;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 35px;
  padding: .42rem .58rem;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 11px;
  background: rgba(3, 5, 15, .72);
  box-shadow: 0 7px 25px rgba(0, 0, 0, .3);
  font-size: .73rem;
  touch-action: pan-x;
}
.feed-slide-label > span:first-child { color: #c4b5fd; font-weight: 900; }
.feed-slide-label strong { min-width: 0; overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.feed-swipe-hint { color: #fff; font-weight: 850; }
.feed-player { height: clamp(340px, 66svh, 640px); overflow: hidden; border: 0; border-radius: 14px; background: #000; }
.feed-player iframe { width: 100%; height: 100%; border: 0; background: #000; }
.feed-vote-panel { min-height: clamp(340px, 66svh, 640px); padding: 4.3rem clamp(1rem, 6vw, 3.5rem) 1.4rem; display: grid; align-content: center; background: radial-gradient(circle at 50% 30%, rgba(168, 85, 247, .2), transparent 55%), #080a18; }
.feed-vote-panel h4 { margin: 0 0 .35rem; font-size: clamp(1.35rem, 4vw, 2rem); text-align: center; }
.feed-watch-status { margin: .35rem 0 1rem; color: #aeb2c9; font-size: .82rem; text-align: center; }
.feed-vote-area { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.feed-vote-button { min-height: 47px; padding: .7rem; overflow: hidden; border: 0; border-radius: 12px; background: linear-gradient(110deg, rgba(168, 85, 247, .9), rgba(37, 99, 235, .9)); color: #fff; font-weight: 850; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.feed-vote-button:nth-child(2) { background: linear-gradient(110deg, rgba(14, 165, 233, .9), rgba(37, 99, 235, .9)); }
.feed-vote-button:disabled { opacity: .42; cursor: not-allowed; }
.feed-vote-status { min-height: 1.25rem; margin: .65rem 0 .15rem; color: #aeb2c9; font-size: .8rem; text-align: center; }
.feed-results { display: grid; gap: .65rem; margin-top: .8rem; padding-top: .8rem; border-top: 1px solid var(--line); }
.feed-result-row { padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .025); }
.feed-result-row.selected { border-color: rgba(52, 211, 153, .38); }
.feed-result-label { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem; font-size: .8rem; }
.feed-result-label span { color: #9ca0b8; }
.feed-result-track { height: 8px; overflow: hidden; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.feed-result-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--violet), var(--blue)); transition: width .35s ease; }
.feed-total-votes { margin: 0; color: #8f93ac; font-size: .76rem; text-align: center; }
.feed-pending { min-height: 340px; display: grid; place-content: center; justify-items: center; padding: 2rem; border: 1px dashed rgba(125, 211, 252, .25); border-radius: 18px; background: radial-gradient(circle, rgba(56, 189, 248, .08), transparent 62%); text-align: center; }
.feed-pending-icon { width: 60px; height: 60px; display: grid; place-items: center; border-radius: 18px; background: rgba(56, 189, 248, .1); color: #7dd3fc; font-size: 1.8rem; }
.feed-pending h3 { margin: 1rem 0 .45rem; }
.feed-pending p { max-width: 470px; margin: 0; color: var(--muted); line-height: 1.55; }
.feed-empty { width: min(100%, 800px); margin: auto; padding: 3rem 1.5rem; color: #9ca0b8; text-align: center; }

footer { width: min(calc(100% - 2rem), 1120px); margin: auto; padding: 1.3rem 0 2rem; display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid var(--line); color: #82869d; font-size: .82rem; }
footer a { color: #9fa3ba; }

@media (max-width: 820px) {
  .shell { padding-top: .8rem; }
  .login-grid { grid-template-columns: 1fr; }
  .intro h1 { font-size: clamp(3rem, 14vw, 5rem); }
  .login-card { max-width: 560px; }
}

@media (max-width: 560px) {
  .topbar, .shell, footer { width: min(calc(100% - 1.2rem), 1120px); }
  .topbar { min-height: 66px; }
  .brand img { width: 38px; height: 38px; }
  .intro h1 { font-size: clamp(2.8rem, 15vw, 4.3rem); }
  .lead { font-size: 1rem; }
  .profile { align-items: flex-start; flex-wrap: wrap; }
  .avatar { width: 64px; height: 64px; border-radius: 18px; }
  .ghost-button { width: 100%; }
  .metrics { grid-template-columns: 1fr; }
  .next-step, .action-banner { align-items: stretch; flex-direction: column; }
  .action-banner .primary-button { width: 100%; }
  .search-row { grid-template-columns: 1fr; }
  .search-row button { width: 100%; }
  .selected-user { align-items: flex-start; flex-wrap: wrap; }
  .selected-user strong { flex-basis: 65%; }
  .duel-card-head { flex-direction: column; }
  .duel-actions > button { flex: 1; }
  .community-feed { margin-top: .2rem; }
  .feed-heading h2 { font-size: 1.35rem; }
  .feed-duel { margin-bottom: .65rem; border-radius: 18px; }
  .feed-duel-header { align-items: flex-start; }
  .feed-player { height: clamp(410px, 68svh, 620px); }
  .feed-vote-panel { min-height: clamp(410px, 68svh, 620px); }
  .feed-slide-label { top: .5rem; right: .5rem; left: .5rem; }
  .feed-vote-button { font-size: .82rem; }
  .feed-result-label { align-items: flex-start; flex-direction: column; gap: .18rem; }
  .feed-pending { min-height: 320px; }
  footer { flex-direction: column; }
}
