* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: 'Segoe UI', system-ui, sans-serif; background: #1a0e08; }

#app {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#scene {
  position: relative;
  width: 800px;
  height: 600px;
  border: 6px solid #3a2412;
  border-radius: 4px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  overflow: hidden;
}

/* --- Hardwood floor --- */
#floor {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      #b8814a 0 120px,
      #a5713f 120px 122px,
      #b8814a 122px 240px,
      #c0884d 240px 242px
    );
  box-shadow: inset 0 0 80px rgba(0,0,0,0.25);
}

/* --- Round throw rug --- */
#rug {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 360px;
  height: 360px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      #f3e7d0 0 60px,
      #c76a6a 60px 110px,
      #f3e7d0 110px 150px,
      #2f4a6b 150px 180px
    );
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  pointer-events: none;
}

/* --- Mouse holes (goals) --- */
.mouse-hole {
  position: absolute;
  left: 20%;
  width: 60%;
  height: 40px;
  background: #0c0606;
  pointer-events: none;
  z-index: 1;
}
.mouse-hole-top {
  top: -4px;
  border-bottom-left-radius: 200px 40px;
  border-bottom-right-radius: 200px 40px;
  box-shadow: inset 0 6px 10px rgba(0,0,0,0.8);
}
.mouse-hole-bottom {
  bottom: -4px;
  border-top-left-radius: 200px 40px;
  border-top-right-radius: 200px 40px;
  box-shadow: inset 0 -6px 10px rgba(0,0,0,0.8);
}

/* Gnawed edge detail */
.mouse-hole::after {
  content: '';
  position: absolute;
  left: -4px;
  right: -4px;
  height: 8px;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 8px,
    #3a2412 8px 10px
  );
  pointer-events: none;
}
.mouse-hole-top::after { bottom: -2px; }
.mouse-hole-bottom::after { top: -2px; }

/* --- Canvas --- */
#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
}

/* --- HUD --- */
#hud {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.7);
  display: flex;
  gap: 10px;
  align-items: center;
  z-index: 5;
  pointer-events: none;
}
.hud-divider { font-size: 22px; }
.hud-diff {
  font-size: 14px;
  margin-left: 16px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.4);
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-mute {
  pointer-events: auto;
  border: none;
  background: rgba(0,0,0,0.4);
  color: #fff;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 18px;
  cursor: pointer;
  margin-left: 8px;
}

/* --- Overlays --- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 4, 0.78);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  z-index: 10;
  text-align: center;
  padding: 20px;
}
.overlay.hidden { display: none; }
.overlay h1 {
  font-size: 56px;
  margin-bottom: 10px;
  text-shadow: 0 3px 0 #6d3b1a, 0 6px 20px rgba(0,0,0,0.8);
}
.overlay .tagline { font-size: 20px; margin-bottom: 24px; opacity: 0.9; }
.difficulty { display: flex; gap: 12px; margin-bottom: 24px; }
.btn-diff {
  padding: 10px 22px;
  font-size: 18px;
  border-radius: 10px;
  border: 3px solid #fff;
  background: rgba(0,0,0,0.4);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.btn-diff:hover { background: rgba(200,120,30,0.4); }
.btn-diff.selected { background: #d98a3d; border-color: #ffd89b; }
.btn-big {
  padding: 14px 36px;
  font-size: 26px;
  border-radius: 14px;
  border: none;
  background: #d98a3d;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 4px 0 #8c4e17;
  font-family: inherit;
  font-weight: bold;
  transition: transform 0.1s;
}
.btn-big:hover { background: #e69a4d; }
.btn-big:active { transform: translateY(2px); box-shadow: 0 2px 0 #8c4e17; }

.back-link {
  display: block;
  margin-top: 12px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: rgba(255,255,255,0.8);
}

/* --- Serve countdown --- */
#serve-countdown {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  color: #fff;
  text-shadow: 0 3px 0 #000, 0 6px 12px rgba(0,0,0,0.7);
  pointer-events: none;
  z-index: 6;
}
#serve-countdown.hidden { display: none; }
