/* AVB Pulsmesser - Component Styles */

* { box-sizing: border-box; }

body {
  font-family: var(--font-family);
  background: var(--bg-page);
  color: var(--text-primary);
  margin: 0;
  overflow: hidden;
  transition: background var(--transition-normal), color var(--transition-normal);
}

/* ── Stage Container ── */
.stage-viewport {
  width: 100vw;
  height: 100vh;
  background: var(--bg-stage);
  position: relative;
  overflow: hidden;
}

.stage-wrapper {
  width: 1024px;
  height: 768px;
  position: absolute;
  transform-origin: 0 0;
  cursor: default;
}

/* ── Sprite Layers ── */
.stage-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 1024px;
  height: 768px;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  image-rendering: auto;
}

/* ── Blackboard Text Overlay ── */
.blackboard-text {
  position: absolute;
  left: 278px;
  top: 117px;
  width: 461px;
  height: 254px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
  font-family: 'Verdana', sans-serif;
  font-size: 25px;
  line-height: 1.3;
  padding: 20px;
  pointer-events: none;
  z-index: 50;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ── Click-to-Start Splash ── */
.splash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  cursor: pointer;
}

.splash-title {
  color: white;
  font-size: 2.5rem;
  font-weight: var(--font-bold);
  margin-bottom: var(--space-md);
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.splash-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.2rem;
  margin-bottom: var(--space-xl);
}

.splash-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-2xl);
  border-radius: var(--radius-xl);
  font-size: var(--font-size-xl);
  font-weight: var(--font-bold);
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

.splash-btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.05);
}

/* ── Progress Bar ── */
.progress-bar-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.5s ease;
  border-radius: 0 3px 3px 0;
}

/* ── Controls Overlay ── */
.controls-overlay {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  display: flex;
  gap: var(--space-xs);
  z-index: 200;
}

.control-btn {
  background: rgba(0, 0, 0, 0.4);
  color: rgba(255, 255, 255, 0.8);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-sm);
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  color: white;
}

/* ── End Screen ── */
.end-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  color: white;
}

.end-screen h2 {
  font-size: 2rem;
  margin-bottom: var(--space-md);
}

.end-screen p {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: var(--space-lg);
}

.end-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-lg);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.end-btn:hover {
  background: var(--color-primary-dark);
  transform: scale(1.03);
}

/* ── Debug Panel ── */
.debug-panel {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  background: rgba(0, 0, 0, 0.75);
  color: #0f0;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  font-family: monospace;
  font-size: 11px;
  z-index: 300;
  max-width: 220px;
  pointer-events: auto;
}

.debug-panel div { margin: 2px 0; }

.debug-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #0f0;
  border: 1px solid rgba(0, 255, 0, 0.3);
  padding: 2px 6px;
  margin: 1px;
  cursor: pointer;
  font-family: monospace;
  font-size: 10px;
  border-radius: 3px;
}

.debug-btn:hover {
  background: rgba(0, 255, 0, 0.2);
}

/* ── Toast notification ── */
.toast-msg {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--color-success);
  font-size: var(--font-size-sm);
  z-index: 9999;
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.toast-msg.error { border-left-color: var(--color-danger); }
