*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  background:#050510;
  color:#f8fafc;
  font-family:"Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

#game{
  display:block;
  width:100vw;
  height:100vh;
  outline:none;
  background:#040b19;
  cursor:crosshair;
}

#overlay{
  position:fixed;
  inset:0;
  pointer-events:none;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  padding:16px;
}

.panel{
  background:rgba(12,20,41,0.65);
  padding:12px 16px;
  border-radius:10px;
  box-shadow:0 10px 30px rgba(2,6,23,0.45);
  max-width:260px;
  pointer-events:auto;
}

.panel.right{
  max-width:200px;
  text-align:right;
}

.panel h1{
  margin:0 0 8px;
  font-size:18px;
  letter-spacing:0.05em;
  text-transform:uppercase;
  color:#38bdf8;
}

.panel ul{
  list-style:none;
  padding:0;
  margin:0;
  display:grid;
  gap:4px;
  font-size:13px;
  color:#e2e8f0;
}

.panel li strong{color:#22d3ee}

.hint{
  margin:0 0 10px;
  font-size:12px;
  color:#94a3b8;
}

#hud-info{
  font-size:13px;
  color:#cbd5f5;
  line-height:1.4;
}

.warning{color:#fda4af; font-weight:600;}

#upgrade-layer{
  position:fixed;
  inset:0;
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:18px;
  padding:24px;
  background:rgba(4,10,24,0.82);
  backdrop-filter:blur(6px);
  transition:opacity 0.18s ease;
  z-index:20;
}

#upgrade-layer.hidden{
  opacity:0;
  pointer-events:none;
}

.upgrade-head{
  text-align:center;
  max-width:480px;
}

.upgrade-head h2{
  margin:0 0 6px;
  font-size:26px;
  letter-spacing:0.08em;
  text-transform:uppercase;
  color:#38bdf8;
}

.upgrade-head p{
  margin:0;
  font-size:15px;
  color:#e0f2fe;
}

#upgrade-container{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:18px;
  max-width:900px;
}

.upgrade-card{
  width:240px;
  padding:18px;
  border-radius:14px;
  background:linear-gradient(160deg, rgba(12,26,55,0.96), rgba(9,16,32,0.92));
  border:1px solid rgba(56,189,248,0.28);
  box-shadow:0 12px 35px rgba(2,6,23,0.55);
  cursor:pointer;
  transition:transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.upgrade-card:hover{
  transform:translateY(-4px);
  border-color:rgba(125,211,252,0.65);
  box-shadow:0 20px 40px rgba(14,165,233,0.35);
}

.upgrade-card h3{
  margin:0 0 8px;
  font-size:18px;
  color:#f1f5f9;
  letter-spacing:0.03em;
}

.upgrade-card p{
  margin:0;
  font-size:13px;
  color:#cbd5f5;
  line-height:1.5;
}

@media (max-width:720px){
  #overlay{
    flex-direction:column;
    align-items:flex-start;
    gap:12px;
  }
  .panel.right{align-self:flex-end; text-align:left;}
}

/* Start Menu Styles */
.start-menu {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, rgba(4,11,25,0.98), rgba(8,20,45,0.98));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.5s ease;
}

.start-menu.hidden {
  display: none;
}

.start-menu-content {
  text-align: center;
  max-width: 600px;
  padding: 40px;
  background: linear-gradient(160deg, rgba(12,26,55,0.9), rgba(9,16,32,0.85));
  border: 2px solid rgba(56,189,248,0.4);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(2,6,23,0.7), 0 0 100px rgba(56,189,248,0.15);
}

.game-title {
  margin: 0 0 12px;
  font-size: 48px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #38bdf8, #7dd3fc, #0ea5e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 40px rgba(56,189,248,0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

.game-subtitle {
  margin: 0 0 40px;
  font-size: 18px;
  color: #7dd3fc;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  opacity: 0.9;
}

.controls-preview {
  background: rgba(4,11,25,0.5);
  padding: 24px;
  border-radius: 12px;
  border: 1px solid rgba(56,189,248,0.2);
  margin-bottom: 32px;
}

.controls-preview h3 {
  margin: 0 0 16px;
  font-size: 20px;
  color: #38bdf8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.controls-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  font-size: 14px;
  text-align: left;
}

.controls-grid div {
  padding: 8px 12px;
  background: rgba(56,189,248,0.08);
  border-radius: 6px;
  border: 1px solid rgba(56,189,248,0.15);
}

.controls-grid strong {
  color: #7dd3fc;
  display: inline-block;
  min-width: 70px;
}

.start-button {
  background: linear-gradient(135deg, #0ea5e9, #38bdf8);
  color: #fff;
  border: none;
  padding: 18px 48px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(14,165,233,0.4), 0 0 40px rgba(56,189,248,0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.start-button::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.start-button:hover::before {
  width: 300px;
  height: 300px;
}

.start-button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 12px 32px rgba(14,165,233,0.6), 0 0 60px rgba(56,189,248,0.5);
}

.start-button:active {
  transform: translateY(0) scale(1);
}

.start-button span {
  position: relative;
  z-index: 1;
}

.hint-text {
  margin: 24px 0 0;
  font-size: 14px;
  color: #94a3b8;
  font-style: italic;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes glow {
  from { 
    text-shadow: 0 0 20px rgba(56,189,248,0.5);
  }
  to { 
    text-shadow: 0 0 40px rgba(56,189,248,0.8), 0 0 60px rgba(56,189,248,0.4);
  }
}

@media (max-width: 720px) {
  .start-menu-content {
    padding: 30px 20px;
    max-width: 90%;
  }
  
  .game-title {
    font-size: 32px;
  }
  
  .game-subtitle {
    font-size: 14px;
  }
  
  .controls-grid {
    grid-template-columns: 1fr;
    font-size: 13px;
  }
  
  .start-button {
    padding: 16px 36px;
    font-size: 20px;
  }
}
