:root{
  --bg: #eef3ff;
  --bg2: #f7f2ff;

  --panel: rgb(47, 34, 34);
  --panel2: #764a4a;

  --ink: #0f172a;
  --muted: rgba(15, 23, 42, 0.55);

  --blue: #4aa3ff;
  --pink: #ff7ac3;
  --orchid: #b47bff;

  --danger: #ff4d4d;

  --r12: 12px;
  --r16: 16px;
  --r20: 20px;

  --shadow: 0 18px 50px rgba(17, 24, 39, 0.12);
  --shadow2: 0 10px 22px rgba(17, 24, 39, 0.10);
  --stroke: 1px solid rgba(15, 23, 42, 0.08);
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 900px at 18% 20%, rgba(74,163,255,0.26), transparent 55%),
    radial-gradient(1000px 800px at 85% 30%, rgba(255,122,195,0.22), transparent 52%),
    radial-gradient(1200px 900px at 60% 90%, rgba(180,123,255,0.18), transparent 55%),
    linear-gradient(135deg, var(--bg), var(--bg2));
}

.app{
  height:100%;
  display:flex;
  flex-direction:column;
}

.topbar{
  height:58px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 18px;
  background: rgb(59, 58, 60);
  backdrop-filter: blur(10px);
  border-bottom: var(--stroke);
}

.brand{
  display:flex;
  align-items:center;
  gap:10px;
}

.dot{
  width:10px;height:10px;border-radius:99px;
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: 0 0 0 6px rgba(74,163,255,0.12);
}

.title{
  font-weight:700;
  letter-spacing: 0.2px;
  color: rgb(255, 255, 255);
  ;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:12px;
}

.hint{
  font-size: 13px;
  color: var(--muted);
  padding: 8px 10px;
  border-radius: 999px;
  background: rgb(248, 242, 255);
  border: var(--stroke);
}

.layout{
  flex:1;
  display:flex;
  min-height: 0;
}

.toolbar{
  width: 92px;
  padding: 14px 12px;
  display:flex;
  flex-direction:column;
  gap:10px;

  background: hsl(0, 0%, 97%);
  backdrop-filter: blur(10px);
  border-right: var(--stroke);
}

.tool-btn{
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: var(--stroke);
  background: #fffffff9;
  box-shadow: 0 10px 20px rgba(17,24,39,0.10);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  transition: transform .08s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease;
  user-select:none;
}

.tool-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(17,24,39,0.12);
  background: rgba(255,255,255,0.86);
}

.tool-btn:active{
  transform: translateY(0);
  box-shadow: 0 10px 20px rgba(17,24,39,0.10);
}

.tool-btn.active{
  border-color: rgba(74,163,255,0.55);
  background:rgb(250, 246, 254);
  box-shadow: 0 16px 30px rgba(74,163,255,0.18);
}

.tool-btn.danger{
  border-color: rgba(255,77,77,0.40);
  background: rgba(255,255,255,0.72);
}

.tool-btn.danger:hover{
  background: rgba(255,240,240,0.9);
}

.tool-btn.upload{
  overflow:hidden;
}

.tool-btn.upload input{
  position:absolute;
  inset:0;
  opacity:0;
  cursor:pointer;
}

.icon{
  width: 26px;
  height: 26px;
  display:flex;
  align-items:center;
  justify-content:center;
  color: rgb(68, 67, 69);
}

.icon svg{
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.icon.tbox{
  width: 26px;
  height: 26px;
  border-radius: 10px;
  border: 1px solid rgba(15,23,42,0.12);
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight: 800;
  font-size: 16px;
  background: rgb(255, 255, 255);
}

.tool-divider{
  width: 56px;
  height: 1px;
  background: rgba(15,23,42,0.10);
  margin: 6px 0;
  border-radius: 999px;
}

.control{
  width: 56px;
  padding: 10px 8px;
  border-radius: 18px;
  border: var(--stroke);
  background: rgb(255, 255, 255);
  box-shadow: 0 10px 18px rgba(17,24,39,0.08);
  display:flex;
  flex-direction:column;
  gap:8px;
}

.control-label{
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-align:center;
}

.control-value{
  text-align:center;
  font-size: 12px;
  color: rgba(15,23,42,0.75);
  font-weight: 700;
}

input[type="range"]{
  width: 100%;
  accent-color: var(--orchid);
}

.color-btn{
  width: 56px;
  height: 40px;
  border-radius: 14px;
  border: var(--stroke);
  background: rgb(250, 252, 255);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.color-swatch{
  width: 28px;
  height: 28px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,0.12);
  background: linear-gradient(135deg, var(--blue), var(--pink));
  box-shadow: inset 0 0 0 4px rgba(255, 250, 164, 0.5);
}

.color-input{
  width: 56px;
  height: 40px;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.tool-spacer{ flex:1; }

.mini-note{
  width: 56px;
  font-size: 10px;
  line-height: 1.2;
  color: rgba(15,23,42,0.60);
  text-align:left;
}

/* STAGE / BOARD */
.stage{
  flex:1;
  padding: 22px;
  min-width: 0;
  min-height: 0;
}

.board-shell{
  height:100%;
  border-radius: 28px;
  background: rgb(254, 243, 255);
  border: var(--stroke);
  box-shadow: var(--shadow);
  padding: 18px;
}

.board-wrap{
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  background: rgb(110, 73, 73);
  border: 1px solid rgba(15,23,42,0.10);
  overflow: hidden;
}

canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:block;
}
.color-only {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  background: #fffa5d;
  border: 1px solid rgba(15,23,42,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 18px rgba(17,24,39,0.08);
}

.color-only input[type="color"] {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
}
#mobile-warning {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-warning-box {
  background: #ffffff;
  padding: 24px;
  max-width: 400px;
  text-align: center;
  border-radius: 12px;
  font-family: system-ui, sans-serif;
}

.mobile-warning-box h2 {
  margin-bottom: 10px;
  color: #2c7be5;
}
