:root {
  color-scheme:dark light;
  --page:var(--tg-theme-bg-color,#111823);
  --surface:var(--tg-theme-secondary-bg-color,#1d2836);
  --ink:var(--tg-theme-text-color,#edf4ff);
  --sub:var(--tg-theme-hint-color,#acc0d5);
  --button:var(--tg-theme-button-color,#83baff);
  --button-text:var(--tg-theme-button-text-color,#101d2b);
  font:16px/1.5 system-ui,sans-serif;
}
* {
  box-sizing:border-box;
}
body {
  margin:0;
  background:var(--page);
  color:var(--ink);
}
main {
  max-width:750px;
  margin:auto;
  padding:clamp(16px,5vw,46px);
  padding-bottom:max(36px,env(safe-area-inset-bottom));
}
h1,p {
  margin:0 0 15px;
}
h1 {
  font-size:clamp(1.65rem,6vw,2.5rem);
  line-height:1.12;
  letter-spacing:-.035em;
}
p,dt,label {
  color:var(--sub);
}
.top {
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:18px;
}
.top p {
  margin:0;
}
.mark {
  width:43px;
  height:43px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:var(--button);
  color:var(--button-text);
  font-weight:750;
}
.surface,.notice,dl {
  background:var(--surface);
  padding:clamp(14px,4vw,27px);
  border-radius:18px;
}
.notice {
  padding-block:10px;
}
.surface[hidden] {
  display:none;
}
[hidden] { display:none !important; }
label {
  display:block;
  margin-top:15px;
}
input,select {
  display:block;
  width:100%;
  margin:.4rem 0 1rem;
  background:var(--page);
  color:var(--ink);
  border:1px solid var(--sub);
  border-radius:11px;
  padding:.75rem;
  font:inherit;
}
.actions,nav {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
nav {
  margin-top:16px;
}
.actions button,a.action,.primary {
  background:var(--button);
  color:var(--button-text);
  font-weight:650;
}
button,a.action {
  border:0;
  text-decoration:none;
  border-radius:11px;
  padding:12px 16px;
  font:inherit;
  cursor:pointer;
  display:inline-block;
}
button {
  background:var(--surface);
  color:var(--ink);
}
[aria-current=page] {
  outline:2px solid var(--button);
  outline-offset:-2px;
}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible {
  outline:3px solid var(--button);
  outline-offset:3px;
}
ol {
  padding-left:1.3rem;
  margin:0;
}
li {
  padding:6px 0;
  overflow-wrap:anywhere;
}
.job { margin-block:10px; padding-block:8px; border-bottom:1px solid var(--page); }
.job button { padding:8px 10px; margin:4px 5px 0 0; border:1px solid var(--sub); }
.job p { margin:2px 0; }
.job progress { display:block; width:100%; max-width:280px; accent-color:var(--button); }
.preview { display:block; width:100%; max-width:360px; border-radius:12px; margin-top:18px; }
.identity,.checkbox { display:flex; gap:10px; align-items:center; }
.checkbox input { width:auto; margin:0; }
.checkbox,#privacy-controls { margin-block:18px; }
.avatar { width:48px; height:48px; border-radius:50%; object-fit:cover; }
button:disabled { opacity:.65; cursor:wait; }
video,.cover {
  width:100%;
  max-height:60vh;
  border-radius:16px;
  background:var(--surface);
  display:block;
}
.cover {
  font-size:5rem;
  text-align:center;
  padding:35px;
}
.brand {
  font-weight:650;
  font-size:.94rem;
}
dl div {
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:6px 0;
}
dd {
  text-align:right;
  margin:0;
}
@media(prefers-color-scheme:light) {
  :root {
    --page:var(--tg-theme-bg-color,#eef4fb);
    --surface:var(--tg-theme-secondary-bg-color,#fff);
    --ink:var(--tg-theme-text-color,#102238);
    --sub:var(--tg-theme-hint-color,#3a536e);
    --button:var(--tg-theme-button-color,#275f9d);
    --button-text:var(--tg-theme-button-text-color,#fff);
  }
}
@media(max-width:450px) {
  nav {
    gap:4px;
  }
  nav button {
    padding:9px;
    font-size:.9rem;
  }
  .actions button {
    flex:1 0 45%;
  }
}
.board {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
  max-width:410px;
  margin:12px 0;
  border-radius:14px;
  background:var(--page);
  padding:8px;
  touch-action:none;
  user-select:none;
}
.tile {
  aspect-ratio:1;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:var(--surface);
  font-size:clamp(.95rem,5vw,1.6rem);
  font-weight:700;
  transition:background-color .2s,color .2s;
}
.tile[data-value]:not([data-value="0"]) {
  background:var(--button);
  color:var(--button-text);
}
.tile[data-value="64"],.tile[data-value="128"],.tile[data-value="256"],.tile[data-value="512"],.tile[data-value="1024"],.tile[data-value="2048"] {
  background:#ffd086;
  color:#332000;
}
.tile.changed { animation:tile-change .16s ease-out; }
@keyframes tile-change { from { transform:scale(.86); } to { transform:scale(1); } }
@media(prefers-reduced-motion:reduce) {
  .tile {
    transition:none;
    animation:none;
  }
}
