﻿:root {
  --bg: #0b2418;
  --card: #132d1f;
  --ink: #f5f1e8;
  --muted: #c4bcae;
  --accent: #c0392b;
  --accent-2: #d4af37;
  --border: rgba(212, 175, 55, 0.25);
  --shadow: 0 18px 50px rgba(2, 12, 7, 0.55);
  --glow: 0 0 24px rgba(212, 175, 55, 0.24);
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 12%, rgba(212, 175, 55, 0.18), transparent 40%),
    radial-gradient(circle at 78% 8%, rgba(192, 57, 43, 0.16), transparent 38%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.015) 0px,
      rgba(255, 255, 255, 0.015) 2px,
      transparent 2px,
      transparent 8px
    ),
    linear-gradient(135deg, #0a2015, #113523 50%, #0a2417);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--ink);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.22), transparent 62%);
  filter: blur(2px);
  z-index: -1;
  animation: drift 18s ease-in-out infinite;
}

body::before {
  top: -80px;
  left: -60px;
}

body::after {
  bottom: -100px;
  right: -80px;
  background: radial-gradient(circle, rgba(192, 57, 43, 0.18), transparent 60%);
  animation-duration: 22s;
}

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.hero h1 {
  font-size: 44px;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
  font-family: "Baloo 2", "Space Grotesk", sans-serif;
}

.hero p {
  margin: 0 0 20px;
  color: var(--muted);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-actions button {
  margin-top: 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-head button {
  margin-top: 0;
}

.card {
  background: linear-gradient(180deg, rgba(22, 50, 35, 0.95), rgba(12, 34, 22, 0.96));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  backdrop-filter: blur(6px);
  animation: rise 600ms ease both;
  position: relative;
}

.card::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 16px;
  border: 1px solid rgba(212, 175, 55, 0.14);
  pointer-events: none;
}

.room.revealed::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.2), transparent 60%);
  animation: flash 700ms ease;
  pointer-events: none;
}

.hidden { display: none !important; }

.grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.auth-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 12px;
}

.auth-block h3 {
  margin-top: 0;
}

.auth-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

input,
select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #10271a;
  color: var(--ink);
  font-size: 16px;
}

button {
  background: linear-gradient(180deg, #d14d3f, #b02f22);
  color: #fff8ef;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 15px;
  cursor: pointer;
  margin-top: 10px;
  box-shadow: var(--glow);
  transition: transform 160ms ease, filter 160ms ease, box-shadow 160ms ease;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.actions button:last-child {
  background: var(--accent-2);
  color: #1f2937;
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.35);
}

.muted { color: var(--muted); margin-top: 8px; }
.error { color: #f87171; margin-top: 8px; }

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

.room-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}

.tab-btn {
  margin-top: 0;
  padding: 8px 12px;
  border-radius: 999px;
}

.tab-btn.active {
  background: linear-gradient(180deg, #d14d3f, #b02f22);
  color: #fff8ef;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.room-panel {
  animation: rise 220ms ease;
}

.room-layout {
  display: block;
}

.room-main {
  min-width: 0;
}

.overview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.participants-panel {
  position: static;
  width: 300px;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  background: rgba(8, 26, 18, 0.7);
  box-shadow: var(--shadow);
}

.participants.compact {
  grid-template-columns: 1fr;
  gap: 6px;
}

.participants.compact .participant {
  padding: 7px 8px;
}

.participants.compact .participant .vote,
.participants.compact .participant .voted,
.participants.compact .participant .pending {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.participants.compact .participant-actions {
  gap: 4px;
}

.participants.compact .participant-actions button {
  margin-top: 0;
  padding: 3px 7px;
  font-size: 11px;
}

.deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 10px;
  margin: 20px 0;
}

.card-btn {
  background: linear-gradient(180deg, #fffefb, #f7f2e6);
  color: #1f1b16;
  border: 2px solid rgba(212, 175, 55, 0.44);
  padding: 14px;
  border-radius: 14px;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 8px 18px rgba(0, 0, 0, 0.24);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
}

.card-btn:nth-child(odd) { transform: translateY(0.5px); }
.card-btn:nth-child(3n) { transform: translateY(-0.5px); }

.participants {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.participant {
  display: flex;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--user-color, var(--border));
  border-radius: 10px;
  padding: 10px;
  background: rgba(9, 25, 16, 0.9);
  justify-content: space-between;
}

.participant .vote,
.participant .voted,
.participant .pending {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: var(--user-color, var(--accent));
  color: #0b1020;
}

.participant .pending {
  background: rgba(148,163,184,0.5);
  color: #0b1020;
}

.participant .voted {
  background: var(--accent-2);
  color: #1f2937;
}

.participant-actions {
  display: flex;
  gap: 6px;
}

.toggle {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px 10px;
  background: rgba(8, 26, 18, 0.7);
}

.toggle input { accent-color: #f3d982; }

.countdown {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.45);
  color: #fff1cb;
  font-weight: 600;
  width: fit-content;
  animation: pulse 1s ease infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 rgba(212, 175, 55, 0.4); }
  50% { box-shadow: 0 0 20px rgba(212, 175, 55, 0.5); }
  100% { box-shadow: 0 0 0 rgba(212, 175, 55, 0.4); }
}

.penguin {
  width: 90px;
  height: 110px;
  position: relative;
  filter: drop-shadow(0 12px 20px rgba(2,6,23,0.6));
  animation: float 4s ease-in-out infinite;
}

.penguin-body {
  width: 90px;
  height: 110px;
  background: #10271a;
  border-radius: 60% 60% 50% 50%;
  position: relative;
  border: 2px solid rgba(148,163,184,0.3);
}

.penguin-belly {
  width: 55px;
  height: 70px;
  background: #e2e8f0;
  border-radius: 60% 60% 50% 50%;
  position: absolute;
  left: 18px;
  top: 28px;
}

.penguin-eye {
  width: 8px;
  height: 8px;
  background: #e2e8f0;
  border-radius: 50%;
  position: absolute;
  top: 22px;
}

.penguin-eye.left { left: 28px; }
.penguin-eye.right { right: 28px; }

.penguin-beak {
  width: 16px;
  height: 10px;
  background: var(--accent-2);
  border-radius: 0 0 8px 8px;
  position: absolute;
  left: 37px;
  top: 30px;
}

.penguin-wing {
  width: 25px;
  height: 45px;
  background: #10271a;
  border-radius: 50%;
  position: absolute;
  top: 40px;
}

.penguin-wing.left { left: -6px; transform: rotate(-20deg); }
.penguin-wing.right { right: -6px; transform: rotate(20deg); }

.penguin-feet {
  width: 40px;
  height: 10px;
  background: var(--accent-2);
  position: absolute;
  left: 25px;
  bottom: -6px;
  border-radius: 0 0 10px 10px;
}

.share {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}

.share button { margin-top: 0; }

.share input {
  width: 240px;
}

.story-link {
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink);
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.28);
  padding: 6px 10px;
  border-radius: 12px;
  display: inline-block;
}

.story-link a {
  color: #f3d982;
  text-decoration: none;
  font-weight: 600;
}

.method-badge {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.28);
  padding: 4px 8px;
  border-radius: 999px;
  display: inline-block;
}

.reveal-wow {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  color: #fcd34d;
  text-shadow: 0 0 12px rgba(251,191,36,0.7);
  animation: burst 900ms ease both;
}

.results {
  margin: 14px 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(9, 28, 18, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.24);
}

.bars {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.bar-row {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 10px;
  align-items: center;
}

.bar-label {
  font-weight: 600;
  color: var(--ink);
}

.bar {
  height: 22px;
  border-radius: 999px;
  background: rgba(9, 25, 16, 0.9);
  border: 1px solid rgba(148,163,184,0.25);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.9), rgba(212, 175, 55, 0.88));
  display: grid;
  place-items: center end;
  padding-right: 8px;
  font-weight: 700;
  color: #0b1020;
  animation: grow 600ms ease;
}

.confetti {
  position: fixed;
  top: -10px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  z-index: 9999;
  animation: fall 1.6s ease-in forwards;
}

.card-btn.selected {
  outline: 2px solid var(--accent-2);
  box-shadow: 0 0 20px rgba(251,191,36,0.35);
}

.room.revealed .deck .card-btn {
  animation: sparkle 500ms ease;
}

.room.revealed .participant .vote {
  animation: pop 450ms ease;
}

@keyframes sparkle {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.story-link {
  margin-top: 8px;
  font-size: 16px;
  color: var(--ink);
  background: rgba(212, 175, 55, 0.14);
  border: 1px solid rgba(212, 175, 55, 0.28);
  padding: 6px 10px;
  border-radius: 12px;
  display: inline-block;
}

.story-link a {
  color: #f3d982;
  text-decoration: none;
  font-weight: 600;
}

.room.revealed .participants {
  animation: pop 450ms ease;
}

@keyframes pop {
  0% { transform: scale(0.98); }
  60% { transform: scale(1.01); }
  100% { transform: scale(1); }
}

.card-lite {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: rgba(8, 26, 18, 0.55);
}

.subtasks {
  margin: 6px 0 14px;
}

.subtask-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.subtask-input {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  position: relative;
}

.subtask-input input {
  flex: 1;
}

.mini-toast {
  position: absolute;
  right: 8px;
  top: -28px;
  background: rgba(212, 175, 55, 0.92);
  color: #2a1d08;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
  pointer-events: none;
}

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

.subtask-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.subtask-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(14, 35, 24, 0.7);
  border: 1px dashed rgba(148,163,184,0.35);
}

.subtask-text {
  color: var(--ink);
  word-break: break-word;
}

.admin-panel {
  margin-top: 6px;
}

.admin-actions {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-top: 12px;
  flex-wrap: wrap;
}

.admin-actions button { margin-top: 0; }

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid rgba(212, 175, 55, 0.35);
  box-shadow: none;
}

.ghost.warn {
  border-color: rgba(248,113,113,0.6);
  color: #fecaca;
}

@keyframes float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

@keyframes drift {
  0% { transform: translate(0, 0); }
  50% { transform: translate(20px, -10px); }
  100% { transform: translate(0, 0); }
}

@keyframes burst {
  0% { transform: scale(0.9); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes grow {
  from { width: 0; }
  to { width: var(--target, 100%); }
}

@keyframes fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(90vh) rotate(180deg); opacity: 0.8; }
}

@keyframes flash {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

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

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

.room-list-items {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.room-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(14, 35, 24, 0.84);
  transition: transform 160ms ease, border-color 160ms ease;
}

.room-row:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.6);
}

.room-name {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.room-id {
  color: var(--muted);
  font-size: 13px;
}

.site-footer {
  max-width: 980px;
  margin: 0 auto 24px;
  padding: 0 20px;
  display: flex;
  gap: 16px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.site-footer a:hover {
  color: #f3d982;
  border-bottom-color: #f3d982;
}

.legal-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.legal-page h1 {
  font-family: "Baloo 2", "Space Grotesk", sans-serif;
  margin-top: 0;
}

.legal-card {
  background: linear-gradient(180deg, rgba(22, 50, 35, 0.95), rgba(12, 34, 22, 0.96));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.legal-card p,
.legal-card li {
  color: var(--ink);
  line-height: 1.5;
}

.legal-back {
  display: inline-block;
  margin-bottom: 16px;
  color: #f3d982;
  text-decoration: none;
}

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

@media (max-width: 640px) {
  .hero { flex-direction: column; align-items: flex-start; }
  .room-head { flex-direction: column; align-items: flex-start; }
  .room-nav { width: 100%; }
  .room-layout { display: block; }
  .overview-top { flex-direction: column; }
  .participants-panel { width: 100%; margin-bottom: 10px; }
  .room-row { flex-direction: column; align-items: flex-start; }
  .share { flex-direction: column; align-items: flex-start; }
  .share input { width: 100%; }
  .subtask-input { flex-direction: column; }
  .admin-actions { flex-direction: column; align-items: stretch; }
}





