* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --page-bg: #111827;
  --panel-bg: rgba(255, 255, 255, 0.08);
  --panel-border: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #a7afbf;
  --accent: #e94560;
  --accent-2: #ff6b6b;
  --accent-soft: rgba(233, 69, 96, 0.16);
  --card-bg: rgba(0, 0, 0, 0.28);
  --chip-bg: rgba(255, 255, 255, 0.08);
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text-main);
  background: radial-gradient(circle at top, #243b61 0, #111827 48%, #0b1020 100%);
  padding: 20px;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 30px 24px;
  text-align: center;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 26px;
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.app-header h1 {
  font-size: 1.75rem;
  line-height: 1.1;
}

.tagline {
  margin-top: 7px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #e7b5be;
}

.subtitle {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.turn-selector {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  align-items: center;
  gap: 8px;
  margin: 25px 0 5px;
}

.participant {
  display: flex;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #aeb8ca;
  font-size: 1.3rem;
  font-weight: 800;
  opacity: 0.45;
  transition: 0.3s ease;
}

.participant.active {
  opacity: 1;
  transform: scale(1.1);
  background: var(--accent-soft);
  border-color: rgba(233, 69, 96, 0.6);
  color: #ffd6dd;
  box-shadow: 0 0 28px rgba(233, 69, 96, 0.25);
}

.bottle-button {
  display: grid;
  place-items: center;
  width: 120px;
  height: 130px;
  margin: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 20px;
}

.bottle-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 4px;
}

.bottle-illustration {
  width: 104px;
  height: 104px;
  transform-origin: center;
  filter: drop-shadow(0 7px 12px rgba(0, 0, 0, 0.4));
}

@keyframes bottleVibrate {

  0%,
  100% {
    transform: rotate(var(--bottle-angle));
  }
  
  20% {
    transform: rotate(calc(var(--bottle-angle) - 4deg));
  }
  
  40% {
    transform: rotate(calc(var(--bottle-angle) + 4deg));
  }
  
  60% {
    transform: rotate(calc(var(--bottle-angle) - 3deg));
  }
  
  80% {
    transform: rotate(calc(var(--bottle-angle) + 3deg));
  }
}

.bottle-illustration.vibrate {
  animation: bottleVibrate 0.45s ease-in-out;
}

.spin-status {
  min-height: 22px;
  margin: 5px 0 18px;
  color: #9aa4b5;
  font-size: 0.88rem;
}

.quick-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}

.toggle-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  color: #bdc5d2;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 24px;
}

.switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: absolute;
  inset: 0;
  background: #4b5563;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.25s;
}

.switch-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
}

.switch input:checked+.switch-track {
  background: var(--accent);
}

.switch input:checked+.switch-track::before {
  transform: translateX(20px);
}

.intensity-control {
  padding: 15px 14px 14px;
  text-align: left;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h2 {
  font-size: 0.98rem;
}

.section-heading p {
  margin-top: 3px;
  color: #8d97a8;
  font-size: 0.72rem;
}

.range-value {
  color: #ffd6dd;
  font-size: 0.85rem;
  font-weight: 800;
}

.dual-range {
  position: relative;
  height: 34px;
  margin-top: 10px;
}

.range-track,
.range-fill {
  position: absolute;
  top: 15px;
  height: 5px;
  border-radius: 999px;
}

.range-track {
  width: 100%;
  background: rgba(255, 105, 180, 0.12);
  border: 1px solid rgba(255, 105, 180, 0.18);
  border-radius: 999px;
}

.range-fill {
  background: #ff5a9d;
  box-shadow: 0 0 10px rgba(255, 90, 157, 0.35);
  border-radius: 999px;
}

.dual-range input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 34px;
  margin: 0;
  pointer-events: none;
  appearance: none;
  background: transparent;
}

.dual-range input::-webkit-slider-thumb {
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #252b38;
  cursor: pointer;
  pointer-events: auto;
}

.dual-range input::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #252b38;
  cursor: pointer;
  pointer-events: auto;
}

.primary-button,
.secondary-button,
.filter-button {
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  transition: 0.2s ease;
}

.primary-button {
  width: 100%;
  margin-top: 16px;
  padding: 15px;
  color: #fff;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(233, 69, 96, 0.18);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 25px rgba(233, 69, 96, 0.28);
}

.primary-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.action-card {
  min-height: 190px;
  margin-top: 14px;
  padding: 20px 17px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
}

.action-placeholder {
  min-height: 148px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  color: #747f91;
  text-align: center;
  font-size: 0.98rem;
}

.placeholder-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #d5dbe5;
  background: rgba(255, 255, 255, 0.08);
}

.action-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.action-emoji {
  font-size: 1.45rem;
}

.action-category,
.action-intensity {
  padding: 4px 8px;
  border-radius: 999px;
  color: #c5ccda;
  background: rgba(255, 255, 255, 0.07);
  font-size: 0.68rem;
  font-weight: 700;
}

.action-title {
  color: #ffe2e6;
  font-size: 1.3rem;
  line-height: 1.4;
}

.action-alternate {
  margin-top: 8px;
  color: #d2aeb5;
  font-size: 0.95rem;
  line-height: 1.45;
}

.instruction-panel {
  margin-top: 16px;
  padding: 13px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 0 12px 12px 0;
}

.instruction-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: #f0b9c1;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.language-buttons {
  display: flex;
  gap: 4px;
}

.language-button {
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #929baa;
  background: transparent;
  font-size: 0.66rem;
  cursor: pointer;
}

.language-button.active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(233, 69, 96, 0.25);
}

.instruction-panel p {
  color: #c4cad5;
  font-size: 0.9rem;
  line-height: 1.55;
}

.turn-message {
  margin-top: 13px;
  color: #929baa;
  font-size: 0.78rem;
}

.filter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  padding: 10px 15px;
  color: #c8cfdb;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.84rem;
  font-weight: 700;
}

.filter-count {
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 0.68rem;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(5px);
}

.filter-dialog {
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  margin: 0 auto;
  overflow: hidden;
  background: #171d2b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.45);
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.eyebrow {
  color: #e58c9a;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.filter-header h2 {
  margin-top: 3px;
  font-size: 1.3rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #cbd2dd;
  background: rgba(255, 255, 255, 0.07);
  font-size: 1.4rem;
  cursor: pointer;
}

.filter-body {
  max-height: calc(92vh - 145px);
  overflow-y: auto;
  padding: 18px 20px;
}

.filter-section {
  margin-bottom: 20px;
  text-align: left;
}

.filter-section h3 {
  margin-bottom: 9px;
  color: #e6eaf0;
  font-size: 0.84rem;
}

.filter-help {
  margin-left: 5px;
  color: #798396;
  font-size: 0.65rem;
  font-weight: 400;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.choice-chip {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: #aeb7c7;
  background: var(--chip-bg);
  cursor: pointer;
  font-size: 0.76rem;
}

.choice-chip.active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(233, 69, 96, 0.55);
}

.search-select {
  position: relative;
}

.search-select input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  outline: 0;
  color: #f3f5f8;
  background: rgba(0, 0, 0, 0.18);
}

.search-select input:focus {
  border-color: rgba(233, 69, 96, 0.6);
}

.search-select input::placeholder {
  color: #697386;
}

.selected-values {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 7px;
}

.selected-value {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px 5px 9px;
  border-radius: 999px;
  color: #f5cfd5;
  background: var(--accent-soft);
  font-size: 0.7rem;
}

.selected-value button {
  border: 0;
  color: #e7a8b2;
  background: transparent;
  cursor: pointer;
}

.suggestion-list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 5px);
  max-height: 190px;
  overflow-y: auto;
  padding: 5px;
  list-style: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: #202737;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.35);
}

.suggestion-list li {
  padding: 9px 10px;
  border-radius: 7px;
  color: #cbd2dc;
  cursor: pointer;
  font-size: 0.78rem;
}

.suggestion-list li:hover,
.suggestion-list li.active {
  color: #fff;
  background: rgba(233, 69, 96, 0.16);
}

.filter-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px;
  margin-bottom: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.filter-option h3 {
  margin-bottom: 3px;
}

.filter-option p {
  color: #7f899a;
  font-size: 0.7rem;
}

.filter-footer {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 9px;
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  background: #171d2b;
}

.secondary-button {
  padding: 13px;
  color: #c5ccda;
  background: rgba(255, 255, 255, 0.07);
}

.modal-apply {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 430px) {
  body {
    padding: 10px;
  }
  
  .app-shell {
    padding: 24px 16px;
    border-radius: 22px;
  }
  
  .turn-selector {
    grid-template-columns: 1fr 105px 1fr;
  }
  
  .bottle-button {
    width: 105px;
  }
  
  .quick-controls {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 700px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
  
  .filter-dialog {
    border-radius: 24px;
  }
}