* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root{
  --bg1:#0f2027;
  --bg2:#203a43;
  --bg3:#2c5364;

  --border: rgba(255,255,255,.14);
  --text: #ffffff;
  --muted: rgba(255,255,255,.78);
  --muted2: rgba(255,255,255,.65);
  --accent: #2b63ff;
}

body {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--text);
  padding: 18px;
}

.wrap{
  width: min(1100px, 100%);
  border-radius: 18px;
  overflow: hidden;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
}

.top{
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.title{
  font-weight: 800;
  font-size: 16px;
  letter-spacing: .2px;
}

.subtitle{
  margin-top: 6px;
  font-size: 12px;
  opacity: .88;
  line-height: 1.35;
  color: var(--muted);
}

.nav a{
  color: rgba(255,255,255,.88);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  display: inline-block;
}

.nav a:hover{
  background: rgba(255,255,255,.14);
}

main{ padding: 18px; }

.bottom{
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.quick{ display:flex; gap:10px; flex-wrap:wrap; }

.qbtn{
  cursor: pointer;
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,.10);
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.qbtn:hover{ background: rgba(255,255,255,.16); }
.qbtn:disabled{ opacity:.55; cursor:not-allowed; }

.ga{ display:flex; flex-direction:column; gap:12px; }

.ga-head{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
}

.ga-title{
  font-weight: 850;
  font-size: 18px;
}

.ga-subtitle{
  opacity:.85;
  font-size:12px;
  margin-top:6px;
  color: var(--muted);
}

.btnrow{ display:flex; gap:10px; align-items:center; }

.ga-run{
  cursor:pointer;
  border:none;
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--accent);
  color:#fff;
  font-weight: 700;
  letter-spacing: .2px;
  box-shadow: 0 10px 20px rgba(43,99,255,.22);
  transition: transform .12s ease, filter .12s ease;
}

.ga-run:hover{ filter: brightness(1.06); transform: translateY(-1px); }
.ga-run:active{ transform: translateY(0px); }
.ga-run:disabled{ opacity:.6; cursor:not-allowed; box-shadow:none; }

.grid{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:12px;
}

.card{
  border: 1px solid var(--border);
  background: rgba(0,0,0,.16);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.18);
}

.card-title{
  font-weight: 750;
  margin-bottom: 10px;
  opacity: .95;
}

.status{
  opacity:.92;
  margin-bottom:10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px dashed rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}

canvas{
  width: 100% !important;
  background: #ffffff;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  touch-action: none;
}

.hint{
  opacity:.78;
  font-size:12px;
  margin-top:10px;
  color: var(--muted2);
}

.mt{ margin-top: 14px; }

.result{
  display:flex;
  align-items:baseline;
  gap:12px;
}

.big{
  font-size:64px;
  font-weight:900;
  line-height:1;
}

.small{
  font-size:14px;
  opacity:.9;
  color:var(--muted);
}

.top5{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,.92);
  white-space: pre-wrap;
}

@media (max-width: 980px){
  .grid{ grid-template-columns: 1fr; }
}
