/* =========================
   HOME — 1920×1080 fixed title screen
   No s0 background · no responsive reflow
========================= */

.home-screen {
  position: absolute;
  left: 0;
  top: 0;
  width: 1920px;
  height: 1080px;
  display: block;
  overflow: hidden;
  background: #02060f;
  color: #eefcff;
}

/* --- layered title background --- */

.home-bg-base,
.home-bg-glow,
.home-bg-noise,
.home-bg-scanlines,
.home-bg-circuit,
.home-bg-symbols {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.home-bg-base {
  background:
    radial-gradient(circle at 50% 42%, rgba(32, 118, 210, 0.22) 0%, transparent 46%),
    radial-gradient(circle at 18% 78%, rgba(18, 62, 120, 0.16) 0%, transparent 34%),
    radial-gradient(circle at 82% 22%, rgba(24, 72, 140, 0.12) 0%, transparent 30%),
    linear-gradient(180deg, #030810 0%, #050d18 42%, #02060f 100%);
}

.home-bg-glow {
  background:
    radial-gradient(ellipse 720px 520px at 50% 46%, rgba(56, 189, 248, 0.14), transparent 72%),
    radial-gradient(ellipse 420px 300px at 28% 58%, rgba(37, 99, 235, 0.1), transparent 70%);
  filter: blur(2px);
}

.home-bg-noise {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

.home-bg-scanlines {
  opacity: 0.07;
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05) 0,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1px,
    transparent 4px
  );
}

.home-bg-circuit {
  opacity: 0.14;
  background:
    linear-gradient(90deg, transparent 0 49.5%, rgba(56, 189, 248, 0.08) 49.5%, transparent 50.5%),
    linear-gradient(0deg, transparent 0 49.5%, rgba(56, 189, 248, 0.06) 49.5%, transparent 50.5%),
    radial-gradient(circle at 12% 18%, rgba(56, 189, 248, 0.12) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 72%, rgba(56, 189, 248, 0.1) 0 2px, transparent 3px),
    radial-gradient(circle at 72% 14%, rgba(56, 189, 248, 0.08) 0 1px, transparent 2px);
  background-size: 120px 120px, 120px 120px, 100% 100%, 100% 100%, 100% 100%;
}

.home-bg-symbols {
  font-size: 28px;
  font-weight: 900;
  color: rgba(126, 231, 255, 0.07);
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.12);
}

.home-bg-symbols span {
  position: absolute;
}

.home-bg-symbols span:nth-child(1) { left: 8%; top: 12%; font-size: 34px; }
.home-bg-symbols span:nth-child(2) { left: 22%; top: 8%; font-size: 22px; }
.home-bg-symbols span:nth-child(3) { left: 74%; top: 10%; font-size: 30px; }
.home-bg-symbols span:nth-child(4) { left: 14%; top: 72%; font-size: 22px; }
.home-bg-symbols span:nth-child(5) { left: 86%; top: 68%; font-size: 32px; }

.home-lock-deco {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid rgba(126, 231, 255, 0.14);
  border-radius: 6px;
  opacity: 0.35;
  pointer-events: none;
}

.home-lock-deco::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -10px;
  width: 12px;
  height: 10px;
  border: 2px solid rgba(126, 231, 255, 0.14);
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.home-lock-deco-1 { left: 120px; top: 90px; }
.home-lock-deco-2 { right: 140px; top: 120px; transform: scale(0.85); }
.home-lock-deco-3 { left: 260px; bottom: 260px; transform: scale(0.75); opacity: 0.25; }
.home-lock-deco-4 { right: 320px; bottom: 300px; transform: scale(0.7); opacity: 0.22; }

/* --- math decoration zone (title right ↔ buttons left) --- */

.math-decoration-zone {
  position: absolute;
  left: calc(600px + 3cm);
  top: 220px;
  width: 620px;
  height: 520px;
  z-index: 1;
  box-sizing: border-box;
  background: transparent;
  pointer-events: none;
  overflow: visible;
}

/* 사진 속 빨간 테두리 6곳 위치 */
.math-glyph-pos-b { left: calc(83% + 1cm); top: 25%; }  /* 3/4 — 오른쪽 위 */
.math-glyph-pos-d { left: 35%; top: 20%; }  /* +   — 위쪽 중앙 */
.math-glyph-pos-a { left: 18%; top: 46%; }  /* 1/2 — 왼쪽 중앙 */
.math-glyph-pos-e { left: 66%; top: 50%; }  /* −   — 오른쪽 중앙 */
.math-glyph-pos-c { left: 40%; top: 88%; }  /* 5/6 — 아래 중앙 */
.math-glyph-pos-f { left: 76%; top: 94%; }  /* =   — 오른쪽 아래 */

.floating-fraction,
.floating-op {
  position: absolute;
  pointer-events: none;
  will-change: opacity, transform;
  transform: translate(-50%, -50%);
}

.floating-fraction {
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: visible;
  color: rgba(140, 245, 255, 0.92);
  font-weight: 800;
  font-size: 44px;
  line-height: 1;
  opacity: 0.48;
  text-shadow:
    0 0 10px rgba(80, 220, 255, 0.55),
    0 0 22px rgba(80, 220, 255, 0.3);
}

.floating-fraction .frac-num,
.floating-fraction .frac-den {
  display: block;
  flex: 0 0 auto;
  font-size: 44px;
  line-height: 1;
}

.floating-fraction .frac-bar {
  display: block;
  flex: 0 0 auto;
  width: 54px;
  height: 4px;
  margin: 5px 0;
  background: rgba(140, 240, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(80, 220, 255, 0.6);
  opacity: 1;
}

.floating-op {
  font-size: 50px;
  font-weight: 900;
  line-height: 1;
  color: rgba(140, 245, 255, 0.9);
  opacity: 0.46;
  text-shadow:
    0 0 10px rgba(80, 220, 255, 0.55),
    0 0 20px rgba(80, 220, 255, 0.28);
}

.home-glyph-float-a {
  animation:
    homeGlyphTwinkle 8s ease-in-out infinite,
    homeGlyphFloatA 9s ease-in-out infinite;
  animation-delay: var(--glyph-delay, 0s), 0s;
}

.home-glyph-float-b {
  animation:
    homeGlyphTwinkle 7s ease-in-out infinite,
    homeGlyphFloatB 10s ease-in-out infinite;
  animation-delay: var(--glyph-delay, 0s), 1.4s;
}

.home-glyph-float-c {
  animation:
    homeGlyphTwinkle 9s ease-in-out infinite,
    homeGlyphFloatC 8s ease-in-out infinite;
  animation-delay: var(--glyph-delay, 0s), 2.2s;
}

.home-glyph-float-d {
  animation:
    homeGlyphTwinkle 7.5s ease-in-out infinite,
    homeGlyphFloatD 8.5s ease-in-out infinite;
  animation-delay: var(--glyph-delay, 0s), 0.8s;
}

.home-glyph-float-e {
  animation:
    homeGlyphTwinkle 8.5s ease-in-out infinite,
    homeGlyphFloatE 9.5s ease-in-out infinite;
  animation-delay: var(--glyph-delay, 0s), 1.8s;
}

.home-glyph-float-f {
  animation:
    homeGlyphTwinkle 7s ease-in-out infinite,
    homeGlyphFloatF 11s ease-in-out infinite;
  animation-delay: var(--glyph-delay, 0s), 3s;
}

@keyframes homeGlyphTwinkle {
  0%, 100% {
    opacity: 0.38;
  }
  50% {
    opacity: 0.62;
  }
}

@keyframes homeGlyphFloatA {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  50% { transform: translate(-50%, -50%) translate(6px, -14px); }
}

@keyframes homeGlyphFloatB {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  50% { transform: translate(-50%, -50%) translate(8px, -12px); }
}

@keyframes homeGlyphFloatC {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  50% { transform: translate(-50%, -50%) translate(-6px, -16px); }
}

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

@keyframes homeGlyphFloatE {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  50% { transform: translate(-50%, -50%) translate(-8px, -14px); }
}

@keyframes homeGlyphFloatF {
  0%, 100% { transform: translate(-50%, -50%) translate(0, 0); }
  50% { transform: translate(-50%, -50%) translate(7px, -12px); }
}

/* --- title block --- */

.home-title-block {
  position: absolute;
  left: 150px;
  top: 150px;
  width: 1000px;
  z-index: 5;
}

.home-title-block::before {
  content: "";
  position: absolute;
  left: -18px;
  top: -14px;
  width: 4px;
  height: calc(100% + 28px);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.1), rgba(56, 189, 248, 0.85), rgba(56, 189, 248, 0.1));
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.45);
}

.home-title-block::after {
  content: "";
  position: absolute;
  left: -8px;
  top: -8px;
  right: -8px;
  bottom: -8px;
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-left: none;
  border-radius: 0 12px 12px 0;
  pointer-events: none;
  box-shadow: inset 0 0 40px rgba(56, 189, 248, 0.04);
}

.home-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(111, 226, 255, 0.38);
  background: rgba(4, 22, 40, 0.72);
  color: #8eefff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.16em;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.12);
}

.game-title,
.title-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin: 18px 0 10px;
  color: #ffffff;
  font-size: 56px;
  line-height: 1.12;
  font-weight: 950;
  letter-spacing: -0.02em;
  white-space: normal;
  text-shadow:
    0 0 28px rgba(104, 224, 255, 0.32),
    0 4px 22px rgba(0, 0, 0, 0.5);
}

.game-title-lead {
  display: block;
  font-size: calc(56px * 2 / 3);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: rgba(232, 246, 255, 0.92);
  text-shadow:
    0 0 18px rgba(104, 224, 255, 0.22),
    0 2px 12px rgba(0, 0, 0, 0.4);
}

.game-title-focus {
  display: block;
  font-size: 56px;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.game-subtitle {
  margin: 16px 0 0;
  color: rgba(224, 244, 255, 0.9);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* --- account / profile --- */

.home-account-area {
  position: absolute;
  right: 120px;
  top: 36px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.home-server-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  color: rgba(210, 228, 240, 0.62);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  user-select: none;
}

.home-server-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(180, 196, 210, 0.55);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.04);
}

.home-server-status.is-ok .home-server-status-dot {
  background: #3dcd87;
}

.home-server-status.is-bad .home-server-status-dot {
  background: #e08a3c;
}

.home-server-status.is-pending .home-server-status-dot {
  background: rgba(180, 196, 210, 0.55);
}

.home-profile-wrap {
  position: relative;
}

.home-profile-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 168px;
  min-height: 52px;
  box-sizing: border-box;
  padding: 8px 14px 8px 16px;
  border-radius: 14px;
  border: 1px solid rgba(125, 213, 255, 0.22);
  background: rgba(4, 16, 28, 0.72);
  color: #eef8ff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.home-profile-btn:hover,
.home-profile-btn:focus-visible {
  border-color: rgba(116, 231, 255, 0.62);
  background: rgba(8, 28, 46, 0.88);
  box-shadow: 0 0 0 1px rgba(88, 210, 255, 0.12);
  outline: none;
}

.home-profile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-profile-name {
  display: block;
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-weight: 850;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.home-profile-role {
  display: block;
  color: rgba(188, 214, 230, 0.72);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.home-profile-caret {
  margin-left: auto;
  color: rgba(176, 214, 232, 0.7);
  font-size: 10px;
  line-height: 1;
}

.home-profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 220px;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid rgba(120, 180, 220, 0.22);
  background: rgba(10, 22, 40, 0.96);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.34);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.home-profile-menu.hidden {
  display: none;
}

.home-profile-item {
  appearance: none;
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: rgba(232, 246, 255, 0.92);
  font-family: inherit;
  font-size: 14px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.home-profile-item:hover,
.home-profile-item:focus-visible {
  background: rgba(56, 140, 220, 0.22);
  color: #ffffff;
  outline: none;
}

.home-profile-item.is-danger {
  margin-top: 4px;
  border-top: 1px solid rgba(140, 180, 210, 0.16);
  border-radius: 0 0 10px 10px;
  padding-top: 8px;
  color: rgba(255, 198, 198, 0.92);
}

.home-profile-item.is-danger:hover,
.home-profile-item.is-danger:focus-visible {
  background: rgba(180, 70, 70, 0.18);
  color: #ffd4d4;
}

.home-continue-btn.is-disabled,
.home-continue-btn:disabled,
.home-primary-btn.is-disabled,
.home-primary-btn:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none !important;
  filter: none !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 10px rgba(56, 189, 248, 0.04) !important;
  border-color: rgba(116, 224, 255, 0.28) !important;
  color: rgba(210, 236, 246, 0.78);
}

.home-continue-btn.is-disabled:hover,
.home-continue-btn:disabled:hover,
.home-continue-btn.is-disabled:focus-visible,
.home-continue-btn:disabled:focus-visible,
.home-primary-btn.is-disabled:hover,
.home-primary-btn:disabled:hover,
.home-primary-btn.is-disabled:focus-visible,
.home-primary-btn:disabled:focus-visible {
  transform: none;
  border-color: rgba(116, 224, 255, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 0 10px rgba(56, 189, 248, 0.04);
}

.home-primary-btn.is-disabled,
.home-primary-btn:disabled {
  background: linear-gradient(180deg, rgba(140, 190, 220, 0.55), rgba(70, 120, 170, 0.55) 58%, rgba(50, 90, 140, 0.62));
  color: rgba(230, 244, 255, 0.82);
}

.home-confirm-card .auth-subtitle {
  white-space: normal;
}

/* --- robok + dialogue bubble --- */

.home-robok-scene {
  position: absolute;
  left: 150px;
  top: 500px;
  width: 620px;
  height: 260px;
  z-index: 5;
}

.home-robok {
  position: absolute;
  left: 0;
  top: 0;
  width: 240px;
  height: 240px;
  object-fit: contain;
  object-position: center bottom;
  display: block;
  filter:
    drop-shadow(0 20px 28px rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 22px rgba(116, 224, 255, 0.28));
}

.home-robok-bubble {
  position: absolute;
  left: 268px;
  top: 36px;
  width: max-content;
  max-width: 520px;
  box-sizing: border-box;
  padding: 20px 22px;
  border: 1px solid rgba(137, 232, 255, 0.42);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(6, 22, 38, 0.94), rgba(3, 14, 26, 0.92));
  color: #e9fbff;
  font-size: 30px;
  font-weight: 850;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 24px rgba(56, 189, 248, 0.1);
}

.home-robok-bubble::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 58px;
  width: 22px;
  height: 22px;
  background: rgba(4, 17, 30, 0.92);
  border-left: 1px solid rgba(137, 232, 255, 0.42);
  border-bottom: 1px solid rgba(137, 232, 255, 0.42);
  transform: rotate(45deg);
}

.home-robok-bubble-label {
  display: block;
  margin-bottom: 8px;
  color: #8eefff;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

/* --- buttons --- */

.home-buttons {
  position: absolute;
  right: calc(180px + 2cm);
  top: calc(330px + 3cm);
  width: 340px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

/* Logged-in play menus: vertical stack, lowered toward robok bubble. */
.home-buttons--teacher,
.home-buttons--student {
  top: calc(330px + 3cm + 145px);
  width: 286px;
  right: calc(180px + 2cm + 27px);
  gap: 12px;
  align-items: stretch;
}

.home-buttons--teacher .home-primary-btn,
.home-buttons--student .home-primary-btn {
  width: 100%;
  height: 52px;
  border-radius: 14px;
  font-size: 19px;
  font-weight: 900;
  white-space: nowrap;
  background: linear-gradient(180deg, #58cff0, #2b93e6 58%, #2268e6);
  box-shadow:
    0 10px 20px rgba(39, 150, 255, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.48);
}

.home-buttons--teacher .home-continue-btn,
.home-buttons--student .home-continue-btn {
  width: 100%;
  height: 44px;
  margin-top: -2px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 850;
  white-space: nowrap;
  background: rgba(8, 32, 54, 0.82);
  border: 1px solid rgba(116, 224, 255, 0.4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.home-role-hint {
  margin: 0;
  padding: 0 2px;
  color: rgba(210, 236, 250, 0.9);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  letter-spacing: -0.01em;
}

/* Align guest 「로그인」 with logged-in 「새 게임 시작」 top and width. */
.home-buttons--guest {
  top: calc(330px + 3cm + 145px);
  width: 286px;
  right: calc(180px + 2cm + 27px);
}

.home-buttons--guest .home-primary-btn {
  width: 100%;
}

.home-judge-btn {
  width: 100%;
  height: 52px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid rgba(116, 190, 220, 0.42);
  background: linear-gradient(180deg, rgba(28, 68, 98, 0.92), rgba(14, 42, 68, 0.94));
  color: #d7eefc;
  font-size: 16px;
  font-weight: 850;
  letter-spacing: -0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 8px 18px rgba(20, 60, 90, 0.22);
}

.home-judge-btn-icon {
  display: inline-flex;
  color: #7ec8e8;
}

.home-judge-btn:hover,
.home-judge-btn:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(130, 210, 235, 0.55);
  color: #eef9ff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 0 18px rgba(80, 170, 210, 0.18);
}

.home-buttons button {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.01em;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    filter 0.16s ease,
    border-color 0.16s ease;
}

.home-primary-btn {
  width: 340px;
  height: 72px;
  border-radius: 18px;
  background: linear-gradient(180deg, #72eaff, #2fa6ff 58%, #2268e6);
  color: #031527;
  font-size: 24px;
  font-weight: 950;
  box-shadow:
    0 18px 38px rgba(39, 150, 255, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 0 28px rgba(105, 232, 255, 0.28);
}

.home-continue-btn {
  width: 340px;
  height: 60px;
  border-radius: 16px;
  background: rgba(6, 28, 48, 0.88);
  border: 1px solid rgba(116, 224, 255, 0.46);
  color: #dffaff;
  font-size: 20px;
  font-weight: 900;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(56, 189, 248, 0.08);
}

.home-sub-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 0;
  width: 100%;
  box-sizing: border-box;
}

.home-sub-buttons--teacher {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  margin-left: 0;
  gap: 9px;
}

.home-sub-buttons--student {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: 100%;
  max-width: none;
  gap: 9px;
}

.home-buttons--teacher .home-small-btn,
.home-buttons--student .home-small-btn {
  height: 38px;
  padding: 0 6px;
  border-radius: 11px;
  font-size: 14px;
  font-weight: 800;
}

.home-small-btn {
  height: 48px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(125, 213, 255, 0.28);
  color: rgba(226, 246, 255, 0.92);
  font-size: 15px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.home-primary-btn:hover,
.home-primary-btn:focus-visible {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow:
    0 22px 44px rgba(39, 150, 255, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    0 0 36px rgba(105, 232, 255, 0.38);
}

.home-continue-btn:hover,
.home-continue-btn:focus-visible,
.home-small-btn:hover,
.home-small-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(116, 231, 255, 0.72);
  box-shadow:
    0 0 28px rgba(105, 232, 255, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* --- stage preview cards --- */

.home-stage-preview {
  position: absolute;
  left: 150px;
  bottom: 80px;
  width: 1620px;
  height: 140px;
  z-index: 4;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 20px;
  overflow: visible;
}

.home-stage-card {
  position: relative;
  width: 250px;
  height: 140px;
  flex: 0 0 250px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(123, 223, 255, 0.28);
  background: #061018 center / cover no-repeat;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.home-stage-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0.05) 38%, rgba(0, 0, 0, 0.82) 100%),
    radial-gradient(circle at 50% 18%, rgba(91, 221, 255, 0.1), transparent 58%);
  z-index: 1;
  pointer-events: none;
}

.home-stage-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-stage-card-label {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.home-stage-card-label strong {
  color: #8eefff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
}

.home-stage-card-label span {
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.75);
}

.home-stage-lock {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(210, 238, 255, 0.24);
  color: rgba(232, 245, 255, 0.88);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  letter-spacing: 0.1em;
}

.home-stage-card:hover {
  transform: translateY(-8px);
  border-color: rgba(116, 231, 255, 0.82);
  box-shadow:
    0 22px 40px rgba(0, 0, 0, 0.46),
    0 0 28px rgba(94, 224, 255, 0.34);
}

/* --- message --- */

.home-message {
  position: absolute;
  left: 150px;
  top: 780px;
  width: 560px;
  min-height: 28px;
  margin: 0;
  z-index: 5;
  color: rgba(255, 255, 255, 0.82);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
}

/* =========================
   AUTH MODAL
========================= */

.auth-modal {
  position: absolute;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal.hidden {
  display: none;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 18, 0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.auth-card {
  position: relative;
  z-index: 2;
  width: 440px;
  padding: 28px 28px 24px;
  border-radius: 24px;
  background: linear-gradient(
    180deg,
    rgba(10, 22, 36, 0.96) 0%,
    rgba(16, 31, 48, 0.96) 100%
  );
  border: 1px solid rgba(114, 212, 255, 0.24);
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  color: white;
}

.auth-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #dff6ff;
  font-size: 22px;
  cursor: pointer;
}

.auth-title {
  font-size: 34px;
  font-weight: 900;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.auth-subtitle {
  font-size: 16px;
  line-height: 1.5;
  color: rgba(222, 241, 255, 0.84);
  margin-bottom: 18px;
}

.role-select {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.role-btn {
  flex: 1;
  padding: 12px 0;
  border: 1px solid rgba(110, 195, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #dcefff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.role-btn.active {
  background: linear-gradient(135deg, #4a94ff, #2c65df);
  border-color: rgba(110, 195, 255, 0.5);
  box-shadow: 0 10px 20px rgba(44, 101, 223, 0.28);
  color: #ffffff;
}

.auth-label {
  display: block;
  margin-bottom: 8px;
  margin-top: 12px;
  font-size: 15px;
  font-weight: 700;
  color: #dff6ff;
}

.auth-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border: 1px solid rgba(113, 190, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 16px;
  outline: none;
}

.auth-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.auth-input:focus {
  border-color: rgba(114, 212, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(80, 178, 255, 0.12);
}

.auth-nickname-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.auth-nickname-check-btn {
  min-width: 92px;
  border: 1px solid rgba(114, 212, 255, 0.38);
  border-radius: 14px;
  background: rgba(74, 148, 255, 0.18);
  color: #dff6ff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.auth-help {
  margin: 7px 2px 0;
  color: rgba(222, 241, 255, 0.7);
  font-size: 13px;
  line-height: 1.45;
}

.auth-nickname-status {
  min-height: 20px;
  margin: 3px 2px 0;
  color: rgba(222, 241, 255, 0.78);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.auth-nickname-status.is-success {
  color: #86e8bb;
}

.auth-nickname-status.is-error {
  color: #ff9b9b;
}

.auth-primary-btn:disabled,
.auth-nickname-check-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
  box-shadow: none;
}

.auth-error {
  min-height: 22px;
  margin-top: 12px;
  color: #ff8b8b;
  font-size: 14px;
  font-weight: 700;
}

.auth-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.auth-primary-btn,
.auth-secondary-btn {
  border: none;
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.auth-primary-btn {
  background: linear-gradient(135deg, #4a94ff, #2c65df);
  color: white;
  box-shadow: 0 10px 20px rgba(44, 101, 223, 0.28);
}

.auth-secondary-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #dcefff;
}

.auth-password-wrap {
  position: relative;
  margin-bottom: 2px;
}

.auth-input-password {
  padding-right: 54px;
}

.auth-toggle-password {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #dff6ff;
  font-size: 16px;
  cursor: pointer;
}

/* =========================
   JUDGE ENTER PANEL (심사위원용 입장)
========================= */

#judge-enter-modal.judge-enter-modal {
  align-items: center;
  justify-content: center;
}

#judge-enter-modal .judge-enter-backdrop {
  background: rgba(4, 12, 22, 0.58);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#judge-enter-modal:not(.hidden) .judge-enter-backdrop {
  animation: judge-enter-backdrop-in 200ms ease-out both;
}

#judge-enter-modal .judge-enter-panel {
  box-sizing: border-box;
  width: 540px;
  max-width: calc(100% - 48px);
  padding: 30px 32px 28px;
  border-radius: 18px;
  border: 1px solid rgba(120, 200, 225, 0.38);
  background: linear-gradient(180deg, rgba(28, 58, 88, 0.96) 0%, rgba(18, 42, 68, 0.97) 100%);
  box-shadow: 0 16px 36px rgba(2, 10, 20, 0.34);
  overflow: hidden;
}

#judge-enter-modal:not(.hidden) .judge-enter-panel {
  animation: judge-enter-panel-in 200ms ease-out both;
}

#judge-enter-modal .judge-enter-close {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(150, 190, 215, 0.32);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(236, 246, 255, 0.95);
  font-size: 26px;
  line-height: 1;
}

#judge-enter-modal .judge-enter-close:hover,
#judge-enter-modal .judge-enter-close:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(160, 210, 230, 0.45);
}

#judge-enter-modal .judge-enter-title {
  margin: 0;
  padding-right: 48px;
  color: #ffffff;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

#judge-enter-modal .judge-enter-lead {
  margin: 12px 0 0;
  color: rgba(236, 244, 250, 0.94);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
}

#judge-enter-modal .judge-enter-card {
  margin-top: 20px;
  padding: 17px 19px;
  border-radius: 13px;
  border: 1px solid rgba(130, 205, 225, 0.55);
  background: linear-gradient(180deg, #eef7fc 0%, #e4f1f8 100%);
}

#judge-enter-modal .judge-enter-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #163a58;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

#judge-enter-modal .judge-enter-card-icon {
  flex: 0 0 auto;
  width: 20px;
  text-align: center;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

#judge-enter-modal .judge-enter-card-row.is-allow .judge-enter-card-icon {
  color: #1aa0b8;
}

#judge-enter-modal .judge-enter-card-row.is-limit .judge-enter-card-icon {
  color: #b57a3a;
}

#judge-enter-modal .judge-enter-card-divider {
  height: 1px;
  margin: 12px 0;
  background: rgba(70, 120, 150, 0.18);
}

#judge-enter-modal .judge-enter-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  color: rgba(198, 222, 238, 0.95);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
}

#judge-enter-modal .judge-enter-note-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid rgba(170, 210, 230, 0.55);
  color: rgba(200, 228, 242, 0.95);
  font-size: 10px;
  font-weight: 900;
  font-style: normal;
  line-height: 14px;
  text-align: center;
}

#judge-enter-modal .judge-enter-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

#judge-enter-modal .judge-enter-cancel,
#judge-enter-modal .judge-enter-confirm {
  width: auto;
  min-width: 0;
  height: 41px;
  padding: 0 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

#judge-enter-modal .judge-enter-cancel {
  width: 106px;
  border: 1px solid rgba(170, 205, 225, 0.55);
  background: rgba(48, 84, 118, 0.88);
  color: #ffffff;
  box-shadow: none;
}

#judge-enter-modal .judge-enter-cancel:hover,
#judge-enter-modal .judge-enter-cancel:focus-visible {
  border-color: rgba(185, 220, 240, 0.7);
  background: rgba(56, 96, 132, 0.95);
}

#judge-enter-modal .judge-enter-confirm {
  width: 106px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(180deg, #4eb4ef 0%, #2f8fd8 58%, #2474c4 100%);
  color: #ffffff;
  box-shadow:
    0 10px 20px rgba(36, 110, 180, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#judge-enter-modal .judge-enter-confirm:hover,
#judge-enter-modal .judge-enter-confirm:focus-visible {
  filter: brightness(1.04);
}

@keyframes judge-enter-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes judge-enter-panel-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Above final-outro-root (z-index 999999) so ending picker is visible */
.reviewer-demo-student-modal {
  z-index: 1000001;
  position: fixed;
  inset: 0;
}

.reviewer-demo-student-panel {
  max-width: 560px;
}

.reviewer-demo-student-current {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.reviewer-demo-student-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 10px;
  max-height: 360px;
  overflow: auto;
}

.reviewer-demo-student-option {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(126, 224, 255, 0.26);
  border-radius: 12px;
  background: rgba(6, 22, 39, 0.68);
  color: #eafaff;
  cursor: pointer;
}

.reviewer-demo-student-option:has(input:checked) {
  border-color: rgba(94, 232, 216, 0.82);
  box-shadow: 0 0 18px rgba(94, 232, 216, 0.18);
}

.reviewer-demo-student-option input {
  grid-row: 1 / span 2;
  accent-color: #5ee8d8;
}

.reviewer-demo-student-name {
  font-weight: 800;
}

.reviewer-demo-student-meta {
  color: rgba(220, 246, 255, 0.72);
  font-size: 12px;
}
