:root{
  --bg:#ffffff;
  --text:#111;
  --muted:#6b7280;
  --panel:#f5f5f5;
  --panelBorder:#e5e7eb;
  --accent:#111;
}

*{ box-sizing:border-box; }
html,body,#app{ height:100%; }
body{
  margin:0;
  color:var(--text);
  background:var(--bg);
  font-family:"Noto Sans",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
}

#app{
  display:grid;
  grid-template-columns: 300px 1fr;
  grid-template-rows: 1fr;
  gap:0;
  height:100%;
}

#sidebar{
  border-right:1px solid var(--panelBorder);
  padding:16px;
  display:flex;
  flex-direction:column;
  gap:16px;
  background:#fff;
}

.brand h1{
  font-size:20px;
  margin:0 0 4px 0;
  font-weight:600;
}
.brand .sub{
  color:var(--muted);
  font-size:12px;
}

.section-title{
  font-weight:600;
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
  color:var(--muted);
  margin-bottom:8px;
}

.tool-row{
  display:flex;
  gap:8px;
  margin-bottom:8px;
  flex-wrap:wrap;
}
.tool-btn{
  appearance:none;
  border:1px solid var(--panelBorder);
  background:#fff;
  color:var(--text);
  padding:6px 10px;
  border-radius:6px;
  font-size:12px;
  cursor:pointer;
  transition:transform .06s ease, background .12s ease, border-color .12s ease;
}
.tool-btn.active{
  border-color:#111;
  background:#111;
  color:#fff;
}
.tool-btn:active{ transform:scale(0.98); }

.color-row{
  display:flex;
  gap:8px;
}
.color-swatch{
  width:28px;height:28px;border-radius:50%;
  border:2px solid #0000;
  background:var(--c);
  cursor:pointer;
  transition:transform .06s ease, box-shadow .12s ease, border-color .12s ease;
}
.color-swatch.active{
  border-color:#111;
  box-shadow:0 0 0 2px #1112 inset;
}
.hint{
  color:var(--muted);
  font-size:12px;
  margin-top:8px;
}

.stats .stat{
  font-size:13px;
  margin:4px 0;
}

.help ul{
  margin:0;
  padding-left:16px;
  color:var(--muted);
  font-size:12px;
}

#stage-wrap{
  position:relative;
  overflow:hidden;
}
#grid{
  display:block;
  width:100%;
  height:100%;
  cursor:crosshair;
  background:#2b2b2b; /* gris foncé */
}
#overlay{
  position:absolute; inset:0;
  pointer-events:none;
}

/* Mobile / small-screen blocker */
.mobile-blocker{
  display:none; /* shown via media queries */
  position:fixed;
  inset:0;
  background:#000;
  z-index:99999;
  align-items:center;
  justify-content:center;
}
.mobile-blocker-inner{ text-align:center; padding:20px; }
.mobile-blocker-title{
  color:#E53935; /* red alert */
  font-size:20px;
  font-weight:700;
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Show blocker when width < 400px OR height < 600px */
@media (max-width:399px){
  .mobile-blocker{ display:flex; }
}
@media (max-height:599px){
  .mobile-blocker{ display:flex; }
}

.badge{
  position:absolute;
  background:#000;
  color:#fff;
  font-size:12px;
  padding:2px 6px;
  border-radius:4px;
  transform:translate(8px,-8px);
  white-space:nowrap;
  opacity:0.9;
}
.selection-rect{
  position:absolute; border:1px dashed #fff; background:#fff3; pointer-events:none;
}
.preview{
  position:absolute; pointer-events:none; opacity:0.6;
  outline:1px dashed #fff9;
}

.copyright {
  margin-top: auto;
  font-size: 12px;
  padding-top: 8px;
}

#count-red {
  color: red;
}
#count-orange {
  color: orange;
}
#count-yellow {
  color: yellow;
}
#count-green {
  color: green;
}
#count-blue {
  color: blue;
}
#count-pink {
  color: #ec407a;
}