:root {
  --primary-color: #4CAF50;
  --secondary-color: #f0f0f0;
  --text-color: #333;
  --background: #ffffff;
  --highlight: #e0ffe0;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(rgba(42, 71, 93, 1) 0%, rgba(31, 49, 66, 1) 100%);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  background-color: var(--primary-color);
  color: white;
  padding: 10px 15px;
  display: none;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.top-bar > div {
  margin-left: 10px;
}

.top-bar > div:first-child {
  margin-left: 0;
}

.balance {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  font-size: 0.95rem;
}

.balance .cash,
.balance .bank {
  font-weight: bold;
  color: #1a1a1a;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, auto);
  gap: 5px 15px;
  flex: 1;
  max-width: 400px;
}

.stat {
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
}

.stat label {
  margin-bottom: 2px;
}

progress {
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 5px;
}

progress::-webkit-progress-bar {
  background-color: #ddd;
  border-radius: 5px;
}

progress::-webkit-progress-value {
  background-color: #82d67d;
  border-radius: 5px;
}

main {
  flex: 1;
  padding: 20px;
  background-color: var(--secondary-color);
  overflow-y: auto;
  display: none;
}

.game-body {
  background-color: white;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}

footer {
  background-color: #fafafa;
  border-top: 1px solid #ccc;
  display: none;
}

.menu {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 5px;
  padding: 10px;
}

.menu button {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--highlight);
  border: none;
  border-radius: 10px;
  padding: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.3s;
}

.menu button:hover {
  background: #c8f7c5;
}

.menu i {
  font-size: 1.2rem;
  margin-bottom: 3px;
  color: var(--primary-color);
}

.menu span {
  color: var(--text-color);
}

.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease-out;
}

.fade-in {
  opacity: 1;
  transition: opacity 0.3s ease-in;
}

#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

#loadingLogo {
  width: 100%;
  animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

#loginScreen {
  position: fixed;
  bottom: 2rem;
  left: 0;
  width: 100%;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  text-align: center;
}

.education-section {
  margin-bottom: 2rem;
}

.education-item {
  border-bottom: 1px solid #aaa;
  padding-bottom: 20px;
}

.education-item:last-child {
  border-bottom: 0;
}

.education-options {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.edu-card {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 200px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.edu-card:hover {
  transform: scale(1.03);
}

.edu-card.locked {
  background: #ddd;
  cursor: not-allowed;
  opacity: 0.6;
}

.edu-card.locked:hover {
  transform: none;
}

.popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.popup-content {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 90%;
}

.popup-content button {
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: bold;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.popup-content button:first-child {
  background-color: #4caf50;
  color: white;
}

.popup-content button:last-child {
  background-color: #f44336;
  color: white;
}

.color-white {
	color: #fff;
}

.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* полупрозрачен фон */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  animation: spinAndPulse 2s linear infinite;
  margin: 0 auto;
}

@keyframes spinAndPulse {
  0% {
    transform: rotate(0deg) scale(1);
  }
  25% {
    transform: rotate(90deg) scale(1.1);
  }
  50% {
    transform: rotate(180deg) scale(1.2);
  }
  75% {
    transform: rotate(270deg) scale(1.1);
  }
  100% {
    transform: rotate(359deg) scale(1.01);
  }
}

.loading-text {
  color: #fff;
  font-family: Arial, sans-serif;
  margin-top: 10px;
  text-align: center;
  font-size: 18px;
}