/* CSS Design System - Elemental Tower Defense (with Animated Hand Pointer Tutorial) */

:root {
  --bg-dark: #090d16;
  --bg-panel: rgba(15, 23, 42, 0.75);
  --bg-panel-hover: rgba(30, 41, 59, 0.85);
  --border-glass: rgba(255, 255, 255, 0.12);
  --border-glow: rgba(0, 243, 255, 0.3);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  /* Elemental Accent Colors */
  --fire-color: #ff4500;
  --fire-glow: rgba(255, 69, 0, 0.4);
  --ice-color: #00f3ff;
  --ice-glow: rgba(0, 243, 255, 0.4);
  --lightning-color: #e0a96d;
  --lightning-glow: rgba(255, 215, 0, 0.4);
  --earth-color: #10b981;
  --earth-glow: rgba(16, 185, 129, 0.4);

  --accent-gold: #fbbf24;
  --accent-danger: #ef4444;
  --accent-success: #22c55e;
  
  --font-title: 'Orbitron', sans-serif;
  --font-body: 'Inter', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(0, 243, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(255, 69, 0, 0.05) 0%, transparent 40%),
    linear-gradient(180deg, #060911 0%, #0d1322 100%);
  color: var(--text-main);
  font-family: var(--font-body);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* App Header Dashboard */
.app-header {
  height: 64px;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--fire-color), var(--ice-color));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 900;
  color: #000;
  box-shadow: 0 0 15px var(--ice-glow);
}

.brand h1 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  background: linear-gradient(90deg, #fff, var(--ice-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stats-bar {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat-badge {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: 30px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-title);
  font-size: 0.9rem;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
}

.stat-badge.gold { border-color: rgba(251, 191, 36, 0.4); color: var(--accent-gold); }
.stat-badge.lives { border-color: rgba(239, 68, 68, 0.4); color: var(--accent-danger); }
.stat-badge.wave { border-color: rgba(0, 243, 255, 0.4); color: var(--ice-color); }

.stat-icon { font-size: 1.1rem; }

.controls-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ultimate-wrapper {
  position: relative;
  width: 170px;
  height: 34px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--fire-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.ult-charge-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #ff4500, #ffe600);
  opacity: 0.6;
  transition: width 0.25s ease;
}

.ult-text {
  position: relative;
  font-family: var(--font-title);
  font-size: 0.75rem;
  letter-spacing: 1px;
  color: #fff;
  z-index: 2;
  text-shadow: 0 0 4px #000;
}

.btn-ctrl {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ctrl:hover {
  background: var(--bg-panel-hover);
  border-color: var(--ice-color);
  box-shadow: 0 0 10px var(--ice-glow);
  transform: translateY(-1px);
}

.btn-ctrl.active {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.2), rgba(157, 78, 221, 0.2));
  border-color: var(--ice-color);
  color: var(--ice-color);
}

.btn-accent {
  background: linear-gradient(135deg, var(--fire-color), #d97706);
  border: none;
  font-family: var(--font-title);
  letter-spacing: 1px;
  color: #fff;
  box-shadow: 0 0 15px var(--fire-glow);
}

.btn-accent:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 20px var(--fire-color);
}

/* Main Layout Area */
.main-wrapper {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
}

/* Canvas Game Container */
.canvas-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(circle at center, #0f172a 0%, #070a12 100%);
  padding: 16px;
}

canvas#gameCanvas {
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.8), 0 0 1px 1px var(--border-glass);
  background-color: #0c101d;
  cursor: crosshair;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Floating HUD Bar Overlay on Canvas */
.canvas-overlay-bar {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 30px;
  padding: 8px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  pointer-events: auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 5;
}

.map-name {
  font-family: var(--font-title);
  font-size: 0.9rem;
  letter-spacing: 1px;
  color: var(--ice-color);
}

.wave-progress-bar {
  width: 180px;
  height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.wave-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ice-color), var(--fire-color));
  transition: width 0.3s ease;
}

/* Sidebar HUD Panel */
.sidebar-hud {
  width: 340px;
  background: var(--bg-panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 20px;
  overflow-y: auto;
  z-index: 8;
}

.section-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Tower Shop Cards */
.tower-shop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.tower-card {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.card-cooldown-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  font-family: var(--font-title);
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

.tower-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: var(--card-accent, var(--ice-color));
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 10px var(--card-glow, var(--ice-glow));
  transform: translateY(-2px);
}

.tower-card.selected {
  border-color: #fff;
  background: rgba(51, 65, 85, 0.9);
  box-shadow: 0 0 15px var(--card-glow, var(--ice-glow));
}

.tower-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.tower-card.disabled:hover {
  transform: none;
  box-shadow: none;
}

.tower-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tower-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.tower-cost {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--accent-gold);
}

.tower-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.tower-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Selected Tower Details Panel */
.detail-panel {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-title {
  font-family: var(--font-title);
  font-size: 1rem;
  color: var(--text-main);
}

.priority-selector {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 8px;
}

.btn-prio {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-prio.active {
  background: var(--ice-color);
  color: #000;
  font-weight: 700;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 0.8rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.stat-row span:last-child {
  color: var(--text-main);
  font-weight: 600;
}

.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-action {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-family: var(--font-title);
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border-glass);
  transition: all 0.2s ease;
}

.btn-upgrade {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  box-shadow: 0 0 10px var(--earth-glow);
}

.btn-upgrade:hover { filter: brightness(1.2); }

.btn-sell {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
  border-color: rgba(239, 68, 68, 0.4);
}

.btn-sell:hover { background: rgba(239, 68, 68, 0.4); }

/* Elemental Synergies Legend */
.synergy-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.synergy-item {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 8px;
  border-left: 3px solid var(--ice-color);
}

.synergy-item strong { color: var(--ice-color); }

/* Dynamic Animated Hand Pointer Tutorial Styling */
.tutorial-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

.tutorial-hand {
  position: absolute;
  font-size: 3.2rem;
  z-index: 95;
  filter: drop-shadow(0 0 15px var(--accent-gold));
  transition: all 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  animation: handPulse 0.9s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: top left;
}

@keyframes handPulse {
  from { transform: translate(-10px, -10px) scale(1); }
  to { transform: translate(10px, 10px) scale(1.18); }
}

.tutorial-tooltip {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 2px solid var(--accent-gold);
  border-radius: 16px;
  padding: 16px 28px;
  text-align: center;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(251, 191, 36, 0.4);
  z-index: 96;
  max-width: 450px;
}

.tutorial-step-title {
  font-family: var(--font-title);
  font-size: 0.85rem;
  color: var(--accent-gold);
  letter-spacing: 1.5px;
  margin-bottom: 4px;
}

.tutorial-step-text {
  font-size: 0.95rem;
  color: #fff;
  font-weight: 600;
}

/* Start Screen & Result Boards Styling */
.screen-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 8, 18, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.screen-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.start-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 24px;
  padding: 40px 48px;
  width: 720px;
  max-width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 40px var(--border-glow);
  animation: cardFadeUp 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cardFadeUp {
  from { transform: translateY(40px) scale(0.92); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.start-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--fire-color), var(--ice-color));
  width: 68px;
  height: 68px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 25px var(--ice-glow);
}

.start-brand h1 {
  font-family: var(--font-title);
  font-size: 2.2rem;
  letter-spacing: 3px;
  background: linear-gradient(90deg, #fff, var(--ice-color), var(--fire-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.start-brand .subtitle {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 2px;
  color: var(--text-muted);
}

.instructions-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
}

.inst-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.inst-icon { font-size: 1.8rem; }

.inst-card h3 {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 1px;
  color: var(--ice-color);
}

.inst-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.map-selector-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.map-label {
  font-family: var(--font-title);
  font-size: 0.8rem;
  letter-spacing: 1.5px;
  color: var(--text-muted);
}

.map-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-map {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-map.active {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.3), rgba(255, 69, 0, 0.3));
  border-color: var(--ice-color);
  box-shadow: 0 0 15px var(--ice-glow);
  color: #fff;
  font-weight: 700;
}

.start-actions-group {
  display: flex;
  gap: 16px;
  width: 100%;
  justify-content: center;
}

.btn-huge {
  padding: 16px 40px;
  border-radius: 14px;
  font-family: var(--font-title);
  font-size: 1.1rem;
  letter-spacing: 2px;
  cursor: pointer;
  border: none;
  transition: all 0.25s ease;
}

.btn-huge:hover {
  transform: scale(1.05);
  box-shadow: 0 0 35px var(--fire-color);
}

/* Detailed Instructions Modal Styling */
.instructions-modal-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-glow);
  border-radius: 24px;
  padding: 32px 36px;
  width: 780px;
  max-width: 94%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.95), 0 0 50px var(--border-glow);
  animation: cardFadeUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
}

.modal-header h2 {
  font-family: var(--font-title);
  font-size: 1.3rem;
  color: var(--ice-color);
  letter-spacing: 1px;
}

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.btn-close:hover { color: var(--accent-danger); }

.instructions-content {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-right: 8px;
}

.guide-step {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-num {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--ice-color), var(--fire-color));
  color: #000;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.2rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-main);
  line-height: 1.5;
}

.step-details h3 {
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--accent-gold);
}

.step-details ul {
  margin-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.highlight-box {
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--ice-color);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--ice-color);
}

.modal-footer {
  display: flex;
  justify-content: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-glass);
}

.result-card {
  background: var(--bg-panel);
  border-radius: 24px;
  padding: 40px 48px;
  width: 520px;
  max-width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9);
  animation: cardFadeUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.victory-theme {
  border: 1px solid rgba(251, 191, 36, 0.5);
  box-shadow: 0 0 40px rgba(251, 191, 36, 0.3);
}

.defeat-theme {
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.3);
}

.trophy-badge, .skull-badge { font-size: 3.5rem; }

.star-rating {
  font-size: 1.8rem;
  letter-spacing: 6px;
}

.result-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  letter-spacing: 2px;
}

.result-title.victory {
  background: linear-gradient(90deg, #fbbf24, #22c55e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-title.defeat {
  background: linear-gradient(90deg, #ef4444, #f97316);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.defeat-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.rank-badge {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 900;
  padding: 6px 24px;
  border-radius: 30px;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #000;
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.rank-badge.defeat-rank {
  background: linear-gradient(135deg, #ef4444, #991b1b);
  color: #fff;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.5);
}

.result-stats-grid {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 14px;
  padding: 16px 24px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.9rem;
}

.result-stats-grid div {
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.result-stats-grid strong { color: var(--text-main); }

.pro-tip-box {
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--ice-color);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.8rem;
  color: var(--ice-color);
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.modal-actions button { flex: 1; }

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  border: none;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-danger:hover { filter: brightness(1.2); }

@media (max-width: 700px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-header {
    height: auto;
    min-height: 56px;
    padding: 8px;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand h1 { font-size: 0.82rem; }
  .brand-icon { width: 30px; height: 30px; }
  .stats-bar, .controls-bar {
    max-width: 100%;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .stat-badge { padding: 4px 8px; font-size: 0.72rem; }
  .btn-ctrl { padding: 6px 8px; font-size: 0.72rem; }
  .ultimate-wrapper { width: 118px; height: 30px; }

  .main-wrapper {
    width: 100%;
    display: block;
    overflow: visible;
  }
  .canvas-container {
    width: 100%;
    min-height: 245px;
    padding: 6px;
  }
  canvas#gameCanvas {
    width: 100%;
    height: auto;
  }
  .canvas-overlay-bar {
    top: 8px;
    max-width: calc(100% - 16px);
    padding: 6px 10px;
    gap: 8px;
  }
  .wave-progress-bar { width: 90px; }
  .sidebar-hud {
    width: 100%;
    max-height: none;
    padding: 12px;
    gap: 12px;
    border-left: 0;
    border-top: 1px solid var(--border-glass);
  }

  .screen-backdrop {
    align-items: flex-start;
    overflow-y: auto;
    padding: 10px 0;
  }
  .start-card, .instructions-modal-card, .result-card {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    padding: 16px 12px;
    gap: 12px;
    border-radius: 14px;
  }
  .start-brand h1 { font-size: 1.35rem; letter-spacing: 1px; }
  .brand-badge { width: 48px; height: 48px; font-size: 2rem; }
  .instructions-grid { grid-template-columns: 1fr; gap: 8px; }
  .inst-card { padding: 9px; }
  .map-buttons, .start-actions-group { flex-wrap: wrap; gap: 8px; }
  .btn-map, .btn-huge { padding: 10px 12px; font-size: 0.78rem; }
  .guide-step { padding: 10px; gap: 9px; }
}
