:root {
    color-scheme: dark;
    --bg: rgb(8, 13, 23);
    --panel: rgb(17, 24, 39);
    --panel-2: rgb(24, 33, 50);
    --line: rgba(255,255,255,.1);
    --text: rgb(241, 245, 249);
    --muted: rgb(148, 163, 184);
    --green: rgb(34, 197, 94);
    --cyan: rgb(56, 189, 248);
}
* { box-sizing: border-box; }
body.app-body { min-height: 100vh; background: radial-gradient(circle at top left, rgba(34,197,94,.12), transparent 36rem), var(--bg); color: var(--text); }
a { color: var(--cyan); text-decoration: none; }
.glass-nav { background: rgba(8,13,23,.86); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); }
.brand-logo { width: 32px; height: 32px; object-fit: contain; margin-right: .5rem; }
.hero-band { min-height: 320px; display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: clamp(1.5rem, 4vw, 3rem); background: linear-gradient(135deg, rgba(34,197,94,.18), rgba(56,189,248,.1)), url('../img/logo.png') right 2rem center / 220px no-repeat, rgb(12,18,31); }
.hero-band h1 { font-size: clamp(2.2rem, 6vw, 5rem); font-weight: 800; letter-spacing: 0; }
.hero-band p { max-width: 620px; color: var(--muted); font-size: 1.15rem; }
.eyebrow { color: var(--green); text-transform: uppercase; font-weight: 700; font-size: .8rem; letter-spacing: .08em; }
.raffle-card, .surface, .auth-card, .metric-card, .empty-state { background: rgba(17,24,39,.9); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.raffle-card { padding: 1.25rem; }
.auth-card { max-width: 460px; padding: 1.5rem; }
.empty-state { padding: 2rem; text-align: center; color: var(--muted); }
.keyword-badge { display: inline-flex; align-items: center; justify-content: center; background: rgba(34,197,94,.14); color: rgb(134,239,172); border: 1px solid rgba(34,197,94,.32); border-radius: 8px; padding: .55rem .8rem; font-weight: 800; font-size: 1.1rem; }
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; color: var(--muted); }
.stat-grid span { background: rgba(255,255,255,.04); border-radius: 8px; padding: .7rem; min-height: 48px; }
.metric-card { padding: 1rem; min-height: 110px; display: flex; flex-direction: column; justify-content: space-between; }
.metric-card span { color: var(--muted); }
.metric-card strong { font-size: 2rem; }
.form-control, .form-select { background: rgb(11,18,32); border-color: var(--line); color: var(--text); }
.form-control::placeholder { color: rgb(203,213,225); opacity: 1; }
.form-control::-webkit-input-placeholder { color: rgb(203,213,225); opacity: 1; }
.form-control::-moz-placeholder { color: rgb(203,213,225); opacity: 1; }
.form-control:focus, .form-select:focus { background: rgb(11,18,32); color: var(--text); border-color: var(--green); box-shadow: 0 0 0 .2rem rgba(34,197,94,.15); }
.room-layout { max-width: 980px; margin: 0 auto; padding-bottom: 86px; }
.room-header { position: sticky; top: 64px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; margin-bottom: 1rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(17,24,39,.95); backdrop-filter: blur(18px); }
.keyword-panel { text-align: right; }
.keyword-panel span { display: block; color: var(--muted); font-size: .85rem; }
.keyword-panel strong { font-size: 1.8rem; color: rgb(134,239,172); }
.chat-panel { height: 62vh; overflow: auto; padding: 1rem; border: 1px solid var(--line); border-radius: 8px; background: rgba(5,10,20,.74); }
.chat-message { display: flex; margin-bottom: .8rem; }
.chat-message.me { justify-content: flex-end; }
.bubble { max-width: min(76%, 720px); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; overflow-wrap: anywhere; }
.chat-message.me .bubble { background: rgba(34,197,94,.18); border-color: rgba(34,197,94,.32); }
.chat-message.system { justify-content: center; }
.system-badge { display: inline-flex; align-items: center; gap: .6rem; background: rgba(56,189,248,.14); border: 1px solid rgba(56,189,248,.32); color: rgb(224,242,254); border-radius: 8px; padding: .55rem .8rem; max-width: 92%; overflow-wrap: anywhere; }
.system-badge span { background: rgb(56,189,248); color: rgb(5,10,20); border-radius: 6px; padding: .2rem .45rem; font-size: .75rem; font-weight: 900; }
.meta { display: flex; gap: .6rem; flex-wrap: wrap; color: var(--muted); font-size: .8rem; margin-bottom: .25rem; }
.chat-composer { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(980px, calc(100% - 1rem)); display: flex; gap: .5rem; padding: .75rem; background: rgba(8,13,23,.96); border: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.list-row { display: flex; justify-content: space-between; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.list-row:last-child { border-bottom: 0; }
.table-dark { --bs-table-bg: transparent; }
@media (max-width: 700px) {
    .hero-band { min-height: 260px; background-size: 120px; background-position: right 1rem bottom 1rem; }
    .room-header { align-items: flex-start; flex-direction: column; top: 58px; }
    .keyword-panel { text-align: left; }
    .bubble { max-width: 92%; }
}
.glass-nav { min-height: 76px; }
.navbar-brand { display: inline-flex; align-items: center; gap: .65rem; font-size: 1.28rem; }
.brand-logo { width: 58px; height: 58px; margin-right: 0; filter: drop-shadow(0 10px 22px rgba(34,197,94,.25)); }
.hero-band { min-height: 360px; justify-content: space-between; gap: 1.5rem; background: linear-gradient(135deg, rgba(34,197,94,.2), rgba(56,189,248,.12) 52%, rgba(244,114,182,.1)), rgb(12,18,31); position: relative; overflow: hidden; }
.hero-band:after { content: ""; position: absolute; inset: auto -80px -120px auto; width: 340px; height: 340px; background: rgba(34,197,94,.14); border-radius: 50%; filter: blur(12px); }
.hero-content { position: relative; z-index: 1; }
.hero-logo { width: clamp(92px, 12vw, 150px); height: clamp(92px, 12vw, 150px); object-fit: contain; margin-bottom: 1rem; filter: drop-shadow(0 20px 34px rgba(0,0,0,.38)); }
.hero-band h1 { font-size: clamp(2.4rem, 7vw, 5.8rem); font-weight: 900; line-height: .95; margin-bottom: 1.25rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; }
.btn-ghost { border: 1px solid rgba(255,255,255,.18); color: var(--text); background: rgba(255,255,255,.06); }
.btn-ghost:hover { border-color: rgba(255,255,255,.32); color: var(--text); background: rgba(255,255,255,.1); }
.hero-scoreboard { position: relative; z-index: 1; display: grid; gap: .75rem; width: min(300px, 100%); }
.hero-scoreboard div { border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 1rem; background: rgba(5,10,20,.45); backdrop-filter: blur(14px); }
.hero-scoreboard span { display: block; color: var(--muted); }
.hero-scoreboard strong { font-size: 2.1rem; line-height: 1; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 1rem; align-items: start; }
.raffle-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.home-side { display: grid; gap: 1rem; position: sticky; top: 92px; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-title h2 { font-size: 1.25rem; margin: 0; }
.section-title span { color: var(--muted); font-size: .9rem; }
.section-title.compact { margin-bottom: .65rem; }
.raffle-card { position: relative; overflow: hidden; }
.raffle-card:before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--green), var(--cyan), rgb(244,114,182)); }
.raffle-card h3 { font-size: 1.35rem; margin-bottom: .75rem; }
.raffle-topline { display: inline-flex; align-items: center; gap: .45rem; color: rgb(134,239,172); font-size: .85rem; font-weight: 700; margin-bottom: .85rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(34,197,94,.13); }
.empty-mini { color: var(--muted); padding: .75rem 0; }
.leaderboard { display: grid; gap: .55rem; }
.leader-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) 44px; align-items: center; gap: .7rem; padding: .75rem; border-radius: 8px; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); }
.rank { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 8px; background: rgba(245,158,11,.18); color: rgb(253,230,138); font-weight: 900; }
.leader-row b, .winner-item span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-row small, .winner-item small { display: block; color: var(--muted); }
.leader-row strong { justify-self: end; color: rgb(134,239,172); font-size: 1.25rem; }
.winner-strip { display: grid; gap: .55rem; }
.winner-item { padding: .75rem; border-radius: 8px; background: linear-gradient(135deg, rgba(56,189,248,.1), rgba(245,158,11,.08)); border: 1px solid rgba(255,255,255,.08); }
@media (max-width: 1100px) {
    .home-grid { grid-template-columns: 1fr; }
    .home-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
    .raffle-grid, .home-side { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    .glass-nav { min-height: 68px; }
    .brand-logo { width: 46px; height: 46px; }
    .hero-band { min-height: 300px; align-items: flex-start; flex-direction: column; background-size: 0; }
    .hero-scoreboard { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
    .hero-scoreboard div { padding: .8rem; }
    .hero-scoreboard strong { font-size: 1.45rem; }
}
.hero-band { flex-direction: column; justify-content: center; text-align: center; }
.hero-content { display: flex; flex-direction: column; align-items: center; }
.hero-logo { width: clamp(120px, 15vw, 180px); height: clamp(120px, 15vw, 180px); }
.hero-band h1 { font-size: clamp(2rem, 5vw, 4.2rem); }
.hero-actions { justify-content: center; }
.hero-scoreboard { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(560px, 100%); }
.room-layout { max-width: 1180px; }
.room-content { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 1rem; align-items: start; }
.room-stats { padding: 1rem; position: sticky; top: 150px; }
.room-stat-circle { aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 1rem auto; width: min(190px, 100%); background: radial-gradient(circle, rgba(34,197,94,.18), rgba(56,189,248,.08)); border: 1px solid rgba(34,197,94,.28); box-shadow: inset 0 0 34px rgba(34,197,94,.08); }
.room-stat-circle strong { font-size: clamp(2rem, 5vw, 3rem); line-height: 1; color: rgb(134,239,172); }
.room-stat-circle span { color: var(--muted); margin-top: .45rem; }
.room-stat-list { display: grid; gap: .6rem; }
.room-stat-list div { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); background: rgba(255,255,255,.04); border-radius: 8px; padding: .75rem; }
.room-stat-list span { color: var(--muted); }
.room-stat-list b { font-size: 1.2rem; }
.winners-hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; background: linear-gradient(135deg, rgba(34,197,94,.16), rgba(56,189,248,.1), rgba(245,158,11,.1)); }
.winners-hero h1 { font-size: clamp(2.1rem, 6vw, 4.4rem); line-height: 1; margin: .35rem 0 0; font-weight: 900; }
.winner-hero-stats { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: .75rem; }
.winner-hero-stats div { background: rgba(5,10,20,.38); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.winner-hero-stats span { display: block; color: var(--muted); }
.winner-hero-stats strong { font-size: 2rem; }
.winner-grid-page { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.winner-card { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 1rem; align-items: center; background: rgba(17,24,39,.9); border: 1px solid var(--line); border-radius: 8px; padding: 1rem; box-shadow: 0 18px 50px rgba(0,0,0,.2); position: relative; overflow: hidden; }
.winner-card:before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, rgb(245,158,11), var(--green), var(--cyan)); }
.winner-medal { width: 54px; height: 54px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: rgba(245,158,11,.16); color: rgb(253,230,138); font-weight: 900; font-size: 1.25rem; }
.winner-card-body { min-width: 0; }
.winner-draw { color: var(--muted); font-size: .9rem; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-card h2 { margin: .2rem 0 .55rem; font-size: 1.25rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.winner-meta { display: flex; flex-wrap: wrap; gap: .5rem; color: var(--muted); font-size: .85rem; }
.winner-meta span { border: 1px solid rgba(255,255,255,.08); border-radius: 8px; padding: .28rem .5rem; background: rgba(255,255,255,.04); }
@media (max-width: 1100px) {
    .winner-grid-page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .room-content { grid-template-columns: 1fr; }
    .room-stats { position: static; }
}
@media (max-width: 700px) {
    .hero-band { align-items: center; }
    .winners-hero { flex-direction: column; align-items: stretch; }
    .winner-grid-page { grid-template-columns: 1fr; }
    .winner-hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
