:root {
  --candy-pink: #e0559b;
  --candy-deep: #b23a78;
  --candy-purple: #9b59b6;
  --candy-bg1: #ffe3f1;
  --candy-bg2: #f3d9ff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--candy-bg1) 0%, var(--candy-bg2) 100%);
  color: #4a2545;
  min-height: 100vh;
}

#loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--candy-bg1), var(--candy-bg2));
}
.loading-spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 5px solid #f3b4d4; border-top-color: var(--candy-pink);
  animation: spin 0.9s linear infinite;
}
.loading-text { margin-top: 16px; color: var(--candy-deep); font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }

#game-container { max-width: 720px; margin: 0 auto; padding: 16px; }

.game-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.game-title {
  display: flex; align-items: center; gap: 10px; margin: 0;
  font-size: 26px; font-weight: 800; color: var(--candy-deep);
}
.game-title .logo { height: 60px; width: auto; display: block; }
@media (max-width: 560px) { .game-title .logo { height: 46px; } }

.game-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  border: none; border-radius: 10px; padding: 9px 14px;
  background: #fff; color: var(--candy-deep); font-weight: 700; font-size: 14px;
  cursor: pointer; box-shadow: 0 2px 6px rgba(178,58,120,0.18);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(178,58,120,0.25); }
.btn.primary { background: var(--candy-pink); color: #fff; }
select.btn { -webkit-appearance: none; appearance: none; padding-right: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%23b23a78' d='M2 4l4 4 4-4z'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }

.board-wrap {
  display: flex; justify-content: center; padding: 14px;
  background: #fff; border-radius: 18px; box-shadow: 0 8px 24px rgba(178,58,120,0.18);
}
#lollipops-canvas { touch-action: manipulation; cursor: pointer; border-radius: 10px; }

#win-banner {
  display: none; text-align: center; margin: 16px auto 0; max-width: 560px;
  padding: 14px 18px; border-radius: 14px; font-weight: 800; font-size: 18px;
  color: #fff; background: linear-gradient(135deg, #2ecc71, #27ae60);
  box-shadow: 0 6px 16px rgba(39,174,96,0.35);
}

.how-to {
  max-width: 720px; margin: 22px auto; padding: 20px;
  background: #fff; border-radius: 16px; box-shadow: 0 6px 18px rgba(178,58,120,0.12);
}
.how-to h2 { margin-top: 0; color: var(--candy-deep); text-align: center; }
.how-to h3 { color: var(--candy-pink); margin-bottom: 6px; }
.how-to .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.how-to ul { line-height: 1.6; padding-left: 20px; }
@media (max-width: 560px) {
  .how-to .cols { grid-template-columns: 1fr; }
  .game-title { font-size: 22px; }
}
