* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  background: linear-gradient(135deg, #1e3a5f 0%, #0b1929 100%);
  min-height: -webkit-fill-available;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(10px, 3vw, 20px);
  font-family: 'Original Surfer', cursive, system-ui, sans-serif;
}

/* Game container wrapper */
.simon-wrapper {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Outer circle - main game board */
#outer-circle {
  background: #385a94;
  border-radius: 50%;
  width: min(90vw, 400px);
  height: min(90vw, 400px);
  position: relative;
  border: clamp(6px, 2vw, 10px) solid #1a2f4f;
  box-shadow: 6px 6px 15px rgba(0, 0, 0, 0.4);
  touch-action: manipulation;
}

/* Quarter buttons */
#topleft, #topright, #bottomleft, #bottomright {
  position: absolute;
  width: 50%;
  height: 50%;
  border: clamp(3px, 1vw, 5px) solid #1a2f4f;
  box-sizing: border-box;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: filter 0.1s;
}

#topleft:active, #topright:active, #bottomleft:active, #bottomright:active {
  filter: brightness(1.5);
}

#topleft {
  border-radius: 100% 0 0 0;
  background: darkgreen;
  top: 0; left: 0;
}

#topright {
  border-radius: 0 100% 0 0;
  background: darkred;
  top: 0; right: 0;
}

#bottomleft {
  border-radius: 0 0 0 100%;
  background: goldenrod;
  bottom: 0; left: 0;
}

#bottomright {
  border-radius: 0 0 100% 0;
  background: darkblue;
  bottom: 0; right: 0;
}

/* Inner circle - control center */
#inner-circle {
  position: absolute;
  background: linear-gradient(145deg, #555, #333);
  border-radius: 50%;
  width: 45%;
  height: 45%;
  border: clamp(4px, 1.5vw, 8px) solid #222;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

#title {
  font-size: clamp(1.2rem, 5vw, 1.8rem);
  color: #fff;
  text-shadow: 2px 2px rgba(0,0,0,0.5);
  margin: 0;
  text-align: center;
}

#turn {
  background: #220000;
  color: #ff4444;
  font-family: 'Courier New', monospace;
  font-size: clamp(1rem, 4vw, 1.3rem);
  padding: 4px 10px;
  border-radius: 4px;
  min-width: 40px;
  text-align: center;
  font-weight: bold;
}

/* Controls */
#switches {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
  width: 100%;
  max-width: min(90vw, 400px);
}

.text1, .text2 {
  position: static;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: clamp(0.85rem, 3vw, 1rem);
}

.toggle {
  margin: 0 8px;
}

.button {
  border-radius: 50% !important;
  font-size: clamp(1rem, 4vw, 1.3rem);
  background-color: #c69214;
  color: #062a4d;
  border: none;
  padding: 10px 16px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-weight: bold;
}

.button:active {
  transform: scale(0.95);
}

/* Responsive */
@media (max-width: 400px) {
  #outer-circle {
    width: 85vw;
    height: 85vw;
    border-width: 5px;
  }
  #inner-circle {
    width: 40%;
    height: 40%;
  }
  #title { font-size: 1rem; }
  #turn { font-size: 0.9rem; }
  .button { padding: 8px 14px; font-size: 0.9rem; }
}

@media (max-width: 320px) {
  #outer-circle {
    width: 280px;
    height: 280px;
  }
}

/* Landscape */
@media (max-height: 500px) and (orientation: landscape) {
  body {
    flex-direction: row;
    justify-content: center;
    gap: 20px;
    padding: 10px;
  }
  #outer-circle {
    width: min(60vh, 300px);
    height: min(60vh, 300px);
  }
  #switches {
    flex-direction: column;
    width: auto;
    margin-top: 0;
  }
}
