:root {
  --black: #050409;
  --panel: rgba(18, 12, 28, 0.86);
  --panel-strong: #140d21;
  --purple: #2b1249;
  --violet: #7b2cff;
  --gold: #d9aa45;
  --gold-soft: #ffe3a1;
  --text: #f7f1ff;
  --muted: #b9aaca;
  --danger: #ff6b8a;
  --ok: #70e0b5;
  --line: rgba(255, 227, 161, 0.18);
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 8%, rgba(123, 44, 255, 0.25), transparent 28rem),
    radial-gradient(circle at 78% 12%, rgba(217, 170, 69, 0.14), transparent 24rem),
    linear-gradient(145deg, #030205, #100919 45%, #050409);
}

button, input, textarea, select {
  font: inherit;
}

button {
  cursor: pointer;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 0.72rem 1rem;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 227, 161, 0.46);
  background: rgba(255, 255, 255, 0.08);
}

input, textarea, select {
  width: 100%;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 0.82rem 0.95rem;
  outline: none;
}

textarea { resize: vertical; }

.file-label {
  display: grid;
  gap: 0.5rem;
  color: var(--gold-soft);
  font-weight: 800;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  backdrop-filter: blur(18px);
}

.topbar button {
  white-space: nowrap;
}

.brand {
  font-family: Cinzel, serif;
  font-weight: 800;
  color: var(--gold-soft);
  background: transparent;
  border: 0;
  padding-left: 0;
  letter-spacing: 0;
}

nav {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.session {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--muted);
}

main { padding: 1rem 0 4rem; }

.view {
  display: none;
  animation: rise 360ms ease both;
}

.view.active { display: block; }
.view.narrow { max-width: 620px; margin: 4rem auto; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-layout {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 220px;
  gap: 1rem;
  align-items: stretch;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 920px);
  gap: 1.2rem;
  justify-content: center;
  align-items: start;
}

.side-banner {
  min-height: 680px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 0.9rem;
  text-align: center;
  font-weight: 900;
  color: var(--gold-soft);
  background: rgba(18, 12, 28, 0.86);
}

.side-banner p {
  display: grid;
  gap: 0.4rem;
  margin: 0;
}

.side-banner .banner-part {
  display: block;
}

.side-banner img {
  width: 100%;
  max-height: 100%;
  border-radius: 6px;
}

.side-banner img.cover {
  height: 100%;
  object-fit: cover;
}

.side-banner img.contain {
  height: auto;
  max-height: 50%;
  object-fit: contain;
}

.banner-bg-purple { background: linear-gradient(160deg, #1a0d2c, #07040c); }
.banner-bg-black { background: #050409; }
.banner-bg-gold { background: linear-gradient(160deg, #4a3513, #0b0702); }
.banner-bg-neon { background: linear-gradient(160deg, #111827, #2b1249); }
.banner-text-gold { color: var(--gold-soft); }
.banner-text-white { color: white; }
.banner-text-violet { color: #d9c4ff; }
.banner-text-mint { color: #c9ffed; }

.link-btn {
  border: 0;
  padding: 0;
  color: var(--gold-soft);
  background: transparent;
  text-decoration: underline;
}

.hero-panel, .panel, .chat-panel {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(20, 13, 33, 0.92), rgba(5, 4, 9, 0.82));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.hero-panel {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(0.75rem, 1.8vw, 1.35rem) clamp(1rem, 2.8vw, 2rem);
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(217, 170, 69, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(217, 170, 69, 0.06) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
}

.auth-entry, .quick-actions, .rules, .hero-panel h1, .countdown, .versus-box > * {
  position: relative;
}

.login-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 12, 28, 0.74);
}

.login-box p {
  margin: 0;
  color: var(--muted);
}

.auth-buttons {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

h1 {
  margin: 0;
  max-width: 100%;
  font-family: Cinzel, serif;
  font-size: clamp(1.8rem, 4.2vw, 4.15rem);
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  color: #fff7df;
  text-shadow: 0 0 28px rgba(217, 170, 69, 0.32), 0 0 54px rgba(123, 44, 255, 0.2);
}

.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 16px rgba(255, 227, 161, 0.9), 0 0 32px rgba(123, 44, 255, 0.45);
  opacity: 0.78;
  animation: particleFloat 4s ease-in-out infinite;
  pointer-events: none;
}

.p1 { left: 8%; top: 18%; }
.p2 { right: 13%; top: 14%; animation-delay: 0.8s; }
.p3 { left: 14%; bottom: 18%; animation-delay: 1.4s; }
.p4 { right: 18%; bottom: 22%; animation-delay: 2.1s; }

@keyframes particleFloat {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.45; }
  50% { transform: translateY(-16px) scale(1.35); opacity: 1; }
}

.versus-box {
  min-height: 230px;
  grid-column: 1;
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  border: 1px solid rgba(255, 227, 161, 0.28);
  border-radius: 8px;
  background: linear-gradient(160deg, rgba(43, 18, 73, 0.88), rgba(5, 4, 9, 0.9));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34), 0 0 42px rgba(123, 44, 255, 0.14);
  display: grid;
  align-content: center;
  gap: 0.8rem;
  text-align: center;
}

.versus-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 25%, rgba(255, 227, 161, 0.16), transparent 42%);
}

.versus-box h2 {
  margin: 0;
  color: var(--gold-soft);
  text-shadow: 0 0 24px rgba(255, 227, 161, 0.65);
}

.versus-box p {
  margin: 0;
  color: var(--muted);
}

.versus-glow-btn {
  color: #130803;
  border-color: #fff0b8;
  background: linear-gradient(135deg, #fff6c9, #d9aa45 48%, #9d7029);
  font-weight: 900;
  box-shadow: 0 0 24px rgba(217, 170, 69, 0.45), 0 0 52px rgba(123, 44, 255, 0.22);
}

h2, h3 { margin: 0 0 0.75rem; letter-spacing: 0; }
p { line-height: 1.65; }

.countdown {
  width: fit-content;
  margin: 0.8rem 0;
  padding: 0.62rem 0.85rem;
  border: 1px solid rgba(217, 170, 69, 0.36);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(217, 170, 69, 0.08);
  box-shadow: 0 0 36px rgba(217, 170, 69, 0.12);
  font-weight: 800;
}

.rules {
  max-width: 820px;
  color: var(--muted);
}

.rules p {
  margin: 0.35rem 0;
}

.rules h2 { color: var(--text); }

.gold-btn {
  color: #120b03;
  border-color: #f5d58b;
  background: linear-gradient(135deg, #fff0b8, var(--gold) 52%, #9d7029);
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(217, 170, 69, 0.2);
}

.ghost {
  background: rgba(255, 255, 255, 0.03);
}

.quick-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.chat-panel {
  height: 430px;
  grid-column: 1;
  padding: 1rem;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  gap: 0.85rem;
}

.panel-title, .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.panel-title span, .subtle, .hint, small {
  color: var(--muted);
}

.chat-messages {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 0.3rem;
}

.message {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.22);
  border-radius: 8px;
  padding: 0.7rem;
}

.message strong { color: var(--gold-soft); }
.message-time {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.76rem;
}
.badge, .rank {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  min-height: 24px;
  padding: 0.18rem 0.48rem;
  border: 1px solid rgba(217, 170, 69, 0.35);
  border-radius: 999px;
  color: var(--gold-soft);
  font-size: 0.76rem;
}

.rank {
  border-color: color-mix(in srgb, var(--rank-color, var(--gold)) 65%, transparent);
  color: #f8f2ff;
  background: rgba(255, 255, 255, 0.035);
}

.rank i {
  width: 0.72rem;
  height: 0.72rem;
  display: inline-block;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--rank-color, var(--gold));
  box-shadow: 0 0 14px var(--rank-color, var(--gold));
}

.rank-shine {
  color: #fff8d9;
  font-weight: 900;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.05), rgba(217, 170, 69, 0.16), rgba(123, 44, 255, 0.1));
  text-shadow: 0 0 14px rgba(255, 227, 161, 0.78), 0 0 30px rgba(217, 170, 69, 0.42);
  box-shadow: 0 0 26px color-mix(in srgb, var(--rank-color, var(--gold)) 36%, transparent);
}

.profile-rank {
  margin: 0.5rem 0;
  min-height: 54px;
  padding: 0.45rem 0.9rem;
  font-size: 2.28rem;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: normal;
}

.profile-rank i {
  width: 1.25rem;
  height: 1.25rem;
}

.admin-name {
  display: inline-block;
  color: #fff4bf;
  font-size: 1.22em;
  font-weight: 900;
  text-shadow: 0 0 14px rgba(255, 227, 161, 0.85), 0 0 34px rgba(217, 170, 69, 0.62), 0 0 54px rgba(123, 44, 255, 0.38);
}

.admin-name-compact {
  font-size: 1.12em;
}

.admin-badge {
  background: rgba(217, 170, 69, 0.18);
  color: #fff0b8;
  font-weight: 900;
  box-shadow: 0 0 22px rgba(217, 170, 69, 0.22);
}

.chat-form {
  display: grid;
  gap: 0.55rem;
}

.panel { padding: 1.2rem; }
.stack { display: grid; gap: 0.85rem; }
.hidden, .guest-only.hidden, .auth-only.hidden, .admin-only.hidden { display: none !important; }

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tabs button.active {
  border-color: rgba(217, 170, 69, 0.52);
  color: var(--gold-soft);
}

.section-head {
  margin: 1rem 0 1.2rem;
}

.card-grid, .art-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.user-card, .art-card {
  border: 1px solid var(--line);
  background: rgba(18, 12, 28, 0.78);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 180ms ease, border-color 180ms ease;
}

.user-card:hover, .art-card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 170, 69, 0.45);
}

.user-card { padding: 1rem; }

.top-place {
  color: var(--gold-soft);
  text-shadow: 0 0 18px rgba(217, 170, 69, 0.55);
}

.points-pill {
  width: fit-content;
  margin: 0.45rem 0;
  padding: 0.32rem 0.62rem;
  border: 1px solid rgba(112, 224, 181, 0.42);
  border-radius: 999px;
  color: #c9ffed;
  background: rgba(112, 224, 181, 0.09);
  font-weight: 800;
  box-shadow: 0 0 22px rgba(112, 224, 181, 0.12);
}

.profile-points {
  font-size: 1.05rem;
}

.admin-user-item {
  padding: 0;
  overflow: hidden;
}

.admin-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto auto;
  gap: 0.7rem;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.03);
}

.admin-toggle span {
  color: var(--gold-soft);
  font-weight: 900;
  font-size: 1.15rem;
}

.admin-toggle b {
  color: #c9ffed;
  white-space: nowrap;
}

.admin-user-details {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem;
}
.avatar {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(217, 170, 69, 0.42);
  background: #241631;
}

.art-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #130b1d;
}

.art-card .body { padding: 1rem; }

.pending-card {
  border-color: rgba(255, 227, 161, 0.58);
  box-shadow: 0 0 34px rgba(217, 170, 69, 0.14);
}

.pending-label {
  width: fit-content;
  margin: 0.6rem 0;
  padding: 0.42rem 0.62rem;
  border: 1px solid rgba(255, 227, 161, 0.62);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(217, 170, 69, 0.12);
  font-weight: 800;
  text-shadow: 0 0 18px rgba(255, 227, 161, 0.55);
  box-shadow: 0 0 26px rgba(217, 170, 69, 0.22);
}

.notification-card {
  border-color: rgba(217, 170, 69, 0.36);
}

.notice-approved {
  border-color: rgba(112, 224, 181, 0.55);
  box-shadow: 0 0 26px rgba(112, 224, 181, 0.12);
}

.notice-rejected {
  border-color: rgba(255, 107, 138, 0.55);
  box-shadow: 0 0 26px rgba(255, 107, 138, 0.12);
}

.admin-reply {
  padding: 0.75rem;
  border: 1px solid rgba(217, 170, 69, 0.24);
  border-radius: 8px;
  background: rgba(217, 170, 69, 0.08);
}

.bell-btn {
  position: relative;
}

.bell-btn span {
  display: inline-flex;
  min-width: 22px;
  min-height: 22px;
  align-items: center;
  justify-content: center;
  margin-left: 0.35rem;
  border-radius: 50%;
  color: #120b03;
  background: var(--gold);
  font-size: 0.78rem;
  font-weight: 900;
}

.bell-alert {
  border-color: rgba(255, 227, 161, 0.62);
  box-shadow: 0 0 28px rgba(217, 170, 69, 0.22);
}

.bell-panel {
  position: fixed;
  right: 1rem;
  top: 84px;
  z-index: 19;
  width: min(440px, calc(100vw - 2rem));
  max-height: 72vh;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 8, 20, 0.96);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.chat-reset {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 18;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(217, 170, 69, 0.34);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(8, 5, 13, 0.94);
  font-weight: 800;
  box-shadow: 0 0 28px rgba(217, 170, 69, 0.14);
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
}

.contact-card {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.trophy-line {
  width: fit-content;
  padding: 0.42rem 0.7rem;
  border: 1px solid rgba(217, 170, 69, 0.4);
  border-radius: 999px;
  color: var(--gold-soft);
  font-weight: 900;
  background: rgba(217, 170, 69, 0.08);
}

.trophy-green { color: #9dffcb; text-shadow: 0 0 18px rgba(112, 224, 181, 0.7); }
.trophy-blue { color: #9fd1ff; text-shadow: 0 0 20px rgba(92, 200, 255, 0.75); }
.trophy-gold {
  color: #fff0a8;
  transform: scale(1.06);
  text-shadow: 0 0 18px rgba(255, 227, 161, 0.9), 0 0 36px rgba(217, 170, 69, 0.75);
  box-shadow: 0 0 30px rgba(217, 170, 69, 0.32);
}

.versus-room-card {
  min-height: 210px;
}

#versusGameView.active {
  min-height: calc(100vh - 108px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 0.35rem;
}

#versusGameView .section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 0.25rem;
}

#versusGameView .section-head h2,
#versusGameView .section-head p {
  margin: 0;
}

.game-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.speaker-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 900;
}

.speaker-on {
  border-color: rgba(112, 224, 181, 0.75);
  background: rgba(112, 224, 181, 0.18);
  box-shadow: 0 0 22px rgba(112, 224, 181, 0.42);
}

.speaker-off {
  border-color: rgba(255, 107, 138, 0.78);
  background: rgba(255, 107, 138, 0.18);
  box-shadow: 0 0 22px rgba(255, 107, 138, 0.42);
}

.versus-arena {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 205px;
  gap: 0.55rem;
  align-items: start;
  min-height: 0;
}

.draw-tools {
  display: grid;
  gap: 0.34rem;
  align-items: stretch;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 12, 28, 0.76);
}

.draw-tools button,
.draw-tools input,
.draw-tools select {
  min-height: 0;
  padding: 0.48rem 0.58rem;
}

.draw-tools h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
}

.draw-tools label {
  display: grid;
  gap: 0.3rem;
  color: var(--muted);
}

.canvas-wrap {
  display: grid;
  justify-items: center;
  position: relative;
  min-width: 0;
}

#versusCanvas {
  width: 100%;
  max-width: min(720px, 100%);
  max-height: min(58vh, 720px);
  aspect-ratio: 1 / 1;
  display: block;
  margin: 0 auto;
  background: white;
  border: 3px solid rgba(217, 170, 69, 0.38);
  border-radius: 8px;
  touch-action: none;
}

.tool-active {
  color: #fff0b8;
  border-color: rgba(255, 227, 161, 0.85);
  background: rgba(217, 170, 69, 0.18);
  box-shadow: 0 0 20px rgba(217, 170, 69, 0.52), inset 0 0 18px rgba(255, 227, 161, 0.08);
}

.own-vote-card {
  opacity: 0.68;
  cursor: not-allowed;
  border-color: rgba(255, 255, 255, 0.18);
}

.own-vote-card::after {
  content: "tu dibujo";
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid rgba(255, 227, 161, 0.45);
  border-radius: 999px;
  color: #fff0b8;
  background: rgba(8, 5, 13, 0.76);
  font-size: 0.78rem;
  font-weight: 900;
}

.canvas-countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 1rem;
  border-radius: 8px;
  color: #fff0b8;
  background: radial-gradient(circle, rgba(20, 8, 32, 0.32), rgba(255, 255, 255, 0.05) 58%, transparent 70%);
  font-size: clamp(1.8rem, 5vw, 4.7rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 18px rgba(255, 227, 161, 0.95), 0 0 44px rgba(217, 170, 69, 0.72);
  pointer-events: none;
  animation: countdownGlow 1.15s ease-in-out infinite alternate;
}

@keyframes countdownGlow {
  from { opacity: 0.78; transform: scale(0.985); }
  to { opacity: 1; transform: scale(1); }
}

.versus-side-panel {
  display: grid;
  gap: 0.45rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 12, 28, 0.76);
  max-height: min(58vh, 620px);
  overflow: hidden;
}

#versusPlayersList {
  min-height: 0;
  overflow: auto;
}

.versus-side-panel h3 {
  margin: 0;
}

#versusRoundCountdown {
  transition: color 180ms ease, font-size 180ms ease, text-shadow 180ms ease, transform 180ms ease;
}

.drawing-time-glow {
  justify-self: end;
  color: #fff0b8;
  font-size: clamp(3rem, 7vw, 6.8rem);
  font-weight: 900;
  line-height: 0.95;
  text-align: right;
  text-shadow: 0 0 18px rgba(255, 227, 161, 0.98), 0 0 46px rgba(217, 170, 69, 0.84), 0 0 72px rgba(123, 44, 255, 0.42);
  transform: translateX(0.1rem);
}

.versus-player-row {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 0.2rem 0.45rem;
  align-items: center;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.22);
  text-align: left;
}

.versus-player-row img {
  grid-row: span 2;
  width: 34px;
  height: 34px;
  object-fit: cover;
  border: 1px solid rgba(255, 227, 161, 0.3);
  border-radius: 50%;
}

.versus-player-row span,
.versus-player-row small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.versus-player-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.versus-player-row.waiting {
  color: var(--muted);
}

.versus-player-row.eliminated {
  color: #ff9aae;
}

.versus-prompt {
  min-height: 34px;
  display: grid;
  place-items: center;
  margin-bottom: 0.45rem;
  color: #fff0b8;
  font-size: clamp(1.4rem, 3.6vw, 3rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 24px rgba(255, 227, 161, 0.86), 0 0 48px rgba(217, 170, 69, 0.45);
}

.drawing-sent-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(20, 8, 32, 0.52);
  text-align: center;
  pointer-events: all;
  overflow: hidden;
}

.drawing-sent-overlay strong {
  font-size: clamp(2rem, 5vw, 4.5rem);
  text-transform: uppercase;
  letter-spacing: 0;
}

.drawing-sent-overlay p {
  margin: 0;
  font-weight: 900;
}

.fresh-message {
  position: fixed;
  inset: 35% auto auto 50%;
  z-index: 40;
  width: min(760px, calc(100vw - 2rem));
  transform: translateX(-50%);
  padding: 1rem;
  border: 1px solid rgba(255, 227, 161, 0.5);
  border-radius: 8px;
  background: rgba(8, 5, 13, 0.92);
  box-shadow: 0 0 48px rgba(217, 170, 69, 0.35);
}

.winner-drawing-card {
  position: relative;
  border-color: rgba(255, 227, 161, 0.9);
  box-shadow: 0 0 48px rgba(217, 170, 69, 0.58), 0 0 80px rgba(255, 227, 161, 0.28);
}

.vote-card {
  position: relative;
}

.vote-card img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #ffffff;
}

.rank-table {
  display: grid;
  gap: 0.55rem;
}

.rank-row {
  display: grid;
  grid-template-columns: 48px minmax(110px, auto) 1fr minmax(120px, auto);
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 12, 28, 0.72);
}

.my-rank-row {
  border-color: rgba(255, 227, 161, 0.72);
  box-shadow: 0 0 34px rgba(217, 170, 69, 0.28);
}

.my-rank-row b {
  color: #fff0b8;
  text-shadow: 0 0 18px rgba(217, 170, 69, 0.76);
}

.winner-drawing-card::before,
.winner-drawing-card::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold-soft);
  box-shadow: 0 0 20px rgba(255, 227, 161, 0.95);
  animation: particleFloat 2.6s ease-in-out infinite;
}

.winner-drawing-card::before { left: 12%; top: 10%; }
.winner-drawing-card::after { right: 14%; bottom: 18%; animation-delay: 0.9s; }

.disabled-canvas {
  opacity: 0.55;
  pointer-events: none;
}

.versus-announcement {
  min-height: 42px;
  display: grid;
  place-items: center;
  margin-bottom: 0;
  color: var(--gold-soft);
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 900;
  text-align: center;
  text-shadow: 0 0 28px rgba(217, 170, 69, 0.75);
}

#versusGallery {
  max-height: calc(100vh - 250px);
  overflow: auto;
}

.vote-worst {
  color: #ff9aae;
  text-shadow: 0 0 30px rgba(255, 107, 138, 0.8);
}

.vote-best {
  color: #a6ffd4;
  text-shadow: 0 0 30px rgba(112, 224, 181, 0.82);
}

.bad-vote {
  box-shadow: 0 0 34px rgba(255, 76, 106, 0.72);
  border-color: rgba(255, 76, 106, 0.9);
}

.good-vote {
  box-shadow: 0 0 34px rgba(112, 224, 181, 0.72);
  border-color: rgba(112, 224, 181, 0.9);
}

.winner-banner {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  border-color: rgba(217, 170, 69, 0.42);
}

.winner-banner img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.jury-wait {
  margin-bottom: 1rem;
  color: var(--gold-soft);
  font-weight: 800;
  text-align: center;
  border-color: rgba(217, 170, 69, 0.42);
}

.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.2rem;
  align-items: start;
}

.profile-hero .avatar {
  width: 132px;
  height: 132px;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 1rem;
  margin-bottom: 1rem;
}

.admin-list {
  display: grid;
  gap: 0.85rem;
}

.admin-item {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  padding: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
}

.inline-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.danger { color: white; border-color: rgba(255, 107, 138, 0.5); background: rgba(255, 107, 138, 0.16); }
.ok { color: white; border-color: rgba(112, 224, 181, 0.5); background: rgba(112, 224, 181, 0.16); }

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: 380px;
  padding: 1rem;
  border: 1px solid rgba(217, 170, 69, 0.35);
  border-radius: 8px;
  background: rgba(8, 5, 13, 0.94);
  color: var(--text);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(5, 4, 9, 0.68);
  backdrop-filter: blur(10px);
}

.loading-overlay div {
  min-width: 180px;
  padding: 1.1rem 1.4rem;
  border: 1px solid rgba(217, 170, 69, 0.48);
  border-radius: 8px;
  color: var(--gold-soft);
  background: rgba(18, 12, 28, 0.92);
  text-align: center;
  font-weight: 800;
  box-shadow: 0 0 44px rgba(217, 170, 69, 0.18);
}

.image-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  justify-items: center;
  padding: 1.2rem;
  background: rgba(3, 2, 5, 0.92);
  backdrop-filter: blur(14px);
}

.image-modal img {
  max-width: min(96vw, 1200px);
  max-height: 76vh;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid rgba(217, 170, 69, 0.36);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.image-modal p {
  max-width: 900px;
  margin: 0;
  color: var(--muted);
  text-align: center;
}

.modal-close {
  justify-self: end;
}

.player-info-modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 2, 5, 0.84);
  backdrop-filter: blur(12px);
}

.player-info-card {
  width: min(380px, 100%);
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  padding: 1rem;
  border: 1px solid rgba(255, 227, 161, 0.35);
  border-radius: 8px;
  background: rgba(18, 12, 28, 0.95);
  box-shadow: 0 0 48px rgba(217, 170, 69, 0.2);
}

.player-info-card .avatar {
  width: 86px;
  height: 86px;
}

.player-info-card p,
.player-info-card h3 {
  margin: 0;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 0.7rem 0;
  }

  nav {
    justify-content: flex-start;
    gap: 0.35rem;
  }
  nav button, .session button {
    padding: 0.52rem 0.62rem;
    font-size: 0.9rem;
  }
  .session { justify-content: space-between; }
  .home-layout, .home-grid, .admin-grid, .profile-hero { grid-template-columns: 1fr; }
  .side-banner { min-height: 180px; }
  .winner-banner { grid-template-columns: 1fr; }
  .chat-panel { height: 430px; }
  .hero-panel { min-height: 150px; }
  .versus-arena { grid-template-columns: 145px minmax(0, 1fr) 170px; }
  #versusCanvas { max-height: 50vh; }
  .draw-tools, .versus-side-panel { padding: 0.48rem; }
  .draw-tools h3, .versus-side-panel h3 { font-size: 0.9rem; }
}

@media (max-width: 760px) {
  main { padding-top: 0.4rem; }

  .topbar {
    position: relative;
  }

  .brand {
    font-size: 0.95rem;
  }

  nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  nav button {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.35rem;
    font-size: 0.78rem;
  }

  .session {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    width: 100%;
    font-size: 0.8rem;
  }

  .session button {
    padding: 0.5rem 0.48rem;
    font-size: 0.78rem;
  }

  .speaker-btn {
    width: 38px;
    height: 38px;
    justify-self: start;
  }

  #sessionLabel {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #versusGameView.active {
    min-height: auto;
    overflow: visible;
    gap: 0.25rem;
  }

  #versusGameView .section-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: start;
  }

  .game-head-actions { justify-content: end; }

  #versusGameView .section-head h2 {
    font-size: 1.1rem;
  }

  .versus-announcement {
    min-height: 34px;
    font-size: clamp(1.05rem, 7vw, 1.85rem);
  }

  .versus-prompt {
    min-height: 28px;
    margin-bottom: 0.25rem;
    font-size: clamp(1.05rem, 7vw, 1.8rem);
  }

  .versus-arena {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .draw-tools {
    order: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.25rem;
    padding: 0.38rem;
  }

  .draw-tools h3 {
    display: none;
  }

  .draw-tools label {
    gap: 0.18rem;
    font-size: 0.72rem;
  }

  .draw-tools button,
  .draw-tools input,
  .draw-tools select {
    min-width: 0;
    padding: 0.38rem 0.3rem;
    font-size: 0.72rem;
  }

  #finishDrawingBtn {
    grid-column: span 2;
  }

  .canvas-wrap {
    order: 1;
  }

  #versusCanvas {
    max-height: 46vh;
    border-width: 2px;
  }

  .versus-side-panel {
    order: 3;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.45rem;
    padding: 0.38rem;
    max-height: 94px;
    font-size: 0.76rem;
  }

  .versus-side-panel h3 {
    display: none;
  }

  .versus-side-panel p {
    margin: 0;
  }

  .drawing-time-glow {
    grid-column: 2;
    font-size: clamp(2.35rem, 14vw, 4.2rem);
  }

  #versusPlayersList {
    grid-column: 1 / -1;
    display: flex;
    gap: 0.25rem;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .versus-player-row {
    flex: 0 0 auto;
    width: 132px;
    padding: 0.28rem 0.42rem;
    font-size: 0.72rem;
  }

  .drawing-sent-overlay strong {
    font-size: clamp(1.5rem, 10vw, 3rem);
  }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 20px, 1480px); }
  button { padding: 0.65rem 0.75rem; }
  .hero-panel { padding: 0.85rem; }
  h1 { font-size: clamp(1.25rem, 8.2vw, 2.2rem); }
  .login-box { align-items: flex-start; flex-direction: column; }
  .countdown { width: 100%; }
  .section-head { align-items: flex-start; flex-direction: column; }
  .profile-rank { font-size: 1.55rem; }
  #versusCanvas { max-height: 40vh; }
  .draw-tools { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #finishDrawingBtn { grid-column: 1 / -1; }
  .rank-row {
    grid-template-columns: 34px 1fr;
    gap: 0.45rem;
  }
  .rank-row b {
    grid-column: 2;
  }
}
