* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Arial', sans-serif;
  background: linear-gradient(135deg, #1f1c2c 0%, #928dab 100%);
  min-height: 100vh;
  color: white;
}

:root {
  --prompter-bg: #000000;
  --prompter-color: #ffffff;
  --prompter-font-size: 2.4rem;
  --prompter-placeholder: rgba(255, 255, 255, 0.35);
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
}

#waiting-screen {
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
}

.waiting-content {
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  padding: 40px;
  border-radius: 24px;
  backdrop-filter: blur(12px);
  max-width: 480px;
  width: 100%;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.waiting-content h1 {
  font-size: 2.4em;
  margin-bottom: 20px;
}

#qr-container {
  margin: 20px auto;
  background: white;
  padding: 16px;
  border-radius: 16px;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#qr-code {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.code-display {
  margin-top: 20px;
}

.code-display p {
  margin-bottom: 8px;
  opacity: 0.8;
}

.code {
  font-size: 2.5em;
  letter-spacing: 0.2em;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  display: inline-block;
}

.instructions {
  margin-top: 24px;
  opacity: 0.85;
}

.back-btn-waiting,
.back-btn-game {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  border-radius: 50px;
  color: white;
  text-decoration: none;
  font-size: 1em;
  transition: all 0.3s ease;
}

.back-btn-game {
  position: static;
  border-radius: 12px;
}

#game-screen {
  flex-direction: column;
  padding: 0;
  position: relative;
}

.prompter-textarea {
  width: 100%;
  min-height: 100vh;
  border: none;
  background: var(--prompter-bg);
  color: var(--prompter-color);
  font-size: var(--prompter-font-size);
  line-height: 1.4;
  padding: 30px 25% 90px 25%;
  resize: none;
  outline: none;
  white-space: pre-wrap;
  overflow-y: auto;
  font-family: inherit;
}

.prompter-textarea::placeholder {
  color: var(--prompter-placeholder, rgba(255, 255, 255, 0.35));
}

.menu-toggle {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.6em;
  cursor: pointer;
  z-index: 3;
}

.menu-panel {
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 16px;
  padding: 20px;
  width: 260px;
  transform: translateX(-290px);
  transition: transform 0.3s ease;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.menu-panel.open {
  transform: translateX(0);
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
}

.menu-close {
  background: none;
  border: none;
  color: white;
  font-size: 1.4em;
  cursor: pointer;
}

.menu-link {
  color: white;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  border-radius: 10px;
  text-align: center;
}

.menu-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toggle-section {
  gap: 4px;
}

.toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.toggle-help {
  font-size: 0.85em;
  opacity: 0.75;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  transition: all 0.2s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #4caf50;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}

.menu-options {
  display: flex;
  gap: 8px;
}

.menu-options button {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  cursor: pointer;
}

#font-size-range {
  width: 100%;
}

.scroll-top-btn {
  position: absolute;
  right: 30px;
  bottom: 30px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.6em;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.scroll-top-btn.visible {
  display: flex;
}

.fullscreen-btn {
  position: absolute;
  right: 30px;
  bottom: 100px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 1.4em;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.fullscreen-btn.visible {
  display: flex;
}

@media (max-width: 600px) {
  .waiting-content {
    padding: 30px 20px;
  }
  .prompter-textarea {
    font-size: 2rem;
    padding: 50px 20px 80px 20px;
  }
}
