:root{
  --bg:#0b1020;
  --card:#121835;
  --muted:#95a1ff;
  --text:#e8ebff;
  --accent:#6c8cff;
  --success:#22c55e;
  --danger:#ef4444;
}

*{box-sizing:border-box}

html,body{
  height:100%;
}

body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color:var(--text);
  background: radial-gradient(1200px 600px at 10% -10%, #17204f 0%, #0b1020 60%) no-repeat fixed, var(--bg);
  line-height:1.45;
}

.container{
  width:min(1100px, 92vw);
  margin:0 auto;
}

.site-header{
  padding:24px 0 8px;
}

.site-header h1{
  margin:0;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
}

.subtitle{
  margin:.25rem 0 0;
  color:var(--muted);
  font-size:.95rem;
}

.editor-card, .gallery-card{
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border:1px solid rgba(255,255,255,0.08);
  border-radius:20px;
  padding:18px;
  backdrop-filter: blur(6px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.25);
}

.editor-card{
  margin-top:12px;
}

.canvas-wrap{
  display:grid;
  place-items:center;
}

.square-holder{
  width: min(700px, 92vw);
  position: relative;
  aspect-ratio: 1 / 1; /* keeps it square */
  background: #0b0f23;
  border-radius: 16px;
  overflow: hidden;
  border:1px solid rgba(255,255,255,0.1);
}

.konva-mount{
  position:absolute;
  inset:0;
}

.control-bar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  align-items:center;
  margin-top:12px;
}

.btn{
  padding:10px 14px;
  border-radius:12px;
  background:#1b244a;
  color:var(--text);
  border:1px solid rgba(255,255,255,0.08);
  cursor:pointer;
  font-weight:600;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
  user-select:none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover{ transform: translateY(-1px) }
.btn:active{ transform: translateY(0) scale(.98) }
.btn.primary{ background:var(--accent) }
.btn.success{ background:var(--success) }
.btn.danger{ background:var(--danger) }

.hint{
  color: #b8c0ff;
  margin: 8px 2px 0;
  font-size: .9rem;
}

.gallery-card{
  margin-top:16px;
}

.gallery-card h2{
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: var(--muted);
}

.gallery{
  display:flex;
  gap:10px;
  overflow:auto;
  padding-bottom:8px;
}

.thumb{
  width:120px;
  height:120px;
  border-radius:12px;
  overflow:hidden;
  flex:0 0 auto;
  position:relative;
  border:2px solid transparent;
}

.thumb.active{
  border-color:var(--accent);
}

.thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.visually-hidden{
  position:absolute!important;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);
  white-space:nowrap;border:0;
}

.site-footer{
  padding:20px 0 40px;
  color:#9aa4ff;
  text-align:center;
  font-size:.9rem;
}

@media (hover:none){
  .btn:hover{ transform:none; }
}