:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: "Noto Sans", "Noto Sans KR", "Noto Sans JP", "Noto Sans Thai", "Noto Sans SC",
    "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

#loading {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 2.6vh, 32px);
  pointer-events: none;
  background:
    radial-gradient(1000px 520px at 50% 12%, rgba(60, 200, 120, 0.12), transparent 68%),
    linear-gradient(180deg, rgba(0, 8, 18, 0.94), rgba(0, 0, 0, 0.98));
  transition: opacity 320ms ease;
}

#loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.loading-stage {
  width: min(92vw, 980px);
  height: min(34vh, 260px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.loading-title-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  z-index: 121;
}

.loading-title-sub {
  margin: 0 0 clamp(14px, 1.8vh, 20px) 0;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 500;
  letter-spacing: 2.2px;
  text-transform: lowercase;
  color: #ecfff6;
  -webkit-text-stroke: 1.2px rgba(0, 0, 0, 0.78);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.95),
    0 2px 0 rgba(0, 0, 0, 0.88),
    0 0 8px rgba(105, 255, 181, 0.42),
    0 0 16px rgba(64, 214, 140, 0.24);
}

.loading-title-main {
  margin: 0 0 clamp(8px, 1.2vh, 16px) 0;
  font-size: clamp(58px, 6.8vw, 96px);
  line-height: 1.03;
  font-weight: 900;
  letter-spacing: 1.2px;
  color: #f7fffb;
  -webkit-text-stroke: 2.4px rgba(0, 0, 0, 0.9);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, 0.95),
    0 4px 0 rgba(0, 0, 0, 0.86),
    0 0 10px rgba(130, 255, 195, 0.76),
    0 0 24px rgba(85, 255, 170, 0.72),
    0 0 54px rgba(45, 255, 148, 0.52),
    0 0 86px rgba(20, 220, 124, 0.34);
}

.chase-track {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(120, 255, 172, 0.28);
  background:
    linear-gradient(180deg, rgba(4, 26, 20, 0.68), rgba(0, 0, 0, 0.48)),
    repeating-linear-gradient(
      90deg,
      rgba(120, 255, 172, 0.03) 0 28px,
      rgba(0, 0, 0, 0.04) 28px 56px
    );
  box-shadow:
    inset 0 0 26px rgba(24, 180, 104, 0.2),
    0 0 30px rgba(28, 255, 122, 0.12);
}

.runner-character,
.seeker-character {
  position: absolute;
  bottom: 38px;
  width: 62px;
  height: 62px;
  background-repeat: no-repeat;
  background-size: contain;
  image-rendering: pixelated;
  transform-origin: 50% 80%;
}

.runner-character {
  background-image: url("./assets/green_character.png");
  animation:
    loadingRunnerDash 2.9s linear infinite,
    loadingRunBounce 0.36s ease-in-out infinite;
}

.seeker-character {
  background-image: url("./assets/red_character.png");
  animation:
    loadingSeekerDash 2.9s linear infinite,
    loadingRunBounce 0.31s ease-in-out infinite;
}

.runner-character .dust,
.seeker-character .dust {
  position: absolute;
  width: 11px;
  height: 11px;
  left: 6px;
  bottom: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(183, 255, 207, 0.86), rgba(89, 205, 131, 0.04) 72%);
  filter: blur(0.2px);
  opacity: 0;
  animation: loadingDustTrail 0.8s linear infinite;
}

.runner-character .dust-1,
.seeker-character .dust-1 {
  animation-delay: 0s;
}

.runner-character .dust-2,
.seeker-character .dust-2 {
  animation-delay: 0.16s;
}

.runner-character .dust-3,
.seeker-character .dust-3 {
  animation-delay: 0.32s;
}

.progress-container {
  position: fixed;
  left: 50%;
  bottom: 74px;
  transform: translateX(-50%);
  width: min(76vw, 700px);
  height: 18px;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid rgba(90, 255, 170, 0.72);
  background: rgba(2, 20, 12, 0.86);
  box-shadow:
    0 0 22px rgba(67, 255, 156, 0.33),
    inset 0 0 12px rgba(66, 205, 125, 0.28);
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3dff9f, #64ffb8, #bcffdb);
  box-shadow:
    0 0 14px rgba(88, 255, 175, 0.75),
    0 0 28px rgba(88, 255, 175, 0.35);
  transition: width 180ms ease-out;
}

.loading-text {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  color: #b8ffd8;
  font-size: 14px;
  letter-spacing: 0.35px;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(84, 255, 166, 0.45);
}

@keyframes loadingRunnerDash {
  0% {
    left: -16%;
  }
  100% {
    left: 116%;
  }
}

@keyframes loadingSeekerDash {
  0% {
    left: -31%;
  }
  100% {
    left: 101%;
  }
}

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

@keyframes loadingDustTrail {
  0% {
    opacity: 0.8;
    transform: translate(0, 0) scale(0.85);
  }
  100% {
    opacity: 0;
    transform: translate(-40px, -6px) scale(1.7);
  }
}

.pre-match-countdown {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 70;
  pointer-events: none;
  font-size: clamp(88px, 18vw, 220px);
  font-weight: 900;
  letter-spacing: 2px;
  color: #ffe14f;
  text-shadow:
    0 0 12px rgba(255, 215, 60, 0.95),
    0 0 28px rgba(255, 185, 34, 0.9),
    0 0 54px rgba(255, 170, 30, 0.85);
  -webkit-text-stroke: 2px rgba(90, 58, 0, 0.45);
  opacity: 0.96;
}

.pre-match-countdown.hidden {
  display: none;
}

.pre-match-countdown.pulse {
  animation: countdownPulse 0.36s ease-out;
}

.settings-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
}

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

.language-modal {
  position: fixed;
  inset: 0;
  z-index: 81;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(2px);
}

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

.privacy-modal {
  position: fixed;
  inset: 0;
  z-index: 82;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}

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

.privacy-panel {
  width: min(94vw, 760px);
  max-height: 86vh;
  overflow: auto;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111;
  color: #ccc;
}

.privacy-title {
  margin: 0;
  font-size: 22px;
  color: #d8d8d8;
}

.privacy-content {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: #ccc;
}

.privacy-content h4,
.privacy-content h5 {
  margin: 16px 0 8px;
  color: #e6e6e6;
}

.privacy-content h4 {
  margin-top: 8px;
  font-size: 18px;
}

.privacy-content h5 {
  font-size: 15px;
}

.privacy-content p {
  margin: 0 0 10px;
}

.privacy-content a {
  color: #9ec7ff;
}

.privacy-content a:hover {
  color: #c1dcff;
}

.terms-modal {
  position: fixed;
  inset: 0;
  z-index: 83;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}

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

.terms-panel {
  width: min(94vw, 760px);
  max-height: 86vh;
  overflow: auto;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111;
  color: #ccc;
}

.terms-title {
  margin: 0;
  font-size: 22px;
  color: #d8d8d8;
}

.terms-content {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: #ccc;
}

.terms-content h4,
.terms-content h5 {
  margin: 16px 0 8px;
  color: #e6e6e6;
}

.terms-content h4 {
  margin-top: 8px;
  font-size: 18px;
}

.terms-content h5 {
  font-size: 15px;
}

.terms-content p {
  margin: 0 0 10px;
}

.howto-modal {
  position: fixed;
  inset: 0;
  z-index: 84;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(2px);
}

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

.howto-panel {
  width: min(94vw, 760px);
  max-height: 86vh;
  overflow: auto;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: #111;
  color: #ccc;
}

.howto-title {
  margin: 0;
  font-size: 22px;
  color: #d8d8d8;
}

.howto-tabs {
  display: flex;
  gap: 8px;
  margin: 10px 0 12px;
}

.howto-tab {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  color: #dbe4ff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.howto-tab.active {
  border-color: rgba(110, 165, 255, 0.95);
  background: rgba(110, 165, 255, 0.26);
}

.howto-content {
  font-size: 14px;
  line-height: 1.7;
  color: #ccc;
}

.howto-content.hidden {
  display: none;
}

.howto-content h4 {
  margin: 8px 0 10px;
  font-size: 18px;
  color: #ececec;
}

.howto-content p {
  margin: 0 0 11px;
}

.controls-grid {
  display: grid;
  gap: 8px;
}

.controls-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.controls-label {
  font-weight: 700;
  color: #e5ecff;
}

.controls-value {
  color: #cdd8f4;
}

.language-panel {
  width: min(92vw, 560px);
  max-height: 86vh;
  overflow: auto;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(9, 13, 22, 0.95);
  color: #eaf0ff;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.language-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  color: #f3f7ff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}

.language-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.language-btn.active {
  border-color: rgba(106, 165, 255, 0.95);
  background: rgba(106, 165, 255, 0.25);
}

.settings-panel {
  width: min(92vw, 560px);
  max-height: 86vh;
  overflow: auto;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(9, 13, 22, 0.95);
  color: #eaf0ff;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.settings-title {
  margin: 0;
  font-size: 20px;
}

.settings-close-btn {
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  color: #eaf0ff;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

.settings-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.settings-section-title {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #cfe0ff;
}

.settings-field {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.key-binding-list {
  display: grid;
  gap: 8px;
}

.key-bind-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.key-bind-label {
  font-size: 13px;
  color: #d4e2ff;
}

.key-bind-btn {
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 7px 10px;
  color: #f3f7ff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.key-bind-btn.waiting {
  border-color: rgba(255, 212, 74, 0.95);
  background: rgba(255, 212, 74, 0.24);
  color: #fff4bf;
  box-shadow: 0 0 0 2px rgba(255, 212, 74, 0.24);
}

@keyframes countdownPulse {
  0% {
    transform: translate(-50%, -50%) scale(1.24);
    opacity: 1;
    filter: saturate(1.35);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.96;
    filter: saturate(1);
  }
}

.menu-layer {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: clamp(44px, 8vh, 88px) 16px 54px;
  background: rgba(8, 10, 15, 0.42);
  backdrop-filter: blur(2px);
}

.menu-layer.hidden {
  display: none;
}

.main-menu-screen {
  width: min(100%, 760px);
  display: grid;
  gap: 18px;
  margin: auto 0;
}

.main-menu-screen.hidden {
  display: none;
}

.service-footer {
  position: static;
  display: grid;
  justify-items: center;
  gap: 8px;
  margin: 0 auto;
  width: min(94vw, 640px);
}

.service-footer.hidden {
  display: none;
}

.service-footer-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 18px;
  border: 0;
  padding: 0;
  background: transparent;
  color: rgba(240, 244, 255, 0.78);
  font-size: 12px;
  line-height: 1.1;
  letter-spacing: 0.4px;
  text-decoration: underline;
  cursor: pointer;
}

.footer-link-btn:hover {
  color: #ffffff;
}

.service-footer-copy {
  font-size: 11px;
  color: rgba(220, 227, 247, 0.72);
}

.service-footer-social {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.service-footer-social a {
  color: rgba(187, 212, 255, 0.78);
  text-decoration: underline;
}

.service-footer-social a:hover {
  color: #d7e8ff;
}

.service-footer-social span {
  color: rgba(210, 220, 240, 0.6);
}

.menu-panel {
  width: min(92vw, 560px);
  margin: 0 auto;
  padding: 26px 24px;
  border-radius: 14px;
  background: rgba(14, 18, 28, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.main-menu-panel {
  min-height: min(64vh, 560px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.main-menu-primary {
  display: grid;
  gap: 14px;
}

.menu-intro-copy {
  margin: 4px 0 8px;
  color: rgba(228, 238, 255, 0.9);
  font-size: 14px;
  line-height: 1.65;
  text-align: center;
}

.site-content-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin-top: 18px;
  justify-content: center;
}

.site-content-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(193, 215, 255, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: #edf4ff;
  text-decoration: none;
  line-height: 1.1;
  box-sizing: border-box;
  font-size: 13px;
  font-weight: 600;
}

.site-content-link:hover {
  background: rgba(255, 255, 255, 0.1);
}

.landing-content {
  display: grid;
  gap: 18px;
}

.home-info-panel {
  width: min(94vw, 760px);
}

.landing-section {
  padding: 18px 18px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-section-title {
  margin: 0 0 12px;
  font-size: 20px;
  color: #f4f7ff;
}

.landing-section p,
.landing-role-block p,
.landing-tip-list li,
.landing-info-list div {
  margin: 0;
  color: rgba(228, 235, 247, 0.92);
  font-size: 14px;
  line-height: 1.8;
}

.landing-section p + p {
  margin-top: 12px;
}

.landing-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.landing-card {
  padding: 14px;
  border-radius: 12px;
  background: rgba(13, 22, 38, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-card h3,
.landing-role-block h3 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #ffffff;
}

.landing-info-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.landing-role-block + .landing-role-block {
  margin-top: 14px;
}

.landing-tip-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.controls-guide-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.controls-guide-layer.hidden {
  display: none;
}

.controls-guide-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.guide-left {
  right: calc(50% + 350px);
  top: calc(50% - 46px);
  align-items: flex-end;
}

.guide-right {
  left: calc(50% + 352px);
  top: calc(50% - 102px);
  align-items: flex-start;
}

.guide-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.guide-space-block,
.guide-shift-block {
  align-items: flex-start;
}

.guide-lantern-block {
  align-items: flex-end;
}

.shift-tap-visual {
  position: relative;
  display: grid;
  place-items: center;
}

.pixel-key-cluster {
  display: grid;
  grid-template-columns: repeat(3, 60px);
  grid-template-rows: repeat(2, 56px);
  gap: 10px;
}

.pixel-key {
  border: 1px solid rgba(210, 225, 255, 0.38);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(154, 179, 226, 0.2), rgba(94, 114, 156, 0.16));
  color: #e7f0ff;
  font-size: 22px;
  font-family: "Courier New", "Consolas", monospace;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: inset 0 -4px 0 rgba(16, 20, 30, 0.55);
}

.pixel-key.empty {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.pixel-key.pixel-key-long {
  min-width: 232px;
  height: 60px;
  padding: 0 20px;
}

.lantern-key-row {
  display: flex;
  gap: 10px;
}

.lantern-key {
  width: 64px;
  height: 56px;
  font-size: 26px;
}

#guideShiftKey {
  position: relative;
  transform-origin: 50% 92%;
  animation: shiftTapPress 0.14s linear infinite;
}

.tap-finger {
  position: absolute;
  width: 32px;
  height: 36px;
  top: -30px;
  left: 50%;
  margin-left: -16px;
  border: 1px solid rgba(220, 230, 255, 0.42);
  border-radius: 10px 10px 12px 12px;
  background: linear-gradient(180deg, rgba(239, 214, 186, 0.95), rgba(193, 159, 129, 0.92));
  image-rendering: pixelated;
  transform-origin: 50% 90%;
  animation: fingerTap 0.14s linear infinite;
  box-shadow:
    inset 0 -3px 0 rgba(88, 58, 38, 0.36),
    0 2px 0 rgba(0, 0, 0, 0.25);
}

.tap-finger::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 6px;
  width: 14px;
  height: 12px;
  border-radius: 4px;
  background: rgba(255, 236, 214, 0.85);
}

.tap-finger::after {
  content: "";
  position: absolute;
  left: 11px;
  top: -5px;
  width: 10px;
  height: 6px;
  border-radius: 4px 4px 2px 2px;
  background: rgba(252, 227, 202, 0.95);
}

.tap-particles {
  position: absolute;
  width: 120px;
  height: 24px;
  left: 50%;
  margin-left: -60px;
  top: 44px;
  pointer-events: none;
}

.tap-particles::before,
.tap-particles::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: rgba(255, 226, 146, 0.95);
  animation: tapParticle 0.14s linear infinite;
  box-shadow:
    10px -2px 0 rgba(255, 226, 146, 0.72),
    -10px 1px 0 rgba(255, 226, 146, 0.72);
}

.tap-particles::before {
  left: 38px;
}

.tap-particles::after {
  right: 38px;
  animation-delay: 0.07s;
}

.guide-action-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(8, 12, 20, 0.5);
}

.guide-action-stack {
  display: grid;
  gap: 5px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(8, 12, 20, 0.56);
  border: 1px solid rgba(211, 225, 255, 0.08);
  text-align: right;
}

.guide-action-text {
  font-size: 12px;
  letter-spacing: 0.6px;
  color: #dce7ff;
  font-family: "Courier New", "Consolas", monospace;
}

.guide-action-title {
  letter-spacing: 0.85px;
}

.guide-action-subtext {
  font-size: 11px;
  letter-spacing: 0.45px;
  color: rgba(219, 231, 255, 0.84);
  font-family: "Courier New", "Consolas", monospace;
}

.pixel-actor {
  width: 22px;
  height: 22px;
  border-radius: 2px;
  image-rendering: pixelated;
  border: 1px solid rgba(220, 230, 255, 0.34);
  background: linear-gradient(180deg, rgba(79, 146, 255, 0.26), rgba(36, 86, 164, 0.22));
  position: relative;
}

.pixel-actor::before,
.pixel-actor::after {
  content: "";
  position: absolute;
  background: #f5f8ff;
}

.pixel-actor.walk::before {
  left: 7px;
  top: 4px;
  width: 8px;
  height: 8px;
}

.pixel-actor.walk::after {
  left: 6px;
  bottom: 4px;
  width: 10px;
  height: 7px;
}

.pixel-actor.catch {
  background: linear-gradient(180deg, rgba(255, 118, 132, 0.28), rgba(178, 55, 77, 0.26));
}

.pixel-actor.catch::before {
  left: 6px;
  top: 4px;
  width: 8px;
  height: 8px;
}

.pixel-actor.catch::after {
  right: 2px;
  top: 10px;
  width: 8px;
  height: 3px;
  background: #ffd8de;
}

.pixel-actor.sprint {
  background: linear-gradient(180deg, rgba(126, 238, 171, 0.3), rgba(52, 137, 94, 0.28));
  transform: skewX(-8deg);
  animation: sprintDash 0.16s linear infinite;
  box-shadow:
    -8px 0 0 rgba(142, 255, 194, 0.28),
    -14px 0 0 rgba(142, 255, 194, 0.16);
}

.pixel-actor.sprint::before {
  left: 10px;
  top: 3px;
  width: 8px;
  height: 8px;
}

.pixel-actor.sprint::after {
  right: 1px;
  bottom: 4px;
  width: 10px;
  height: 5px;
  background: #ccffe3;
}

.guide-hot {
  border-color: rgba(255, 215, 96, 0.95) !important;
  background: linear-gradient(180deg, rgba(255, 210, 84, 0.34), rgba(202, 138, 33, 0.28)) !important;
  color: #fff6ce !important;
  box-shadow: 0 0 0 2px rgba(255, 204, 74, 0.18), inset 0 -1px 0 rgba(35, 22, 3, 0.45) !important;
}

@keyframes fingerTap {
  0%,
  100% {
    transform: translateY(0px) rotate(-1deg);
  }
  40% {
    transform: translateY(8px) rotate(1deg);
  }
}

@keyframes shiftTapPress {
  0%,
  100% {
    transform: translateY(0px) scaleY(1);
  }
  40% {
    transform: translateY(3px) scaleY(0.94);
  }
}

@keyframes tapParticle {
  0%,
  100% {
    opacity: 0.05;
    transform: translateY(0) scale(0.7);
  }
  40% {
    opacity: 0.95;
    transform: translateY(-3px) scale(1);
  }
}

@keyframes sprintDash {
  0%,
  100% {
    transform: translateX(0) skewX(-8deg);
  }
  50% {
    transform: translateX(2px) skewX(-12deg);
  }
}

@media (max-width: 1220px) {
  .controls-guide-layer {
    display: none;
  }
}

#quickMatchPanel {
  width: min(95vw, 980px);
  max-height: 88vh;
  overflow: hidden;
}

.menu-panel.hidden {
  display: none;
}

#mainMenu {
  background: rgba(10, 14, 22, 0.92);
  padding-top: 22px;
  padding-bottom: 22px;
}

.menu-title {
  margin: 0 0 14px 0;
  text-align: center;
  font-size: 34px;
  letter-spacing: 1.1px;
  color: #f3f6ff;
}

.nickname-wrap {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}

.nickname-label {
  font-size: 12px;
  color: #c9d6ff;
  letter-spacing: 0.4px;
}

.nickname-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #eff5ff;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.nickname-input:focus {
  border-color: #6ea5ff;
  box-shadow: 0 0 0 2px rgba(110, 165, 255, 0.2);
}

.menu-subtitle {
  margin: 0 0 16px 0;
  text-align: center;
  color: #f3f6ff;
}

.custom-room-meta-line {
  text-align: center;
  color: rgba(224, 235, 255, 0.9);
  font-size: 13px;
  line-height: 1.35;
}

.role-select-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.role-seeker-btn {
  background: #ff4d4d;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: transform 0.12s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.role-seeker-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 14px rgba(255, 77, 77, 0.34);
}

.role-seeker-btn:active {
  transform: translateY(1px) scale(0.992);
  filter: brightness(0.95);
}

.role-runner-btn {
  background: #4caf50;
  color: #ffffff;
  font-weight: 700;
  letter-spacing: 0.3px;
  transition: transform 0.12s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.role-runner-btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 6px 14px rgba(76, 175, 80, 0.34);
}

.role-runner-btn:active {
  transform: translateY(1px) scale(0.992);
  filter: brightness(0.95);
}

.menu-btn {
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 12px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.15;
  box-sizing: border-box;
  font-size: 15px;
  color: #eaf0ff;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.2s ease;
}

.menu-btn.primary {
  background: #3f86ff;
}

#quickMatchBtn {
  margin-bottom: 6px;
}

.menu-btn:hover {
  filter: brightness(1.08);
}

#openSettingsBtn {
  background: rgba(255, 255, 255, 0.15);
}

.menu-btn-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}

.menu-btn-row .menu-btn {
  flex: 1;
  min-height: 46px;
  margin-top: 0;
}

.slots-wrap {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

/* Custom room lobby: keep long player list scrollable inside panel */
#quickMatchPanel #customRoomNameLine:not(.hidden) ~ .quick-layout #slotList {
  max-height: min(54vh, calc(88vh - 260px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.quick-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(300px, 1fr);
  gap: 14px;
  align-items: start;
  max-height: calc(88vh - 90px);
}

.custom-preview {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.custom-preview-title {
  font-size: 12px;
  color: #c6d6ff;
  margin-bottom: 8px;
}

.custom-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 14px;
  align-items: stretch;
}

#customMatchPanel .custom-grid > .chat-input,
#customMatchPanel .custom-grid > .map-select {
  height: 42px;
  box-sizing: border-box;
}

#customMatchPanel .custom-grid > .chat-input {
  padding: 10px 12px;
}

#customMatchPanel .custom-grid > .map-select {
  padding: 10px 38px 10px 12px;
}

#customMatchPanel #customSeekerCount {
  background-color: rgba(255, 77, 77, 0.28);
  border-color: rgba(255, 77, 77, 0.72);
  color: #ffffff;
}

#customMatchPanel #customSeekerCount:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 77, 77, 0.28);
}

#customMatchPanel #customRunnerCount {
  background-color: rgba(76, 175, 80, 0.28);
  border-color: rgba(76, 175, 80, 0.72);
  color: #ffffff;
}

#customMatchPanel #customRunnerCount:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.28);
}

#customMatchPanel .menu-actions {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  justify-content: center;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 4px;
}

.custom-room-list {
  display: grid;
  gap: 6px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}

.custom-room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  cursor: default;
}

.custom-room-item:hover {
  border-color: rgba(113, 169, 255, 0.65);
  background: rgba(41, 104, 199, 0.2);
}

.custom-room-meta {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.custom-room-title {
  font-size: 13px;
  color: #f3f6ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-room-sub {
  font-size: 11px;
  color: #bcd0ff;
  letter-spacing: 0.15px;
}

.quick-left,
.quick-right {
  min-height: 0;
}

.quick-left {
  overflow: auto;
  padding-right: 4px;
}

.quick-right {
  display: flex;
  flex-direction: column;
}

.slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: #dde6ff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.slot-seeker {
  border-left: 4px solid #ff7682;
  background: rgba(255, 82, 102, 0.16);
}

.slot-runner {
  border-left: 4px solid #58cc70;
  background: rgba(88, 204, 112, 0.14);
}

.slot-bot {
  box-shadow: inset 0 0 0 1px rgba(255, 208, 77, 0.7);
}

.slot.self {
  border-color: #6ea5ff;
  background: rgba(92, 150, 255, 0.24);
}

.slot.empty {
  color: #a9b4d4;
  background: rgba(255, 255, 255, 0.05);
}

.slot-left {
  display: grid;
  gap: 3px;
}

.slot-role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.55px;
  opacity: 0.9;
}

.slot-name {
  font-size: 14px;
}

.slot-state {
  font-size: 12px;
  opacity: 0.9;
}

.ready-badge {
  display: inline-block;
  margin-top: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #2ec866;
  color: #0f2a18;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
}

.slot.ready-slot {
  box-shadow: inset 0 0 0 1px rgba(46, 200, 102, 0.85);
}

.bot-remove-btn {
  border: 0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  line-height: 24px;
  padding: 0;
  font-size: 14px;
  color: #ffe8e8;
  background: rgba(255, 94, 94, 0.65);
  cursor: pointer;
}

.slot-action-btn {
  border: 0;
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 700;
  color: #f6f8ff;
  background: rgba(225, 173, 1, 0.28);
  cursor: pointer;
}

.slot-action-btn.host-kick {
  background: rgba(255, 94, 94, 0.68);
}

.vote-kick-panel {
  border: 1px solid rgba(225, 173, 1, 0.55);
  border-radius: 8px;
  background: rgba(31, 25, 8, 0.92);
  padding: 8px;
  margin-bottom: 8px;
}

.vote-kick-panel.hidden {
  display: none;
}

.vote-kick-text {
  font-size: 12px;
  color: #f7d774;
  margin-bottom: 7px;
}

.vote-kick-actions {
  display: flex;
  gap: 7px;
}

.vote-kick-btn {
  flex: 1;
  border: 0;
  border-radius: 6px;
  padding: 7px 8px;
  color: #f4f7ff;
  font-size: 12px;
  cursor: pointer;
}

.vote-kick-btn.yes {
  background: rgba(68, 181, 88, 0.84);
}

.vote-kick-btn.no {
  background: rgba(201, 72, 72, 0.84);
}

.seeker-early-end-prompt {
  position: fixed;
  right: 20px;
  bottom: 54px;
  z-index: 36;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 10px 11px;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(1px);
  color: #f4f7ff;
}

.seeker-early-end-prompt.hidden {
  display: none;
}

.seeker-early-end-text {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.seeker-early-end-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.seeker-early-end-btn {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 700;
  color: #f6f9ff;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.14s ease, background-color 0.14s ease;
}

.seeker-early-end-btn.yes {
  background: rgba(76, 177, 105, 0.82);
}

.seeker-early-end-btn.no {
  background: rgba(90, 102, 130, 0.9);
}

.seeker-early-end-btn:hover {
  filter: brightness(1.07);
}

.seeker-early-end-btn:active {
  transform: translateY(1px);
  filter: brightness(0.92);
}

.seeker-early-end-btn:disabled {
  cursor: default;
  opacity: 0.62;
  filter: grayscale(0.15);
}

.map-title {
  margin-top: 16px;
  margin-bottom: 8px;
  font-size: 14px;
  color: #d7e1ff;
}

.map-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  padding: 10px 38px 10px 10px;
  color: #eaf0ff;
  background-color: #141a28;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='10' viewBox='0 0 14 10'%3E%3Cpath d='M2 2.5L7 7.5L12 2.5' stroke='%23eaf0ff' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 14px 10px;
  cursor: pointer;
}

.lobby-status {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: #dce5ff;
  background: rgba(255, 255, 255, 0.07);
}

.chat-title {
  margin-top: 14px;
  margin-bottom: 7px;
  font-size: 14px;
  color: #d7e1ff;
}

.chat-messages {
  --chat-initial-height: 120px;
  min-height: var(--chat-initial-height);
  max-height: calc(var(--chat-initial-height) * 2.5);
  height: auto;
  overflow-y: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  padding: 8px;
}

.chat-line {
  margin-bottom: 6px;
  font-size: 12px;
  color: #dce5ff;
  word-break: break-word;
}

.chat-line:last-child {
  margin-bottom: 0;
}

.chat-author {
  color: #8fc2ff;
  font-weight: 600;
}

.chat-system .chat-author {
  color: #8ee3a2;
}

.chat-summary {
  color: #e1ad01;
  font-weight: 700;
}

.chat-summary .chat-author {
  color: #e1ad01;
}

.chat-mustard {
  color: #e1ad01;
}

.chat-mustard .chat-author {
  color: #e1ad01;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 8px;
}

.chat-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(20, 26, 40, 0.95);
  color: #eaf0ff;
  font-size: 13px;
  padding: 9px 10px;
}

.chat-send-btn {
  border: 0;
  border-radius: 8px;
  background: #4a8dff;
  color: #edf3ff;
  font-size: 13px;
  padding: 9px 12px;
  cursor: pointer;
}

.menu-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 0;
}

.role-actions {
  grid-template-columns: 1fr;
}

.top-right-hud-stack {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.region-info-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(86, 255, 140, 0.42);
  background: rgba(7, 18, 12, 0.72);
  backdrop-filter: blur(4px);
  color: #d9ffe8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.region-info-indicator {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #59ff8f;
  box-shadow: 0 0 8px rgba(89, 255, 143, 0.95);
  flex: 0 0 8px;
}

.region-info-text {
  white-space: nowrap;
}

.team-status-panel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(124, 255, 172, 0.35);
  background: rgba(10, 16, 24, 0.78);
  backdrop-filter: blur(4px);
  color: #f1fff6;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.team-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #7effaf;
  box-shadow: 0 0 8px rgba(126, 255, 175, 0.9);
  flex: 0 0 8px;
}

.team-status-text {
  white-space: nowrap;
}

.nickname-easter-egg {
  position: fixed;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  z-index: 1200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms linear;
  font-size: clamp(38px, 5.8vw, 86px);
  line-height: 1.06;
  font-weight: 900;
  white-space: nowrap;
  color: #ffffff;
  text-align: center;
  text-shadow:
    0 0 20px #39ff14,
    0 0 36px #39ff14,
    0 0 64px rgba(57, 255, 20, 0.9);
}

.nickname-easter-egg.active {
  opacity: 1;
}

.nickname-easter-egg.active.fading {
  opacity: 0;
  transition: opacity 1000ms ease;
}

@media (max-width: 860px) {
  #quickMatchPanel {
    width: min(95vw, 660px);
    max-height: 90vh;
  }

  .quick-layout {
    grid-template-columns: 1fr;
    max-height: calc(90vh - 90px);
    overflow: auto;
  }

  .quick-left {
    overflow: visible;
    padding-right: 0;
  }

  .menu-layer {
    padding: 24px 10px 36px;
  }

  .menu-panel {
    width: min(96vw, 560px);
    padding: 20px 16px;
  }

  .main-menu-panel {
    min-height: auto;
  }

  .main-menu-screen {
    gap: 14px;
    margin: 0;
  }

  .landing-card-grid {
    grid-template-columns: 1fr;
  }

  .site-content-nav {
    justify-content: center;
  }

  .service-footer-links {
    flex-wrap: wrap;
    justify-content: center;
  }
}
