* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  background: #05060f;
  color: #e4f3ff;
  font-family: 'Courier New', 'Consolas', monospace;
  overflow: hidden;
  user-select: none;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at center, #0a1130 0%, #05060f 70%);
}

.screen.active {
  display: flex;
}

.title {
  font-size: clamp(32px, 7vw, 56px);
  color: #6effc5;
  letter-spacing: 6px;
  text-shadow: 0 0 20px #6effc5, 0 0 40px rgba(110, 255, 197, 0.4);
  margin-bottom: 16px;
}

.subtitle {
  font-size: clamp(14px, 2.5vw, 18px);
  color: #8ba8c9;
  margin-bottom: 32px;
  letter-spacing: 2px;
}

.hint {
  font-size: 13px;
  color: #6b7a99;
  margin: 12px 0 24px;
  letter-spacing: 1px;
}

.games-left {
  font-size: clamp(16px, 3vw, 22px);
  color: #ffdf5c;
  margin: 12px 0;
}

.country-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  width: 100%;
  max-width: 600px;
}

.country-btn {
  background: rgba(110, 255, 197, 0.08);
  border: 2px solid rgba(110, 255, 197, 0.4);
  color: #e4f3ff;
  padding: 20px;
  font-family: inherit;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.country-btn:hover,
.country-btn:focus {
  background: rgba(110, 255, 197, 0.18);
  border-color: #6effc5;
  transform: translateY(-2px);
  outline: none;
}

.country-btn .flag {
  font-size: 32px;
}

.btn {
  font-family: inherit;
  font-size: 18px;
  padding: 16px 32px;
  cursor: pointer;
  letter-spacing: 2px;
  margin: 6px;
  transition: all 0.15s;
  min-width: 220px;
}

.btn-primary {
  background: #6effc5;
  border: none;
  color: #05060f;
  box-shadow: 0 0 20px rgba(110, 255, 197, 0.5);
}

.btn-primary:hover {
  background: #a5ffd9;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  border: 2px solid #ffdf5c;
  color: #ffdf5c;
}

.btn-secondary:hover {
  background: rgba(255, 223, 92, 0.1);
}

.btn-link {
  background: transparent;
  border: none;
  color: #6b7a99;
  font-size: 14px;
  text-decoration: underline;
  padding: 8px;
  min-width: 0;
}

.btn-link:hover {
  color: #8ba8c9;
}

.final-score {
  font-size: clamp(20px, 4vw, 28px);
  color: #ffdf5c;
  margin: 16px 0 32px;
}

#screen-game {
  background: #000;
  padding: 0;
  overflow: hidden;
}

#hud {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 0 20px;
  color: #6effc5;
  font-size: 18px;
  letter-spacing: 2px;
  z-index: 10;
  pointer-events: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#touch-controls {
  position: absolute;
  bottom: 20px;
  left: 0;
  right: 0;
  display: none;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 10;
}

.touch-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(110, 255, 197, 0.15);
  border: 2px solid rgba(110, 255, 197, 0.6);
  color: #6effc5;
  font-size: 28px;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.touch-btn:active {
  background: rgba(110, 255, 197, 0.35);
}

.touch-btn.fire {
  background: rgba(255, 110, 110, 0.15);
  border-color: rgba(255, 110, 110, 0.6);
  color: #ff6e6e;
  font-size: 32px;
}

.touch-btn.fire:active {
  background: rgba(255, 110, 110, 0.4);
}

@media (pointer: coarse), (max-width: 768px) {
  #touch-controls {
    display: flex;
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 15, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-content {
  background: #0a1130;
  border: 2px solid #6effc5;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 0 40px rgba(110, 255, 197, 0.3);
  position: relative;
}

.modal-content h2 {
  color: #6effc5;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.modal-content .price {
  font-size: 36px;
  color: #ffdf5c;
  margin: 16px 0;
}

.modal-content p {
  color: #e4f3ff;
  line-height: 1.6;
  margin-bottom: 24px;
}

.modal-content #btn-pay-close {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 24px;
  color: #6b7a99;
  background: none;
  border: none;
  cursor: pointer;
  width: 40px;
  height: 40px;
  min-width: 0;
}

[dir="rtl"] .modal-content {
  text-align: right;
}

[dir="rtl"] #hud {
  flex-direction: row-reverse;
}
