body {
  font-family: "Cinzel", serif;
  background: #1a1a1a;
  margin: 0;
  padding: 0;
  overflow: hidden;
  color: #e0d4b5;
  width: 100%;
  height: 100%;
}

.game-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 1000px;
  height: 800px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
}

.screen {
  width: 800px;
  height: 600px;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid #5a6347;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#game-screen {
  width: 800px;
  height: 600px;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid #5a6347;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  /* Убираем скролл на всём #game-screen */
}

#rules-screen {
  justify-content: space-between;
}

h1,
h2,
h3 {
  margin: 0;
  text-align: center;
}

h1 {
  font-size: 36px;
  color: #b8b5a0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

h2 {
  font-size: 24px;
}

h3 {
  font-size: 18px;
  color: #a0a58e;
}

button {
  background: rgba(90, 99, 71, 0.8);
  border: 1px solid #5a6347;
  border-radius: 8px;
  color: #e0d4b5;
  font-size: 16px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s;
  min-width: 100px;
  min-height: 40px;
}

button:hover {
  background: #6b774c;
}

button:disabled {
  background: rgba(90, 99, 71, 0.3);
  cursor: not-allowed;
}

.stats {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin: 5px 0;
}

.stats span {
  background: rgba(90, 99, 71, 0.5);
  padding: 5px 10px;
  border: 1px solid #5a6347;
  border-radius: 5px;
}

.top-stats {
  margin-top: 5px;
}

.bottom-stats {
  margin-top: 1px;
  margin-bottom: 1px;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.centered-date {
  text-align: center;
  margin: 2px 0;
}

.difficulty-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.difficulty-option p {
  font-size: 14px;
  margin: 0;
}

.event-section,
.passive-section {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 50px;
}

#event-title,
#passive-title,
#map-title {
  font-size: 24px;
  color: #e0d4b5;
  text-align: center;
  margin: 0;
}

#event-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  /* Убираем скролл полностью */
  overflow: hidden;
  /* Было overflow-y: auto */
}

#passive-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

#passive-options li {
  background: rgba(90, 99, 71, 0.8);
  border: 1px solid #5a6347;
  border-radius: 8px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s;
  list-style-type: none;
  text-align: center;
  width: 80%;
  margin: 0;
}

#passive-options li:hover {
  background: #6b774c;
}

.modal {
  position: absolute;
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-height: 80%;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid #5a6347;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 1000;
  overflow: hidden;
}
#notification-window {
  z-index: 2000;
}

#settings-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-height: 80%;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid #5a6347;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 1000;
  overflow-y: auto;
}

#settings-window::-webkit-scrollbar {
  width: 10px;
}

#settings-window::-webkit-scrollbar-track {
  background: #3a3a3a;
  border-radius: 5px;
}

#settings-window::-webkit-scrollbar-thumb {
  background: #6b774c;
  border-radius: 5px;
}

#settings-window::-webkit-scrollbar-thumb:hover {
  background: #8a9a5e;
}

#music-window {
  width: 700px;
  height: 400px;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid #5a6347;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 1000;
  overflow: hidden;
}

#volume-slider {
  width: 200px;
  accent-color: #6b774c;
}

#language-select {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

#event-window-desc,
#event-result-text,
#event-result-effects,
#passive-result-text,
#passive-result-effects {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  text-align: center;
  padding-left: 0;
  list-style-type: none;
  margin: 0;
}

#event-choices,
#passive-options {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-height: 150px;
  overflow-y: auto;
  overflow-x: hidden;
}

#intro-text {
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
}

#event-window-desc::-webkit-scrollbar,
#event-result-text::-webkit-scrollbar,
#event-result-effects::-webkit-scrollbar,
#passive-result-text::-webkit-scrollbar,
#passive-result-effects::-webkit-scrollbar,
#event-choices::-webkit-scrollbar,
#passive-options::-webkit-scrollbar {
  width: 8px;
}

#event-window-desc::-webkit-scrollbar-track,
#event-result-text::-webkit-scrollbar-track,
#event-result-effects::-webkit-scrollbar-track,
#passive-result-text::-webkit-scrollbar-track,
#passive-result-effects::-webkit-scrollbar-track,
#event-choices::-webkit-scrollbar-track,
#passive-options::-webkit-scrollbar-track {
  background: rgba(90, 99, 71, 0.2);
  border-radius: 4px;
}

#event-window-desc::-webkit-scrollbar-thumb,
#event-result-text::-webkit-scrollbar-thumb,
#event-result-effects::-webkit-scrollbar-thumb,
#passive-result-text::-webkit-scrollbar-thumb,
#passive-result-effects::-webkit-scrollbar-thumb,
#event-choices::-webkit-scrollbar-thumb,
#passive-options::-webkit-scrollbar-thumb {
  background: #5a6347;
  border-radius: 4px;
}

#event-window-desc::-webkit-scrollbar-thumb:hover,
#event-result-text::-webkit-scrollbar-thumb:hover,
#event-result-effects::-webkit-scrollbar-thumb:hover,
#passive-result-text::-webkit-scrollbar-thumb:hover,
#passive-result-effects::-webkit-scrollbar-thumb:hover,
#event-choices::-webkit-scrollbar-thumb:hover,
#passive-options::-webkit-scrollbar-thumb:hover {
  background: #6b774c;
}

.save-slot {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
}

.save-slot p {
  margin: 0;
  font-size: 16px;
  width: 150px;
}

#save-slots {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.rules-content {
  width: 100%;
  max-height: 400px;
  color: #e0d4b5;
  font-size: 16px;
  line-height: 1.6;
  text-align: justify;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 20px;
}

.rules-content::-webkit-scrollbar {
  width: 8px;
}

.rules-content::-webkit-scrollbar-track {
  background: rgba(90, 99, 71, 0.2);
  border-radius: 4px;
}

.rules-content::-webkit-scrollbar-thumb {
  background: #5a6347;
  border-radius: 4px;
}

.rules-content::-webkit-scrollbar-thumb:hover {
  background: #6b774c;
}

.rules-content h2 {
  font-size: 24px;
  color: #b8b5a0;
  text-align: center;
  margin: 20px 0 10px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rules-content ul {
  list-style-type: none;
  padding-left: 0;
}

.rules-content li {
  margin-bottom: 15px;
  padding-left: 20px;
  position: relative;
}

.rules-content li:before {
  content: "◆";
  color: #6b774c;
  position: absolute;
  left: 0;
  font-size: 14px;
}

.rules-content strong {
  color: #a0a58e;
}

#music-list-window {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  max-height: 70%;
  background: rgba(30, 30, 30, 0.95);
  border: 2px solid #5a6347;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 1001;
  overflow-y: auto;
}

.music-list {
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.music-list button {
  background: rgba(90, 99, 71, 0.8);
  border: 1px solid #5a6347;
  border-radius: 8px;
  color: #e0d4b5;
  font-size: 16px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s;
  width: 80%;
  text-align: center;
}

.music-list button:hover {
  background: #6b774c;
}

.music-list button.selected {
  background: #6b774c;
  border: 2px solid #e0d4b5;
}

.music-list::-webkit-scrollbar {
  width: 8px;
}

.music-list::-webkit-scrollbar-track {
  background: rgba(90, 99, 71, 0.2);
  border-radius: 4px;
}

.music-list::-webkit-scrollbar-thumb {
  background: #5a6347;
  border-radius: 4px;
}

.music-list::-webkit-scrollbar-thumb:hover {
  background: #6b774c;
}

.music-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.music-controls button,
#toggle-music,
#show-music-list,
#close-music {
  width: 150px;
  padding: 10px 0;
  text-align: center;
}

#shuffle-music.active {
  background: #6b774c;
  border: 2px solid #e0d4b5;
}

/* Стили для карты */
#map-window {
  width: 700px;
  height: 400px;
  /* Было 550px, уменьшено до 400px */
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow-y: auto;
  /* Добавлен вертикальный скролл */
  overflow-x: hidden;
}

#map-window::-webkit-scrollbar {
  width: 8px;
}

#map-window::-webkit-scrollbar-track {
  background: rgba(90, 99, 71, 0.2);
  border-radius: 4px;
}

#map-window::-webkit-scrollbar-thumb {
  background: #5a6347;
  border-radius: 4px;
}

#map-window::-webkit-scrollbar-thumb:hover {
  background: #6b774c;
}

#map-content {
  margin: 20px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

#map-tasks {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

#canton-actions {
  width: 600px;
  height: 450px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  overflow: hidden;
}

#tasks-window {
  width: 600px;
  height: 450px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -40%);
  overflow: hidden;
}

#actions-list {
  width: 100%;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

#tasks-list {
  width: 100%;
  height: auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

#swiss-map {
  background: rgba(30, 30, 30, 0.2);
  border: 1px solid #5a6347;
  border-radius: 3px;
}

#swiss-map path {
  transition: fill 0.3s;
}

#swiss-map path:hover {
  fill: rgba(107, 119, 76, 0.9);
}

#swiss-map circle {
  transition: fill 0.3s;
}

#swiss-map circle:hover {
  fill: #ff6666;
}

#swiss-map text {
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Новые стили для Альпийского Редута */
.redoubt-section {
  width: 100%;
  text-align: center;
  margin-bottom: 15px;
}

.redoubt-section h3 {
  margin-bottom: 5px;
}

.redoubt-section p {
  margin: 5px 0;
  font-size: 14px;
}

.improvement-options {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.improvement-options button {
  padding: 8px 15px;
  font-size: 14px;
}

#alpine-redoubt-window {
  width: 700px;
  height: 500px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow-y: auto;
}

#alpine-redoubt-window::-webkit-scrollbar {
  width: 8px;
}

#alpine-redoubt-window::-webkit-scrollbar-track {
  background: rgba(90, 99, 71, 0.2);
  border-radius: 4px;
}

#alpine-redoubt-window::-webkit-scrollbar-thumb {
  background: #5a6347;
  border-radius: 4px;
}

#alpine-redoubt-window::-webkit-scrollbar-thumb:hover {
  background: #6b774c;
}

/* Стили для окна статистики */
#stats-window {
  width: 750px;
  height: 550px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

#stats-legend {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

#stats-graph-container {
  width: 90%;
  height: 350px;
  overflow-x: auto;
  overflow-y: hidden;
  background: rgba(30, 30, 30, 0.2);
  border: 1px solid #5a6347;
  border-radius: 3px;
  padding: 10px;
}

#stats-graph-container::-webkit-scrollbar {
  height: 8px;
}

#stats-graph-container::-webkit-scrollbar-track {
  background: rgba(90, 99, 71, 0.2);
  border-radius: 4px;
}

#stats-graph-container::-webkit-scrollbar-thumb {
  background: #5a6347;
  border-radius: 4px;
}

#stats-graph-container::-webkit-scrollbar-thumb:hover {
  background: #6b774c;
}

#stats-graph svg {
  background: transparent;
}

#partnership-window {
  width: 400px;
  height: 300px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

#partnership-options {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

#axis-partnership-window,
#allies-partnership-window {
  width: 600px;
  height: 400px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.scrollable {
  max-height: 300px;
  overflow-y: auto;
  padding: 10px;
  width: 100%;
}

.scrollable::-webkit-scrollbar {
  width: 8px;
}

.scrollable::-webkit-scrollbar-track {
  background: rgba(90, 99, 71, 0.2);
  border-radius: 4px;
}

.scrollable::-webkit-scrollbar-thumb {
  background: #5a6347;
  border-radius: 4px;
}

.scrollable::-webkit-scrollbbar-thumb:hover {
  background: #6b774c;
}

.action-item {
  background: rgba(90, 99, 71, 0.8);
  border: 1px solid #5a6347;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.action-item p {
  margin: 0;
  font-size: 14px;
}

.action-item button {
  align-self: center;
}

.horizontal-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

#rules-window {
  width: 700px;
  height: 530px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#event-window {
  width: 700px;
  height: 330px;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
}