:root{
  --card-bg: rgba(10, 10, 14, 0.70);
  --text: #f2f2f2;
  --muted: rgba(255,255,255,0.75);
  --border: rgba(255,255,255,0.12);
  --accent: #3a7afe;
  --danger: #e45454;
}

html, body { height: 100%; }

body{
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);

  background-image: url("/Images/lobby.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #0f1116;

  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 24px 14px;
  box-sizing: border-box;
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center,
    rgba(0,0,0,0.15) 20%,
    rgba(0,0,0,0.65) 100%);
  pointer-events: none;
}

.card{
  position: relative;
  width: 100%;
  max-width: 420px;
  padding: 20px;

  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.45);
  text-align: center;
}

h2{
  margin: 6px 0 6px;
  font-size: 28px;
  letter-spacing: 0.5px;
}
.portrait{
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
  flex-shrink: 0;
}
.hint{
  margin: 0 0 14px;
  opacity: 0.85;
  font-size: 14px;
  line-height: 1.3;
}

label{
  display: block;
  text-align: left;
  margin: 12px 0 6px;
  font-size: 13px;
  opacity: 0.85;
}

input{
  width: 100%;
  box-sizing: border-box;
  font-size: 18px;
  padding: 14px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  outline: none;

  background: rgba(255,255,255,0.06);
  color: var(--text);
}

input::placeholder{ color: rgba(255,255,255,0.45); }

input:focus{
  border-color: rgba(58,122,254,0.8);
  box-shadow: 0 0 0 3px rgba(58,122,254,0.25);
}

button{
  width: 100%;
  font-size: 20px;
  padding: 14px;
  margin-top: 12px;
  border-radius: 10px;
  border: none;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button.secondary{
  background: rgba(255,255,255,0.14);
  font-weight: 700;
  font-size: 16px;
}

button.danger{
  background: var(--danger);
}

button:active{ transform: scale(0.98); }

.small{
  margin-top: 10px;
  font-size: 12px;
  opacity: 0.75;
}

.status{
  margin: 14px 0;
  font-size: 16px;
  opacity: 0.9;
}

.waiting{
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse{
  0% { opacity: 0.4; }
  50%{ opacity: 1; }
  100%{ opacity: 0.4; }
}

/* Lobby grid */
.grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.char{
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  text-align: left;
}

.charHead{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.charText{
  flex: 1;
  min-width: 0;
}

.char .name{
  font-weight: 800;
  letter-spacing: 0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char .meta{
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.75;
}

.char .level{
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.9;
}

.char button{
  margin-top: 10px;
  font-size: 16px;
  padding: 10px;
}

.char.taken{
  opacity: 0.55;
}

.char.selected{
  outline: 2px solid rgba(58,122,254,0.9);
}
.roomline{
  margin-top: 6px;
  margin-bottom: 12px;
  font-size: 16px;
  opacity: 0.95;
}

.roomcode{
  position: relative;
  display: inline-block;
  padding: 6px 12px;
  margin: 10px 6px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  border-radius: 10px;
  isolation: isolate;
}

.roomcode::before{
  content:"";
  position:absolute;
  inset:-10px -14px -10px -14px;
  z-index:-1;
  border-radius: 18px;
  filter: blur(0.6px) saturate(1.2);
  opacity: 0.92;

  /* “blood-ish” layered blobs */
  background:
    radial-gradient(18px 14px at 18% 30%, rgba(150,0,10,0.95) 0 60%, transparent 62%),
    radial-gradient(22px 18px at 35% 70%, rgba(120,0,10,0.92) 0 58%, transparent 60%),
    radial-gradient(16px 16px at 62% 42%, rgba(170,0,18,0.92) 0 60%, transparent 62%),
    radial-gradient(26px 20px at 78% 62%, rgba(110,0,8,0.92) 0 58%, transparent 60%),
    radial-gradient(14px 10px at 86% 28%, rgba(200,0,20,0.90) 0 62%, transparent 64%),
    linear-gradient(135deg, rgba(90,0,6,0.92), rgba(160,0,18,0.92));
  box-shadow:
    0 10px 30px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.08) inset;
}

.roomcode::after{
  content:"";
  position:absolute;
  left: 10%;
  right: 10%;
  bottom:-8px;
  height: 10px;
  z-index:-2;
  border-radius: 0 0 12px 12px;
  background: radial-gradient(closest-side, rgba(140,0,14,0.55), transparent);
  filter: blur(3px);
  opacity: 0.8;
}
.playersList{
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.playerRow{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06) inset;
  backdrop-filter: blur(6px);
}

.playerLeft{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.playerDot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
  flex: 0 0 auto;
}

.playerName{
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playerMeta{
  opacity: 0.78;
  font-size: 12px;
  margin-left: 6px;
  white-space: nowrap;
}

.playerRight{
  opacity: 0.85;
  font-size: 12px;
  white-space: nowrap;
  margin-left: 10px;
}

.playerRow.isSelf{
  box-shadow:
    0 0 0 1px
}
button:disabled{
  opacity: 0.45;
  cursor: not-allowed;
  filter: saturate(0.6);
}

/* Create modal */
.modalOverlay{
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: 18px;
  box-sizing: border-box;
}

.modalCard{
  width: min(520px, 94vw);
  background: rgba(16,18,26,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.55);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modalHeader{
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.modalTitle{ font-size: 18px; font-weight: 800; }
.modalSub{ font-size: 13px; opacity: 0.75; margin-top: 4px; }

.modalClose{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.modalClose:hover{
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.26);
}

.modalBody{
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.modalPortrait{
  width: 120px;
  height: 140px;
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  background-size: cover;
  background-position: center;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset;
}

.modalFields{ display: flex; flex-direction: column; gap: 8px; }
.modalLabel{ font-size: 13px; opacity: 0.8; text-align: left; }
.modalActionsRow{ display: flex; gap: 8px; }

.modalFooter{
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
/* =========================
   START OVERLAY (center modal)
   ========================= */

.startOverlay{
  position: fixed;
  inset: 0;
  z-index: 5000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 22px;
  box-sizing: border-box;

  /* darken + blur the world */
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.startOverlayCard{
  width: min(520px, 92vw);
  border-radius: 18px;
  padding: 22px 18px;

  background: rgba(12, 12, 18, 0.88);
  box-shadow: 0 24px 70px rgba(0,0,0,0.65);
  border: 1px solid rgba(255,255,255,0.14);

  text-align: center;
}

.startOverlayTitle{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.startOverlaySub{
  opacity: 0.85;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 16px;
}

/* Big shiny button base (you can glam later) */
.startOverlayBtn{
  width: 100%;
  font-size: 22px;
  padding: 16px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.12);
  background: var(--accent);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.startOverlayBtn:disabled{
  opacity: 0.55;
  cursor: not-allowed;
}
.startOverlayRetreat{
  margin-top: 12px;
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 12px;

  background: transparent;
  color: rgba(255,255,255,0.85);
  border: 1px dashed rgba(255,255,255,0.25);

  cursor: pointer;
}

.startOverlayRetreat:hover{
  background: rgba(255,255,255,0.06);
}
.playerMid { display: flex; gap: 10px; align-items: center; }
.playerPick { opacity: 0.9; font-size: 14px; }
.pill { padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.pillAwake { background: rgba(255,255,255,0.10); }
.pillReady { background: rgba(80,200,120,0.22); border: 1px solid rgba(80,200,120,0.40); }


.tagline {
    margin-top: 1.25em;
    font-size: 0.9em;
    opacity: 0.8;
}