:root {
  --bg-color: #F6F1E7;
  --text-main: #2A2017;
  --text-muted: #6A5D4F;
  --primary: #5E3A23;
  --panel-bg: rgba(255, 255, 255, 0.85);
}

* { box-sizing: border-box; }
html, body, #stage, #panel { margin: 0; }
html, body { height: 100%; overflow: hidden; }

body {
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  color: var(--text-main);
  font-family: 'Montserrat', system-ui, sans-serif;
}

/* --- Шапка --- */
.web-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none; /* Чтобы клики проходили на сцену */
}

.logo {
  font-weight: 800;
  font-size: 20px;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.logo-icon {
  width: 24px;
  height: 24px;
  background: var(--primary);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 3px;
}
.logo-icon div { background: var(--bg-color); border-radius: 1px; }

.back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  pointer-events: auto;
  transition: opacity 0.2s;
}
.back-link:hover { opacity: 0.7; }

/* --- 3D Сцена --- */
#stage {
  flex: 1;
  position: relative;
  min-height: 0;
}

#scene {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: none;
}

/* --- Панель управления (Bottom Sheet) --- */
#panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

.row { display: flex; gap: 12px; }

/* Поле ввода */
#url {
  flex: 1;
  height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  background: #ffffff;
  min-width: 0;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#url:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 58, 35, 0.1);
}

/* Кнопки */
.btn {
  height: 48px;
  padding: 0 20px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
}

.btn:active { transform: scale(0.96); }

.btn.dark {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(94, 58, 35, 0.2);
}
.btn.dark:hover { box-shadow: 0 6px 16px rgba(94, 58, 35, 0.3); }

.btn.outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.btn.outline:hover { background: rgba(94, 58, 35, 0.05); }

/* Сезоны */
.seasons button {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s;
}

.seasons button:hover { background: rgba(0, 0, 0, 0.08); }

.seasons button.active {
  color: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Палитры */
.palettes { align-items: center; gap: 12px; }

.palettes button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.2s, border-color 0.2s;
}

.palettes button:hover { transform: scale(1.1); }
.palettes button.active { border-color: var(--text-main); }

.hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
  font-weight: 500;
}
.privacy-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0.7;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}