:root {
  --bg: #0b0e1d;
  --panel: rgba(30, 35, 60, 0.65);
  --panel-solid: #1a1f33;
  --border: rgba(120, 130, 200, 0.18);
  --text: #eef0ff;
  --muted: #9298bc;
  --accent: #ff4d6d;
  --accent2: #4dd0ff;
  --good: #52e08a;
  --grad: linear-gradient(120deg, #ff4d6d, #ff8a5c);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 400px at 20% -10%, rgba(255, 77, 109, 0.18), transparent 70%),
    radial-gradient(700px 500px at 90% 110%, rgba(77, 208, 255, 0.14), transparent 70%);
}

.screen {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  animation: fadein 0.35s ease;
}
@keyframes fadein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.hidden { display: none !important; }

.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; }
.logo.big { font-size: 3.2rem; }
.logo span {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.tag { color: var(--muted); line-height: 1.55; max-width: 40ch; }
.tag em { color: var(--text); font-style: normal; font-weight: 600; }
.fineprint { color: var(--muted); font-size: 0.78rem; }

.hero { display: flex; flex-direction: column; align-items: center; gap: 18px; padding-top: 6vh; }

.btn {
  background: var(--grad);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 30px;
  font-size: 1.05rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(255, 77, 109, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn.secondary {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn.steam {
  background: #171a26;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.linkish { color: var(--muted); font-size: 0.85rem; margin-left: 8px; }

.steps {
  display: flex;
  gap: 12px;
  margin-top: 4vh;
  width: 100%;
}
.step {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(8px);
}
.step p { color: var(--muted); font-size: 0.85rem; line-height: 1.45; }
.stepnum {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
}

.topbar { display: flex; width: 100%; justify-content: space-between; align-items: center; }
.me { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }
.me img { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); }

.card-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(8px);
  margin-top: 8vh;
}
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.85rem; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.joinrow { display: flex; gap: 10px; justify-content: center; }
#join-code {
  width: 120px;
  background: rgba(11, 14, 29, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-size: 1.3rem;
  font-family: inherit;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 5px;
  padding: 10px;
}
#join-code:focus { outline: none; border-color: var(--accent2); }

.roomtitle { font-weight: 800; }
.code {
  background: var(--panel);
  border: 1px dashed var(--accent2);
  color: var(--accent2);
  border-radius: 12px;
  padding: 8px 22px;
  letter-spacing: 8px;
  font-family: ui-monospace, monospace;
  font-size: 2rem;
  cursor: pointer;
  transition: transform 0.15s;
}
.code:hover { transform: scale(1.04); }

.members { list-style: none; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.members li {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: fadein 0.25s ease;
}
.members img { width: 38px; height: 38px; border-radius: 50%; }
.members .host-badge { color: var(--accent2); font-size: 0.72rem; font-weight: 600; margin-left: auto; letter-spacing: 1px; }
.members .done-badge { color: var(--accent); font-size: 0.78rem; margin-left: auto; }

.swipe-top { display: flex; justify-content: space-between; width: 100%; color: var(--muted); font-size: 0.9rem; }
#match-count { color: var(--accent); font-weight: 600; }
#deck { position: relative; width: 100%; height: 310px; }
.game-card {
  position: absolute;
  inset: 0;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  touch-action: none;
  user-select: none;
  cursor: grab;
}
.game-card:active { cursor: grabbing; }
.game-card img { width: 100%; height: 215px; object-fit: cover; pointer-events: none; }
.game-card .gname { padding: 16px; font-size: 1.15rem; font-weight: 600; text-align: left; }
.game-card .stamp {
  position: absolute;
  top: 18px;
  font-size: 1.6rem;
  font-weight: 800;
  padding: 4px 14px;
  border: 3px solid;
  border-radius: 10px;
  opacity: 0;
  transform: rotate(-12deg);
}
.stamp.like { left: 16px; color: var(--good); border-color: var(--good); }
.stamp.nope { right: 16px; color: var(--accent); border-color: var(--accent); transform: rotate(12deg); }

.swipe-buttons { display: flex; gap: 44px; }
.round {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 1.6rem;
  cursor: pointer;
  background: var(--panel);
  backdrop-filter: blur(8px);
  transition: transform 0.15s, filter 0.15s;
}
.round.like { color: var(--good); }
.round.nope { color: var(--accent); }
.round:hover { transform: scale(1.1); filter: brightness(1.2); }

#results { display: flex; flex-direction: column; gap: 12px; width: 100%; }
#results .game-result {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  text-align: left;
  animation: fadein 0.3s ease;
}
#results img { width: 100%; display: block; }
#results .gname { padding: 12px 16px; font-weight: 600; }

#match-modal {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 22, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  backdrop-filter: blur(4px);
}
.match-inner {
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 30px;
  text-align: center;
  max-width: 380px;
  width: 90%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: pop 0.3s ease;
}
@keyframes pop {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}
.match-inner h2 {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 1.8rem;
}
.match-inner img { width: 100%; border-radius: 12px; }
.match-inner p { font-weight: 600; font-size: 1.1rem; }

#toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--panel-solid);
  border: 1px solid var(--accent);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 12px;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  max-width: 90%;
  font-size: 0.9rem;
}
#toast.show { opacity: 1; }

@media (max-width: 480px) {
  .logo.big { font-size: 2.4rem; }
  .steps { flex-direction: column; }
  .step { flex-direction: row; text-align: left; }
}
