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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #1a1a2e;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
}

#game-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(#1a1a2e, #16213e);
}

#game {
  width: 100%;
  height: 100%;
  max-width: 480px;
  max-height: 900px;
  background: #2e2e40;
  border-radius: 12px;
  box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

#ui {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  max-width: 480px;
  max-height: 900px;
}

#top-bar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px #000;
}

#orders-panel {
  position: absolute;
  top: 46px;
  right: 12px;
  background: rgba(0,0,0,0.55);
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 120px;
  backdrop-filter: blur(4px);
}

#orders-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  color: #FDB813;
}

#orders-list {
  font-size: 0.85rem;
  line-height: 1.35;
}

.order {
  display: flex;
  align-items: center;
  gap: 6px;
}

.order-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

#overlay, #game-over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(26,26,46,0.92);
  text-align: center;
  padding: 24px;
  border-radius: 12px;
  pointer-events: auto;
  z-index: 10;
}

#overlay.hidden, #game-over.hidden {
  display: none;
}

#overlay .logo {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 0 #d62828);
}

#overlay h1, #game-over h2 {
  font-size: 2.6rem;
  color: #FDB813;
  margin-bottom: 8px;
  text-shadow: 2px 2px 0 #d62828;
}

#overlay .tagline {
  font-size: 1.05rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 14px;
  letter-spacing: 0.5px;
}

#overlay .story-box {
  background: rgba(255,255,255,0.08);
  border-left: 4px solid #FDB813;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  text-align: left;
  max-width: 340px;
}

#overlay .story-box p {
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 0;
  color: #f0f0f0;
}

#overlay .controls-list {
  list-style: none;
  font-size: 0.9rem;
  color: #b0b8e6;
  margin: 0 0 22px 0;
  padding: 0;
  line-height: 1.6;
}

#overlay .controls-list li {
  margin-bottom: 4px;
}

#overlay p {
  font-size: 1.05rem;
  margin-bottom: 16px;
  line-height: 1.4;
  color: #e0e0e0;
}

#overlay .hint {
  font-size: 0.9rem;
  color: #9fa8da;
  margin-bottom: 24px;
}

button {
  background: #d62828;
  color: #fff;
  border: none;
  padding: 14px 36px;
  font-size: 1.2rem;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 0 #9e1b1b;
  transition: transform 0.05s;
}

button:active {
  transform: translateY(4px);
  box-shadow: 0 0 0 #9e1b1b;
}

#final-score {
  font-size: 1.3rem;
  margin-bottom: 24px;
}

@media (min-aspect-ratio: 9/16) {
  #game, #ui {
    max-height: 95vh;
  }
}

@media (max-aspect-ratio: 9/16) {
  #game, #ui {
    width: 100vw;
    height: 100vh;
  }
}
