* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 10px;
}

.game-container {
  width: 100%;
  background: var(--bg-container);
  border: 4px solid var(--border-main);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

/* Старт игры и настройки */
.start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-title {
  margin-bottom: 20px;
  color: var(--text-gold);
  font-size: 1.8rem;
}

.setting-item {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.setting-item label {
  font-size: 14px;
  color: var(--border-gold);
}

.select-input {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-main);
  padding: 10px 36px 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  width: 100%;
  max-width: 280px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23d4a359' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

/* Модальное окно правил */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 12px;
  backdrop-filter: blur(4px);
}

.modal-container {
  background: var(--bg-container);
  border: 3px solid var(--border-main);
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  position: relative;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  color: var(--border-gold);
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  z-index: 10;
}

.modal-close:hover {
  color: #fff;
}

.modal-body {
  padding: 24px 20px;
  overflow-y: auto;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
}

.modal-body h2 {
  color: var(--text-gold);
  font-size: 20px;
  margin-bottom: 12px;
}

.modal-body h3 {
  color: #e6c894;
  font-size: 16px;
  margin: 16px 0 8px 0;
}

.modal-body h4 {
  color: var(--border-gold);
  font-size: 14px;
  margin: 14px 0 6px 0;
}

.modal-body p { margin-bottom: 8px; }
.modal-body ol, .modal-body ul { margin-left: 20px; margin-bottom: 12px; }
.modal-body li { margin-bottom: 4px; }