:root {
  --bg-color: #1a1a1a;
  --primary-color: #ff9800;
  --accent-color: #00bcd4;
  --text-color: #ffffff;
  --modal-bg: rgba(255, 255, 255, 0.95);
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}

body, html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
}

#game-container {
  position: relative;
  width: 100%;
  height: 100%;
}

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

#ui-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Screens */
.screen {
  position: absolute;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  backdrop-filter: blur(5px);
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important; /* Force hide to prevent clicks */
}

/* Typography */
.title {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px var(--primary-color);
  letter-spacing: 2px;
}

.subtitle {
  font-size: 1.2rem;
  opacity: 0.8;
  margin-bottom: 2rem;
}

.instructions {
  margin-top: 1rem;
  font-size: 0.9rem;
  opacity: 0.6;
}

/* Buttons and Inputs */
.btn {
  padding: 12px 30px;
  font-size: 1.1rem;
  border: none;
  border-radius: 30px;
  background: var(--primary-color);
  color: white;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.2s;
  text-transform: uppercase;
  font-weight: bold;
}

.btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px var(--primary-color);
}

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

.btn.small {
  padding: 8px 20px;
  font-size: 0.9rem;
  margin-top: 20px;
  background: #333;
}

.input-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.input-group label {
  margin-bottom: 5px;
  font-size: 0.9rem;
  opacity: 0.8;
}

input[type="text"] {
  padding: 10px;
  border-radius: 5px;
  border: 1px solid #555;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-align: center;
  font-size: 1.1rem;
  width: 200px;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  background: rgba(255, 255, 255, 0.2);
}

/* HUD */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}

.timer-container {
  width: 100%;
  max-width: 300px;
  height: 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  overflow: hidden;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
}

#timer-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, #00bcd4, #4dd0e1);
  transform-origin: left;
  transition: transform 0.1s linear;
}

.score-display {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Victory Modal */
.modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  z-index: 100;
  animation: fadeIn 0.5s ease;
}

.modal-content {
  background: var(--modal-bg);
  padding: 30px;
  border-radius: 20px;
  max-width: 90%;
  width: 400px;
  text-align: center;
  color: #333;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  animation: slideUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cake-icon {
  font-size: 4rem;
  margin-bottom: 15px;
}

.message-text {
  font-size: 1.3rem;
  line-height: 1.5;
  margin-bottom: 10px;
  color: #d32f2f;
  font-weight: bold;
}

.signature {
  font-size: 1rem;
  color: #666;
  font-style: italic;
  margin-top: 5px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
