:root {
  --color-primary: #14B8A6;
  --color-secondary: #2DD4BF;
  --color-accent: #99F6E4;
  --color-bg: #134E4A;
  --color-bg-dark: #0F3D39;
  --color-text: #F0FDFA;
  --color-panel: rgba(19, 78, 74, 0.8);

  --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body.light-theme {
  --color-primary: #0D9488;
  --color-secondary: #14B8A6;
  --color-accent: #0F766E;
  --color-bg: #CCFBF1;
  --color-bg-dark: #F0FDFA;
  --color-text: #134E4A;
  --color-panel: rgba(255, 255, 255, 0.8);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--color-bg-dark);
  color: var(--color-text);
  font-family: var(--font-family);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.header {
  padding: 1rem 2rem;
  background-color: var(--color-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.game-container {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 1rem;
  padding: 1rem;
}

.sidebar {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
}

.panel {
  background: var(--color-panel);
  padding: 1rem;
  border-radius: 8px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255,255,255,0.1);
}

.canvas-wrapper {
  flex: 1;
  background: #000;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: opacity 0.3s;
  z-index: 10;
}

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

.message {
  background: var(--color-bg);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 20px var(--color-primary);
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  font-size: 1rem;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background-color: var(--color-primary);
  color: #fff;
}

.btn.primary:hover {
  background-color: var(--color-secondary);
}

.btn.secondary {
  background-color: transparent;
  border: 1px solid var(--color-secondary);
  color: var(--color-secondary);
}

.btn.secondary:hover {
  background-color: rgba(45, 212, 191, 0.1);
}

.control-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

select {
  padding: 0.5rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 4px;
}

.checkbox {
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

h1 { margin: 0; font-size: 1.5rem; }
h2 { margin-top: 0; font-size: 1.2rem; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 0.5rem; }

@media (max-width: 768px) {
  .game-container {
    flex-direction: column-reverse;
  }
  .sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: 200px;
  }
  .panel {
    flex: 1;
    min-width: 200px;
  }
}
