/* Стартовый экран и панель настроек (на телефоне — нижняя шторка). */

/* --- стартовый экран: крупный шрифт и крупные кнопки --- */

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 43, 51, 0.55);
  padding: 16px;
  z-index: 30;
}

.start-card {
  background: var(--card);
  border-radius: 14px;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(420px, 100%);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.start-card h2 {
  margin: 0;
  font-size: 26px;
}

.start-hint {
  margin: 0;
  color: var(--muted);
}

.start-input {
  font: inherit;
  font-size: 22px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.start-input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.start-error {
  margin: 0;
  min-height: 1.4em;
  color: #8c2f1b;
  font-size: 14px;
}

.start-card .btn {
  font-size: 20px;
  padding: 14px 20px;
}

/* --- кнопка игрока в шапке --- */

.btn-player {
  font-weight: 600;
  color: var(--accent);
  border-color: transparent;
  background: none;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

/* --- панель настроек --- */

.panel-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(43, 43, 51, 0.35);
  z-index: 40;
}

.panel {
  position: fixed;
  z-index: 41;
  background: var(--card);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* десктоп: панель справа */
@media (min-width: 900px) {
  .panel {
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    border-left: 1px solid var(--line);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.12);
    padding: 18px 22px 30px;
  }
}

/* телефон: нижняя шторка */
@media (max-width: 899.98px) {
  .panel {
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 82dvh;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.2);
    padding: 18px 18px 30px;
  }
}

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

.panel-header h2 {
  margin: 0;
  font-size: 22px;
}

.panel-close {
  font: inherit;
  font-size: 26px;
  line-height: 1;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}

.panel-close:hover {
  color: var(--ink);
}

/* --- поля панели --- */

.field {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 14px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field.hidden {
  display: none;
}

.field-label {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.size-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.size-button {
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  width: 52px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
}

.size-button.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.size-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.field-hint {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

.check-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  cursor: pointer;
}

.check-label input {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.choice:hover {
  background: var(--bg);
}

.choice input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.choice.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.choice-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.choice-credit {
  font-size: 13px;
  color: var(--muted);
}

.choice-note {
  font-size: 13px;
  color: #8c6f1b;
}

.player-name {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.field .btn {
  align-self: flex-start;
}
