:root {
  --bg: #14110e; --soot: #1c1814; --stone: #26211b; --stone-2: #332c24; --line: #473e33;
  --amber: #d9822b; --amber-d: #a85f17; --ember: #f0a04b; --text: #e8e0d4; --muted: #a89c8a;
  --danger: #c4524a; --radius: 14px; --t: all .25s cubic-bezier(.4, 0, .2, 1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; overflow-x: hidden; }
button { font-family: inherit; color: inherit; }
[hidden] { display: none !important; }

.home-button { position: absolute; top: 24px; left: 24px; display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 13px; opacity: .6; transition: var(--t); z-index: 2000; text-transform: uppercase; letter-spacing: .05em; }
.home-button:hover { opacity: 1; transform: translateX(-5px); }
.home-button svg { transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.home-button:hover svg { transform: scale(1.1); }

.bg-animation { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-animation > div { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .35; animation: float 22s ease-in-out infinite; }
.blob-1 { width: 480px; height: 480px; background: #5a4a36; top: -12%; left: -10%; }
.blob-2 { width: 420px; height: 420px; background: var(--amber-d); bottom: -12%; right: -10%; animation-delay: 7s; opacity: .22 !important; }
.blob-3 { width: 380px; height: 380px; background: #2b2723; top: 45%; left: 45%; animation-delay: 13s; }
@keyframes float { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(30px, -40px) scale(1.08); } }

.container { max-width: 620px; margin: 0 auto; padding: 20px; position: relative; z-index: 1; display: flex; flex-direction: column; gap: 18px; }
.header { padding: 56px 0 8px; text-align: center; }
.logo { display: flex; align-items: center; justify-content: center; gap: 14px; }
.logo-icon { font-size: 54px; filter: drop-shadow(0 0 14px rgba(240,160,75,.5)); }
.header h1 { font-size: 46px; font-weight: 800; letter-spacing: -1px; }
.subtitle { color: var(--muted); margin-top: 8px; }

.animate-up { animation: up .6s ease-out both; }
.animate-up-2 { animation: up .6s ease-out .12s both; }
@keyframes up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.gs-tabs { display: flex; gap: 10px; }
.gs-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 14px; background: var(--soot); border: 1px solid var(--line); border-radius: var(--radius); font-weight: 600; cursor: pointer; transition: var(--t); position: relative; }
.gs-tab:hover { border-color: var(--amber-d); }
.gs-tab.active { background: var(--stone-2); border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber) inset; }

.gs-options { background: var(--soot); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.gq-option-label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; display: block; }
.gs-name-row { display: flex; flex-direction: column; }
.gs-name-input, .gs-room-input { width: 100%; padding: 13px 14px; background: var(--stone); border: 1px solid var(--line); border-radius: 10px; color: var(--text); font: inherit; font-size: 16px; transition: var(--t); }
.gs-room-input { text-align: center; font-weight: 700; letter-spacing: 4px; text-transform: uppercase; }
.gs-name-input:focus, .gs-room-input:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(217,130,43,.18); }

.gs-subtabs { display: flex; gap: 8px; flex-wrap: wrap; }
.gs-subtab { flex: 1; min-width: 80px; padding: 11px 12px; background: var(--stone); border: 1px solid var(--line); border-radius: 10px; font-weight: 600; font-size: 14px; cursor: pointer; transition: var(--t); }
.gs-subtab:hover:not(:disabled) { border-color: var(--amber-d); }
.gs-subtab.active { background: var(--amber); border-color: var(--amber); color: #1a1208; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 20px; border-radius: 12px; border: 1px solid transparent; font-weight: 700; font-size: 16px; cursor: pointer; transition: var(--t); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--amber), var(--amber-d)); color: #1a1208; box-shadow: 0 6px 20px rgba(217,130,43,.25); }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 26px rgba(217,130,43,.35); }
.btn-secondary { background: var(--stone-2); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--amber); }
.btn-outline { background: transparent; border-color: var(--line); }
.btn-outline:hover { border-color: var(--amber); background: rgba(217,130,43,.08); }

.gs-multi-card { background: var(--stone); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.gs-multi-icon { font-size: 34px; text-align: center; }
.gs-multi-card h3 { font-size: 18px; text-align: center; }
.gs-multi-card > p { color: var(--muted); font-size: 14px; text-align: center; }
.gs-status { min-height: 1.2em; font-size: 13px; color: var(--ember); text-align: center; }
.gs-join-row { display: flex; gap: 10px; }
.gs-join-row .gs-room-input { flex: 1; }

.pub-check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; color: var(--text); }
.pub-check input { accent-color: var(--amber); width: 18px; height: 18px; }
.pub-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; background: var(--amber); color: #1a1208; border-radius: 10px; font-size: 12px; font-weight: 800; margin-left: 4px; }

.pub-section { display: flex; flex-direction: column; gap: 10px; }
.pub-header { display: flex; justify-content: space-between; align-items: center; }
.pub-label { font-weight: 700; }
.pub-count { font-size: 13px; color: var(--muted); }
.pub-box { background: var(--soot); border: 1px solid var(--line); border-radius: 12px; padding: 8px; min-height: 120px; }
.pub-list { display: flex; flex-direction: column; gap: 8px; }
.pub-empty { text-align: center; padding: 22px 10px; color: var(--muted); }
.pub-empty i { font-style: normal; font-size: 30px; display: block; margin-bottom: 6px; }
.pub-empty small { font-size: 12px; }
.pub-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; background: var(--stone-2); border: 1px solid var(--line); border-radius: 10px; cursor: pointer; text-align: left; transition: var(--t); }
.pub-card:hover { border-color: var(--amber); transform: translateX(3px); }
.pub-card-left { display: flex; flex-direction: column; gap: 4px; }
.pub-code { font-weight: 800; letter-spacing: 3px; font-size: 18px; }
.pub-card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }
.pub-card-join { color: var(--ember); font-weight: 700; font-size: 14px; white-space: nowrap; }
.pub-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pub-nav-btn { padding: 8px 12px; background: var(--stone-2); border: 1px solid var(--line); border-radius: 8px; font-size: 13px; cursor: pointer; transition: var(--t); }
.pub-nav-btn:hover:not(:disabled) { border-color: var(--amber); }
.pub-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.pub-page { font-size: 13px; color: var(--muted); }
.pub-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.pub-divider::before, .pub-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.overlay { position: fixed; inset: 0; background: rgba(10,8,6,.9); display: flex; align-items: center; justify-content: center; z-index: 2000; padding: 16px; backdrop-filter: blur(18px); animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.popup { background: linear-gradient(145deg, var(--stone) 0%, var(--soot) 100%); border: 1px solid var(--line); border-radius: 20px; padding: 36px 28px; width: min(460px, 100%); max-height: 92vh; overflow-y: auto; display: flex; flex-direction: column; align-items: center; gap: 18px; box-shadow: 0 40px 90px rgba(0,0,0,.8), 0 0 0 1px rgba(255,255,255,.03); position: relative; animation: popIn .35s cubic-bezier(.34,1.56,.64,1); }
.popup::before { content: ''; position: absolute; top: 0; left: 10%; right: 10%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent); }
@keyframes popIn { from { transform: scale(.92) translateY(18px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.popup h2 { text-align: center; font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.popup .btn { width: 100%; }
.gs-room-code-display { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 24px; background: var(--stone-2); border: 1px solid var(--line); border-radius: 14px; width: 100%; }
.gs-room-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.gs-room-code { font-size: 46px; font-weight: 800; letter-spacing: .28em; padding-left: .28em; color: var(--ember); text-shadow: 0 0 22px rgba(240,160,75,.35); }
.gs-copy-btn { width: auto !important; padding: 6px 16px; font-size: 12px; }
.gs-waiting-meta { display: inline-flex; align-items: center; justify-content: center; padding: 6px 14px; border-radius: 999px; background: rgba(217,130,43,.12); border: 1px solid rgba(217,130,43,.35); color: var(--ember); font-size: 13px; font-weight: 700; text-align: center; }
.gs-waiting-players { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.gs-player-chip { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--stone-2); border: 1px solid var(--line); border-radius: 100px; font-weight: 600; font-size: 14px; }
.gs-player-chip.me { border-color: var(--amber); background: rgba(217,130,43,.1); }
.gs-dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px rgba(0,0,0,.4); }
.gs-host-badge { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; background: var(--amber); color: #1a1208; padding: 2px 7px; border-radius: 999px; font-weight: 800; }
.gs-waiting-hint { text-align: center; color: var(--muted); font-size: 13px; }
.gs-leave-btn { padding: 14px 20px; font-size: 16px; color: var(--danger); }

@media (max-width: 520px) {
  .header h1 { font-size: 36px; }
  .logo-icon { font-size: 42px; }
  .gs-tabs { flex-direction: column; }
  .home-button { top: 14px; left: 14px; }
  .header { padding-top: 62px; }
}
