:root {
  color-scheme: dark;
  --bg: #090b10;
  --bg-deep: #07080c;
  --panel: rgba(20, 22, 29, 0.82);
  --panel-strong: #171920;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f7f5f0;
  --muted: #989aa3;
  --accent: #f5a623;
  --accent-soft: rgba(245, 166, 35, 0.14);
  --accent-line: rgba(245, 166, 35, 0.42);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 72% 35%, rgba(245, 166, 35, 0.055), transparent 28%),
    radial-gradient(circle at 13% 92%, rgba(100, 91, 117, 0.09), transparent 32%),
    var(--bg);
  font-family: Inter, Manrope, "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  position: relative;
  z-index: 30;
  min-height: 82px;
  padding: 17px 28px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background: rgba(9, 11, 16, 0.76);
  backdrop-filter: blur(20px);
}

.brand {
  width: max-content;
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}

.brand__mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--accent-line);
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: linear-gradient(145deg, rgba(245, 166, 35, 0.14), rgba(245, 166, 35, 0.025));
  font-family: Georgia, serif;
  font-size: 24px;
}

.brand__copy {
  display: grid;
  gap: 2px;
}

.brand__copy strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.01em;
}

.brand__copy small,
.topbar__eyebrow {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.topbar__location {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.topbar__floor {
  font-size: 15px;
}

.topbar__floor b {
  color: var(--accent);
  font-weight: 600;
}

.logout-link {
  justify-self: end;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  display: inline-flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.logout-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.logout-link:hover {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}

.workspace {
  width: 100%;
  min-height: 0;
  padding: 24px 28px 28px;
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr);
  gap: 22px;
}

.club-panel {
  min-height: 0;
  padding: 24px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(155deg, rgba(28, 30, 38, 0.93), rgba(17, 19, 25, 0.84));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.club-panel__heading {
  padding: 0 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

h1 {
  font-size: clamp(28px, 2.5vw, 36px);
}

h2 {
  font-size: clamp(24px, 2.4vw, 34px);
}

.club-count {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 12px;
}

.club-panel__intro {
  margin: 24px 6px 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.club-list {
  display: grid;
  gap: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.club-list__loading,
.club-list__error {
  padding: 18px 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.club-list__error {
  color: #f4b7a9;
}

.club-item {
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 15px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  text-align: left;
  background: transparent;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.club-item:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.club-item.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
}

.club-item.is-on-floor:not(.is-active) .club-item__floor {
  border-color: var(--accent-line);
  color: var(--accent);
}

.club-item__icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.035);
  font-size: 17px;
}

.club-item__copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.club-item__name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.club-item__meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.club-item__floor {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  transition: color 180ms ease, border-color 180ms ease;
}

.map-area {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.map-heading {
  min-height: 73px;
  padding: 2px 8px 15px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.map-heading__hint {
  margin-bottom: 5px;
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.hint-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--accent-soft);
}

.map-viewport {
  position: relative;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 54% 44%, rgba(255, 255, 255, 0.045), transparent 30%),
    linear-gradient(135deg, rgba(23, 25, 32, 0.78), rgba(11, 13, 18, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow);
  isolation: isolate;
}

.map-viewport::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.map-plane-wrap {
  width: min(94%, 1150px);
  perspective: 1500px;
  transform: translateX(-1.5%);
}

.map-plane {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  transform: rotateX(6deg) rotateZ(-0.65deg) translateY(-1%);
  transform-style: preserve-3d;
  transition: transform 400ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.map-plane::before,
.map-plane::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.map-plane::before {
  inset: 10% 8% 2%;
  z-index: -2;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.58);
  filter: blur(26px);
  transform: translate3d(18px, 30px, -45px);
}

.map-plane::after {
  inset: 8px -10px -15px 10px;
  z-index: -1;
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(89, 86, 96, 0.46), rgba(18, 19, 24, 0.2));
  clip-path: polygon(0 0, 100% 0, 100% 100%, 2% 100%);
  transform: translateZ(-22px);
}

.map-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  filter: saturate(0.9) contrast(1.03) drop-shadow(0 20px 26px rgba(0, 0, 0, 0.28));
  opacity: 1;
  transition: opacity 160ms ease, filter 250ms ease;
  user-select: none;
  -webkit-user-drag: none;
}

.map-image.is-changing {
  opacity: 0.12;
  filter: saturate(0.6) blur(3px);
}

.map-markers {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.map-marker {
  position: absolute;
  width: 32px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -92%) translateZ(22px);
  transform-style: preserve-3d;
  cursor: pointer;
  pointer-events: auto;
}

.map-marker__pin {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 24px;
  border: 3px solid #fff3d9;
  border-radius: 50% 50% 50% 8px;
  display: grid;
  place-items: center;
  color: #201304;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(0, 0, 0, 0.55);
  transform: translateX(-50%) rotate(-45deg);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.map-marker__pin::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #231506;
}

.map-marker__pulse {
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 28px;
  height: 12px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.62;
  background: rgba(245, 166, 35, 0.18);
  transform: translateX(-50%) translateZ(-1px);
}

.map-marker__label {
  position: absolute;
  left: 50%;
  bottom: 35px;
  width: max-content;
  max-width: 170px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--text);
  background: rgba(15, 16, 21, 0.94);
  box-shadow: 0 9px 25px rgba(0, 0, 0, 0.36);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  opacity: 0;
  transform: translate(-50%, 5px) rotateZ(0.65deg) rotateX(-6deg);
  transition: opacity 150ms ease, transform 150ms ease;
  pointer-events: none;
}

.map-marker:hover .map-marker__label,
.map-marker:focus-visible .map-marker__label,
.map-marker.is-active .map-marker__label {
  opacity: 1;
  transform: translate(-50%, 0) rotateZ(0.65deg) rotateX(-6deg);
}

.map-marker:hover .map-marker__pin,
.map-marker.is-active .map-marker__pin {
  box-shadow: 0 0 0 7px rgba(245, 166, 35, 0.16), 0 9px 22px rgba(0, 0, 0, 0.58);
  transform: translateX(-50%) rotate(-45deg) scale(1.12);
}

.floor-switcher {
  position: absolute;
  top: 50%;
  right: 22px;
  z-index: 12;
  width: 58px;
  padding: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  display: grid;
  gap: 6px;
  background: rgba(14, 15, 20, 0.86);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  transform: translateY(-50%);
}

.floor-switcher__label {
  padding: 4px 0 7px;
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.floor-button {
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.floor-button span {
  font-size: 14px;
  font-weight: 600;
}

.floor-button small {
  position: absolute;
  top: 5px;
  right: 5px;
  color: inherit;
  font-size: 7px;
  opacity: 0.72;
}

.floor-button:hover {
  border-color: var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.floor-button.is-active {
  border-color: rgba(245, 166, 35, 0.55);
  color: #251703;
  background: var(--accent);
  box-shadow: 0 7px 20px rgba(245, 166, 35, 0.2);
}

.club-detail {
  position: absolute;
  left: 22px;
  bottom: 20px;
  z-index: 14;
  width: min(440px, calc(100% - 116px));
  padding: 14px 42px 14px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 17px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  background: rgba(16, 18, 23, 0.9);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(18px);
}

.club-detail[hidden] {
  display: none;
}

.club-detail__icon {
  width: 42px;
  height: 42px;
  border: 1px solid var(--accent-line);
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  font-size: 20px;
}

.club-detail__body {
  min-width: 0;
}

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

.club-detail h3 {
  margin-bottom: 5px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.club-detail__topline span {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 10px;
}

.club-detail p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.club-detail__close {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}

.club-detail__close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

noscript {
  position: fixed;
  inset: auto 20px 20px;
  z-index: 100;
  padding: 14px;
  border: 1px solid #8a5147;
  border-radius: 12px;
  color: #ffd4cb;
  background: #301a17;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: 250px minmax(0, 1fr);
    padding-inline: 18px;
  }

  .club-item {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    padding-inline: 9px;
  }

  .map-viewport {
    min-height: 480px;
  }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 72px;
    padding: 14px 18px;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
  }

  .topbar__location {
    justify-items: end;
  }

  .workspace {
    padding: 18px;
    grid-template-columns: 1fr;
  }

  .map-area {
    order: -1;
  }

  .map-heading {
    min-height: 64px;
  }

  .map-heading__hint {
    display: none;
  }

  .map-viewport {
    min-height: 420px;
  }

  .map-plane-wrap {
    width: 106%;
    transform: translateX(-3%);
  }

  .map-plane {
    transform: rotateX(4deg) rotateZ(-0.45deg);
  }

  .club-panel {
    max-height: none;
  }

  .club-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }
}

@media (max-width: 520px) {
  .brand__copy small,
  .topbar__eyebrow {
    display: none;
  }

  .brand__mark {
    width: 38px;
    height: 38px;
  }

  .logout-link {
    min-height: 38px;
    padding-inline: 11px;
  }

  .workspace {
    padding: 12px;
  }

  .map-heading {
    padding-inline: 4px;
  }

  .map-viewport {
    min-height: 360px;
    border-radius: 21px;
  }

  .map-plane-wrap {
    width: 116%;
    transform: translateX(-6%);
  }

  .floor-switcher {
    top: auto;
    right: 12px;
    bottom: 12px;
    width: auto;
    padding: 6px;
    grid-template-columns: repeat(4, 38px);
    border-radius: 16px;
    transform: none;
  }

  .floor-switcher__label {
    display: none;
  }

  .floor-button {
    width: 38px;
    height: 38px;
  }

  .club-detail {
    left: 12px;
    right: 12px;
    bottom: 64px;
    width: auto;
  }

  .club-list {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
