.canvas-container {
  max-width: 480px;
  margin: 16px auto;
}
.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f5e9d8;
  border-radius: 12px;
  padding: 16px;
  font-family: 'Segoe UI', sans-serif;
  box-sizing: border-box;
  width: 100%;
}
#info { font-size: 16px; margin-bottom: 8px; color: #8a5a2a; visibility: hidden; }
#stopwatch { font-variant-numeric: tabular-nums; font-weight: bold; font-size: 18px; color: #5a2e00; }
#stopwatch.hidden { display: none; }
canvas { border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); width: 100%; height: auto; touch-action: manipulation; }
#boardWrapper {
  position: relative;
  width: 100%;
}
#message {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 20px;
  font-weight: bold;
  color: #000;
  text-align: center;
}
#timerStartScreen {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.78);
  border-radius: 12px;
  padding: 16px 28px;
  text-align: center;
  color: #fff;
  z-index: 5;
}
#timerStartScreen p {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: bold;
}
#timerStartScreen.hidden { display: none; }
#timerStartBtn {
  padding: 9px 32px;
  font-size: 16px;
  background: #5dd460;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#timerStartBtn:hover { background: #48c24a; }
#startScreen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(245, 233, 216, 0.96);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  box-sizing: border-box;
  color: #3a2010;
}
#startScreen p:first-child {
  font-size: 24px;
  margin: 0 0 16px;
}
#startScreen p {
  font-size: 15px;
  line-height: 1.7;
  margin: 6px 0;
}
#startScreen.hidden { display: none; }
#startBtn {
  margin-top: 20px;
  padding: 10px 32px;
  font-size: 16px;
  background: #3cb043;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#startBtn:hover { background: #2e8f35; }
#xShareBtn {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 18px;
  font-size: 15px;
  background: #000;
  color: #fff;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}
#xShareBtn:hover { background: #333; }
#xShareBtn.hidden { display: none; }
#nextBtn {
  margin-top: 10px;
  padding: 7px 24px;
  font-size: 15px;
  background: #3cb043;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#nextBtn:hover { background: #2e8f35; }
#nextBtn.hidden { display: none; }
#retryBtn {
  margin-top: 10px;
  padding: 7px 24px;
  font-size: 15px;
  background: #3cb043;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}
#retryBtn:hover { background: #2e8f35; }
#retryBtn.hidden { display: none; }
#message.visible {
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 14px 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  width: 80%;
  white-space: normal;
  box-sizing: border-box;
}
.lvlReset {
  background: #6b3a1f !important;
  color: #f0d9b5 !important;
  border-color: #c8864e !important;
}
.lvlReset:hover { background: #8b5a2b !important; }
#levelBtns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
  width: 100%;
}
.lvlBtn {
  padding: 6px 4px;
  font-size: 13px;
  background: #3d2009;
  color: #c8a070;
  border: 2px solid #6b4020;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.lvlBtn:hover { background: #5a3015; }
.lvlBtn.active {
  background: #7a4010;
  border-color: #f0a050;
  color: #ffe8b0;
  font-weight: bold;
}
#rule {
  margin-top: 20px;
  font-size: 13px;
  color: #a07858;
  text-align: left;
  width: 100%;
  line-height: 1.6;
}
