/* Reference proportions are measured against the app width, not the browser. */
.game.tasks-open .tasks-view {
  background:#c7d69b url('assets/tasks-clearing.webp') center/100% 100% no-repeat;
}
.game.tasks-open .tasks-hero {
  position:relative;
  flex:0 0 19%;
  height:auto;
  min-height:105px;
  background:none;
  overflow:visible;
  box-shadow:none;
}
.game.tasks-open .tasks-topline { display:block; padding:0; }
.game.tasks-open .tasks-topline h1 {
  position:absolute;
  top:0;
  left:3%;
  width:61%;
  height:auto;
  min-height:0;
  aspect-ratio:1940 / 810;
  display:block;
  margin:0;
  padding:0;
  background:url('assets/tasks-hanging-sign.webp') center/contain no-repeat;
  filter:drop-shadow(0 2px 2px #49502540);
  color:#52270e;
  font-size:clamp(23px,7.2cqw,38px);
  font-weight:950;
  line-height:1;
  text-shadow:none;
}
.game.tasks-open .tasks-topline h1::before,
.game.tasks-open .tasks-topline h1::after { content:none; display:none; }
.game.tasks-open .tasks-topline h1 > span {
  position:absolute;
  inset:35% 9% 19% 35%;
  display:flex;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
.game.tasks-open .tasks-topline > button { position:absolute; right:2.5%; top:10px; margin:0; }
.game.tasks-open .task-content { margin:0; padding:0 4.5% 16px; background:none; }
.game.tasks-open .task-list { margin:0; padding:0; gap:1px; overflow:visible; }
.game.tasks-open .tasks-view .task-item {
  grid-template-columns:clamp(24px,6.3cqw,30px) minmax(0,1fr) clamp(62px,17cqw,78px);
  align-items:center;
  gap:clamp(6px,1.8cqw,9px);
  min-height:clamp(62px,15.5cqw,76px);
  padding:12px 8%;
  border:0;
  border-radius:0;
  background:url('assets/task-wood-card.webp') center 53%/100% 143% no-repeat;
  box-shadow:none;
  filter:drop-shadow(0 3px 2px #42502544);
}
.game.tasks-open .tasks-view .task-logo { width:100%; height:auto; aspect-ratio:1; border-radius:25%; }
.game.tasks-open .tasks-view .task-logo svg { width:80%; height:80%; }
.game.tasks-open .tasks-view .task-item > div { min-width:0; }
.game.tasks-open .tasks-view .task-item h2 {
  margin:0;
  font:800 clamp(11px,2.8cqw,14px)/1.25 Nunito,sans-serif;
  color:#573018;
  white-space:normal;
  overflow-wrap:break-word;
}
.game.tasks-open .tasks-view .task-item p {
  display:flex;
  align-items:center;
  gap:1.4cqw;
  margin:4px 0 0;
  font:800 clamp(13px,3.3cqw,16px)/1 Nunito,sans-serif;
  color:#97501f;
}
.game.tasks-open .tasks-view .task-reward-coin { width:18px; height:18px; }
.game.tasks-open .tasks-view .task-item > button {
  width:100%;
  min-width:0;
  min-height:28px;
  padding:5px 3px;
  border-radius:3cqw;
  font:800 clamp(11px,2.9cqw,14px)/1.1 Nunito,sans-serif;
}
@media(max-height:600px) {
  .game.tasks-open .tasks-hero { flex-basis:19%; min-height:95px; }
  .game.tasks-open .task-list { gap:1px; }
}
.tasks-instructions { flex-shrink:0; margin:18px 0 0; padding:35px 30px 30px; min-height:150px; background:url('assets/tasks-instructions.webp') center/100% 100% no-repeat; text-align:center; color:#63391c; }
.tasks-instructions h2 { margin:0 0 6px; font:850 clamp(14px,3.8cqw,19px)/1.2 Nunito,sans-serif; }
.tasks-instructions p { margin:0; font:650 clamp(12px,3.15cqw,16px)/1.4 Nunito,sans-serif; }
.game.tasks-open .tasks-view .task-logo.wooden-channel,
.game.tasks-open .tasks-view .task-logo.wooden-app {
  border-radius:0;
  box-shadow:none;
  background-image:url('assets/task-wood-controls.webp');
  background-repeat:no-repeat;
  background-size:189.63% 284.44%;
  background-color:transparent;
}
.game.tasks-open .tasks-view .task-logo.wooden-channel { background-position:50% 1%; }
.game.tasks-open .tasks-view .task-logo.wooden-app { background-position:50% 55.22%; }
.game.tasks-open .tasks-view .task-item > button {
  background:transparent url('assets/task-wood-controls.webp') center 96.8%/100% 374.63% no-repeat;
  border:0;
  box-shadow:none;
  color:#603315;
  text-shadow:none;
  min-height:30px;
  aspect-ratio:2.5;
  padding:4px 5px;
}
.game.tasks-open .tasks-view .task-item > button:disabled { opacity:1; }
.game.tasks-open .tasks-view .task-item.is-complete > button { filter:saturate(.5); }
.game.tasks-open .tasks-view .task-item {
  grid-template-columns:clamp(29px,7.6cqw,36px) minmax(0,1fr) clamp(62px,17cqw,78px);
}
.game.tasks-open .tasks-view .task-item > button {
  background:transparent url('assets/task-leaf-button.webp') center/100% 100% no-repeat;
  min-height:36px;
  aspect-ratio:2.15;
  padding:7px 6px 5px;
}
.game.tasks-open .tasks-view .task-logo.wooden-channel,
.game.tasks-open .tasks-view .task-logo.wooden-app {
  background-image:url('assets/task-leaf-icons.webp');
  background-size:100% 200%;
}
.game.tasks-open .tasks-view .task-logo.wooden-channel { background-position:center top; }
.game.tasks-open .tasks-view .task-logo.wooden-app { background-position:center bottom; }

/* Task cards reconstructed from the supplied reference. */
.game.tasks-open .task-content { padding:0 2% 16px; }
.game.tasks-open .task-list { gap:clamp(3px,1.2cqw,7px); }
.game.tasks-open .tasks-view .task-item {
  grid-template-columns:clamp(65px,19cqw,99px) minmax(0,1fr) clamp(87px,27cqw,137px);
  gap:clamp(3px,1cqw,7px);
  min-height:clamp(84px,23cqw,119px);
  padding:clamp(10px,2.8cqw,15px) 5.5%;
  background:url('assets/task-card-ref-v2.webp') center/100% 142% no-repeat;
  filter:drop-shadow(0 3px 2px #49391f40);
}
.game.tasks-open .tasks-view .task-logo.wooden-channel,
.game.tasks-open .tasks-view .task-logo.wooden-app {
  width:100%; height:auto; aspect-ratio:1;
  background-image:url('assets/task-icons-ref.webp');
  background-size:220% 100%;
  border-radius:0;
  box-shadow:none;
}
.game.tasks-open .tasks-view .task-logo.wooden-channel { background-position:3% center; }
.game.tasks-open .tasks-view .task-logo.wooden-app { background-position:97% center; transform:translateX(clamp(14px,calc(6.5cqw - 12px),22px)) scale(.98); }
@media (min-width:450px) {
  .game.tasks-open .tasks-view .task-logo.wooden-app {
    transform:translateX(21px) scaleX(.92) scaleY(1.02);
  }
}
.game.tasks-open .tasks-view .task-item h2 {
  font:900 clamp(11px,3.4cqw,17px)/1.12 Nunito,sans-serif;
  color:#53260d;
  white-space:nowrap;
  letter-spacing:-.02em;
}
.game.tasks-open .tasks-view .task-item p {
  gap:clamp(3px,.9cqw,6px);
  margin:clamp(3px,1cqw,6px) 0 0;
  font:900 clamp(17px,5cqw,28px)/1 Nunito,sans-serif;
  color:#803b11;
}
.game.tasks-open .tasks-view .task-reward-coin {
  width:clamp(22px,6.6cqw,32px);
  height:clamp(22px,6.6cqw,32px);
}
.game.tasks-open .tasks-view .task-item > button {
  position:relative;
  display:flex; align-items:center; justify-content:center;
  width:90%; min-width:0;
  height:clamp(36px,11cqw,54px);
  justify-self:end;
  min-height:0; aspect-ratio:auto;
  padding:0 4px;
  border:0; border-radius:0;
  background:transparent url('assets/task-button-soft-v2.webp') center/100% 145% no-repeat;
  box-shadow:none;
  color:#602f0f;
  text-shadow:0 1px #ffdc7e;
  font:900 clamp(11px,3.3cqw,17px)/1 Nunito,sans-serif;
  white-space:nowrap;
}
.game.tasks-open .tasks-view .task-item > button::before {
  content:'';
  position:absolute;
  width:clamp(18px,5.5cqw,28px);
  height:clamp(18px,5.5cqw,28px);
  left:-5px;
  bottom:-2px;
  background:url('assets/task-button-leaves.webp') center/contain no-repeat;
  pointer-events:none;
}
.game.tasks-open .tasks-view .task-item:not(.is-complete) > button::after {
  content:'›'; margin-left:3px; font-size:1.4em; line-height:.75;
}
.game.tasks-open .tasks-view .task-item.is-complete > button {
  filter:saturate(.55); color:#6b4b25;
}
@media(max-width:350px) {
  .game.tasks-open .tasks-view .task-item {
    grid-template-columns:52px minmax(0,1fr) 77px;
    padding-inline:6%;
  }
  .game.tasks-open .tasks-view .task-item h2 { font-size:10.5px; }
}

/* Bot tasks use a standalone icon with the same visible footprint as Telegram. */
.game.tasks-open .tasks-view .task-logo.wooden-app {
  background-image:url('assets/task-bot-icon.webp');
  background-size:90% 104%;
  background-position:calc(50% + 1.8cqw) center;
  transform:none;
}

/* Keep the hanging title fixed while the meadow scrolls beneath the cards. */
.game.tasks-open .tasks-view {
  --task-scene-height:calc(100dvh - var(--navigation-height));
  --task-hero-height:max(105px, calc(var(--task-scene-height) * .19));
}
.game.tasks-open .tasks-hero { position:relative; z-index:4; flex-shrink:0; }
.game.tasks-open .task-content {
  isolation:isolate;
  background:url('assets/tasks-meadow-loop.webp') center top/100% auto repeat-y;
  overscroll-behavior:contain;
}
.game.tasks-open .task-content::before {
  content:'';
  position:absolute;
  z-index:0;
  pointer-events:none;
  left:0; right:0; top:0;
  height:calc(var(--task-scene-height) - var(--task-hero-height) + 1px);
  background:url('assets/tasks-clearing.webp') center calc(0px - var(--task-hero-height))/100% var(--task-scene-height) no-repeat;
  -webkit-mask-image:linear-gradient(to bottom,#000 0%,#000 58%,transparent 100%);
  mask-image:linear-gradient(to bottom,#000 0%,#000 58%,transparent 100%);
}
.game.tasks-open .task-list { position:relative; z-index:1; }

/* Existing sign and landscape assets share one screen background; no header region. */
.game.tasks-open .tasks-view {
  position:relative;
  background-color:#c7d69b;
  background-image:url('assets/tasks-hanging-sign.webp'),url('assets/tasks-clearing.webp');
  background-position:3% 0,center top;
  background-size:61% auto,100% 100%;
  background-repeat:no-repeat,no-repeat;
}
.game.tasks-open .tasks-topline {
  position:absolute;
  z-index:4;
  top:0; left:0; right:0;
  height:var(--task-hero-height);
  padding:0;
  pointer-events:none;
}
.game.tasks-open .tasks-topline h1 {
  position:absolute;
  top:25%;
  left:26%;
  width:34%;
  height:50%;
  aspect-ratio:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  background:none;
  filter:none;
  font-size:clamp(23px,7.2cqw,38px);
  color:#55290e;
  text-shadow:0 1px #fff1cf;
}
.game.tasks-open .tasks-topline h1 > span { position:static; inset:auto; display:block; }
.game.tasks-open .tasks-topline > button { pointer-events:auto; }
.game.tasks-open .task-content { margin-top:var(--task-hero-height); }
.game.tasks-open .task-content::before {
  background-image:url('assets/tasks-clearing.webp');
}

/* The entire Tasks scene stays in the viewport; only the cards pane scrolls. */
.game.tasks-open {
  height:100dvh;
  min-height:0;
  max-height:100dvh;
  overflow:hidden;
}
.game.tasks-open .tasks-view {
  flex:1 1 auto;
  min-height:0;
  height:0;
  overflow:hidden;
}
.game.tasks-open .task-content {
  flex:1 1 auto;
  min-height:0;
  overflow-x:hidden;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  background:none;
}
.game.tasks-open .task-content::before { content:none; }

/* Anchor the label to the sign artwork, which scales with the screen width. */
.game.tasks-open .tasks-topline h1 {
  top:7.5cqw;
  left:20%;
  width:34%;
  height:15cqw;
  min-height:0;
  margin:0;
  line-height:1;
  white-space:nowrap;
}

/* Use the supplied glossy button artwork for every task action. */
.game.tasks-open .tasks-view .task-item > button {
  background:transparent url('assets/task-button-user.webp') center/108% 112% no-repeat;
  filter:drop-shadow(0 2px 2px #70441155);
}
.game.tasks-open .tasks-view .task-item > button::before { content:none; }

/* Bring task cards slightly closer without changing their artwork or contents. */
.game.tasks-open .task-list { gap:0; }

/* Long localized names must remain inside the text column. */
.game.tasks-open .tasks-view .task-item > div { min-width:0; max-width:100%; }
.game.tasks-open .tasks-view .task-item h2 { width:100%; margin:0; white-space:normal; overflow-wrap:anywhere; text-wrap:balance; font-size:clamp(11px,3cqw,15px); line-height:1.18; }
.game.tasks-open .tasks-view .task-item > button { min-width:0; max-width:100%; }

/* One viewport scene: cards scroll over it without moving or repeating the landscape. */
.game.tasks-open .tasks-view {
  background-attachment:scroll;
  background-repeat:no-repeat,no-repeat;
}
.game.tasks-open .task-content {
  position:relative;
  isolation:isolate;
  background:none;
  padding-top:18px;
  -webkit-mask-image:none;
  mask-image:none;
}
.game.tasks-open .task-content::before,
.game.tasks-open .task-content::after {
  content:none;
  display:none;
}
