:root{
  --bg:#0b0f19;
  --panel:#121a2b;
  --text:#e9eefc;
  --muted:#9db0d0;

  --primary:#2a68ff;
  --secondary:#3a4157;

  --good:#22c55e;
  --bad:#ef4444;

  --cardBorder: rgba(255,255,255,0.10);
  --shadow: 0 20px 70px rgba(0,0,0,0.55);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 600px at 50% 0%, #162244, var(--bg));
  color:var(--text);
}

.app{
  min-height:100vh;
  display:grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 20px;
  padding: 22px;
}

.wheel-pane,
.panel-pane{
  display:flex;
  align-items:center;
  justify-content:center;
}

/* Card */
.card{
  width: 100%;
  height: 100%;
  max-width: 720px;
  background: rgba(18,26,43,0.72);
  border:1px solid var(--cardBorder);
  border-radius:24px;
  box-shadow: var(--shadow);
  padding: 26px;
}

/* Wheel sizing: scales to viewport nicely */
.wheel-wrap{
  position:relative;
  width: min(68vh, 44vw);
  aspect-ratio: 1 / 1;
  display:flex;
  align-items:center;
  justify-content:center;
}
canvas{
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

/* Pointer */
.pointer{
  position:absolute;
  top:-8px;
  left:50%;
  transform:translateX(-50%);
  width:0;height:0;

  /* tip points DOWN (into the wheel) */
  border-left:22px solid transparent;
  border-right:22px solid transparent;
  border-top:40px solid #ffd54a;

  filter: drop-shadow(0 8px 12px rgba(0,0,0,0.55));
  z-index:2;
}


.panel{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.panel-state{
  display:flex;
  flex-direction:column;
  gap:14px;
  align-items:flex-start;
}

.hidden{ display:none; }

.title{
  margin:0;
  font-size: clamp(28px, 2.2vw, 44px);
}
.subtitle{
  margin:0;
  color: var(--muted);
  font-size: clamp(16px, 1.2vw, 20px);
  line-height: 1.35;
}

.btn{
  appearance:none;
  border:0;
  border-radius:14px;
  padding: 14px 18px;
  font-weight: 800;
  cursor:pointer;
  color: var(--text);
  transition: transform .05s ease, opacity .2s ease;
  font-size: clamp(16px, 1.2vw, 20px);
}
.btn:active{ transform: translateY(1px); }
.btn:disabled{ opacity:0.55; cursor:not-allowed; }

.btn-primary{ background: var(--primary); }
.btn-secondary{ background: var(--secondary); }

.result-header{
  width:100%;
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
}
.result-emoji{
  font-size: clamp(44px, 4vw, 72px);
  line-height:1;
  width: 100%;
  text-align: center;
}
.result-title{
  font-size: clamp(26px, 2vw, 40px);
  font-weight: 900;
  width: 100%;
  text-align: center;
}
.result-label{
  font-size: clamp(20px, 1.6vw, 30px);
  color: var(--text);
  opacity: 0.95;
  padding-top: 6px;
  width: 100%;
  text-align: center;
}

/* Config editor */
.config{
  margin-top:auto;
  width:100%;
  color: var(--muted);
}
.hint{
  margin: 10px 0 6px;
  line-height:1.35;
}
.hint code{
  background: rgba(255,255,255,0.08);
  padding: 2px 6px;
  border-radius: 8px;
  color: var(--text);
}
textarea{
  width:100%;
  border-radius:14px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  padding:12px;
  font-size: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.config-actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:10px;
}

/* Mobile / portrait: stack wheel on top */
@media (max-width: 900px){
  .app{
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
  }
  .wheel-wrap{
    width: min(86vw, 62vh);
  }
  .card{
    max-width: 900px;
  }
  .panel-state{
    align-items:stretch;
  }
  .btn{
    width:100%;
    text-align:center;
  }
}
