:root {
  --bg: #d1d3d8;
  --phone-edge: #121315;
  --screen-dark: #4d4d4f;
  --screen-dark-2: #404042;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text-soft: rgba(255, 255, 255, 0.64);
  --text-faint: rgba(255, 255, 255, 0.4);
  --paper: #f5f4f2;
  --paper-shadow: rgba(18, 19, 21, 0.14);
  --marble: #f8f7f4;
  --marble-edge: #d8d8d8;
  --marble-text: #626262;
  --pool-marble-core: #ededeb;
  --pool-marble-strong: #cac9c6;
  --pool-drop: rgba(255, 255, 255, 0.1);
  --shadow-soft: 0 18px 44px rgba(0, 0, 0, 0.18);
  --shadow-marble: 0 3px 10px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  --font-ui: "Avenir Next", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-ui);
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.65), transparent 36%),
    linear-gradient(180deg, #d3d6dc 0%, #bfc3cb 100%);
  color: #141414;
}

body {
  min-height: 100vh;
}

.scene {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.scene::before,
.scene::after {
  content: "";
  position: absolute;
  inset: auto;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.55;
}

.scene::before {
  width: 220px;
  height: 220px;
  left: -40px;
  bottom: 120px;
  background: linear-gradient(135deg, rgba(201, 137, 113, 0.8), rgba(160, 86, 72, 0.15));
}

.scene::after {
  width: 280px;
  height: 280px;
  right: -90px;
  top: 140px;
  background: linear-gradient(135deg, rgba(70, 78, 97, 0.2), rgba(255, 255, 255, 0.4));
}

.phone {
  width: auto;
  height: min(84vh, 760px);
  max-width: min(390px, calc(100vw - 40px));
  aspect-ratio: 0.485;
  background: linear-gradient(180deg, #17181b, #09090b);
  border-radius: 44px;
  padding: 14px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.28);
  position: relative;
}

.phone__notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 168px;
  height: 30px;
  background: #09090b;
  border-radius: 0 0 18px 18px;
  z-index: 2;
}

.screen {
  height: 100%;
  border-radius: 32px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--screen-dark) 0%, var(--screen-dark) 58%, var(--paper) 58%, var(--paper) 100%);
  position: relative;
}

.statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 22px 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.statusbar__icons {
  font-size: 13px;
  opacity: 0.92;
}

.top-panel {
  color: #fff;
  min-height: 50%;
  padding: 6px 0 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.icon-button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.76);
  background: transparent;
  font-size: 24px;
  display: grid;
  place-items: center;
  cursor: default;
}

.pool-stage {
  width: 100%;
  display: grid;
  place-items: center;
  padding: 0 8px 10px;
}

.pool-shell {
  position: relative;
  width: min(334px, calc(100% + 52px));
  border-radius: 44px;
  padding: 0;
  background: transparent;
  border: 0;
}

.pool-glow {
  display: none;
}

.pool {
  position: relative;
  width: 100%;
  height: 300px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}

.pool.is-over {
  box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.02);
}

.orbit-ring,
.orbit-core {
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.orbit-ring {
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.orbit-ring--outer {
  width: 248px;
  height: 248px;
}

.orbit-ring--middle {
  width: 170px;
  height: 170px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.11);
}

.orbit-ring--inner {
  width: 102px;
  height: 102px;
  border-color: rgba(255, 255, 255, 0.16);
}

.orbit-core {
  width: 28px;
  height: 28px;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.08);
}

.pool-marble {
  position: absolute;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.64) 24%, var(--pool-marble-core) 72%, #d6d4d0 100%);
  color: var(--marble-text);
  box-shadow:
    0 8px 14px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
  display: grid;
  place-items: center;
  font: inherit;
  letter-spacing: 0.08em;
  transition:
    transform 220ms ease,
    background 220ms ease,
    color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.pool-marble span {
  font-size: 11px;
  font-weight: 600;
}

.pool-marble.is-priority-1 {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.98), rgba(255, 243, 217, 0.78) 24%, #e0b867 72%, #af8242 100%);
  color: #62461f;
  border-color: rgba(255, 237, 200, 0.5);
  box-shadow:
    0 12px 18px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.pool-marble.is-priority-2 {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.96), rgba(230, 245, 240, 0.74) 24%, #9abeb2 72%, #6d9387 100%);
  color: #36574f;
  border-color: rgba(215, 242, 234, 0.4);
}

.pool-marble.is-priority-3 {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.94), rgba(232, 235, 248, 0.72) 24%, #bcc3e0 72%, #8d96bb 100%);
  color: #4e577e;
  border-color: rgba(225, 230, 250, 0.38);
}

.pool-marble.is-state-primary {
  filter: saturate(1);
}

.pool-marble.is-state-secondary {
  filter: saturate(0.88) brightness(1.03);
}

.pool-marble.is-recent {
  animation: marblePulse 1.6s ease-in-out infinite;
}

.pool-marble.is-active {
  animation: marblePulseSoft 2.4s ease-in-out infinite;
}

.pool-marble.is-dragging {
  opacity: 0;
}

@keyframes marblePulse {
  0%,
  100% {
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  50% {
    box-shadow: 0 12px 18px rgba(0, 0, 0, 0.18), 0 0 18px rgba(255, 255, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  }
}

@keyframes marblePulseSoft {
  0%,
  100% {
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.88);
  }

  50% {
    box-shadow: 0 10px 16px rgba(0, 0, 0, 0.17), 0 0 12px rgba(255, 255, 255, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  }
}

.bottom-panel {
  background: var(--paper);
  padding: 8px 10px 8px;
  min-height: 50%;
  display: grid;
  align-content: start;
}

.marble-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 6px;
}

.person-card {
  display: grid;
  justify-items: center;
  gap: 0;
  text-align: center;
}

.source-marble {
  width: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--marble-edge);
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0%, #fafaf8 48%, #efede9 100%);
  box-shadow: var(--shadow-marble);
  color: #686766;
  display: grid;
  place-items: center;
  padding: 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.source-marble:active {
  cursor: grabbing;
}

.source-marble span {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1;
}

.drag-ghost {
  position: fixed;
  width: 66px;
  height: 66px;
  margin-left: -33px;
  margin-top: -33px;
  border-radius: 50%;
  border: 1px solid rgba(206, 206, 206, 0.92);
  background:
    radial-gradient(circle at 32% 28%, #ffffff 0%, #fafaf8 48%, #efede9 100%);
  box-shadow: 0 14px 20px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  display: grid;
  place-items: center;
  color: #5e5d5a;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  pointer-events: none;
  z-index: 30;
}
