/* The studio button and classroom view use the same illustrated scene. */
.jar-home {
  position: relative;
  align-self: stretch;
  min-width: 0;
  margin: 12px 13px 12px 10px;
  padding: 0;
  isolation: isolate;
  container: jar-home / inline-size;
  overflow: hidden;
  color: #354834;
  border: 1.5px solid #b99c54;
  border-radius: 16px;
  background: #fbf3cd;
  box-shadow: 0 3px 0 #9f864a35;
  text-align: left;
}
.jar-home:hover { border-color: #826c38; box-shadow: 0 3px 0 #8b73395e; }
.jar-home:focus-visible { outline-offset: 2px; }
.jar-home-inner {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  align-items: stretch;
  min-height: 118px;
  height: 100%;
}
.jar-scene {
  display: block;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  min-width: 0;
  min-height: 0;
  background: radial-gradient(ellipse at 48% 40%,#fff8d8 0 33%,transparent 70%), #f4edb6;
}
.jar-scene::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#aa8a48 0.55px, transparent .95px), radial-gradient(#b1a17b .5px, transparent .95px);
  background-size: 7px 9px, 11px 5px;
  background-position: 0 0, 3px 4px;
  opacity: .12;
  pointer-events: none;
}
.jar-hills { position: absolute; inset: 0; }
.jar-hills::before,
.jar-hills::after {
  content: ''; position: absolute;
  width: 100%; height: 39%; bottom: -28%;
  border-radius: 50% 50% 0 0;
}
.jar-hills::before { left: -32%; background: #deecce; box-shadow: 0 -1px 0 #b6cba6; transform: rotate(6deg); }
.jar-hills::after { right: -26%; background: #cadbb3; box-shadow: 0 -1px 0 #a4bc95; transform: rotate(-5deg); }
.jar-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.jar-home-copy {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  min-width: 0;
  gap: 5px;
  padding: 12px clamp(10px, 1vw, 20px);
  background: #fefcf5;
}
.jar-link {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .39em .74em;
  border-radius: 100px;
  color: #fff;
  background: #345844;
  font: 700 clamp(14px, 1.10vw, 19px)/1.26 var(--font-display);
  letter-spacing: -.025em;
}
.jar-home:is(:hover,:focus-visible) .jar-link { background: #264834; }
.jar-link-star { width: 1.16em; height: 1.16em; flex: none; filter: drop-shadow(0 0 3px #e9c25474); }
.jar-arrow { font: 700 1.05em/1 var(--font-body); }
.jar-home-score {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font: 700 clamp(14px, 1.23vw, 21px)/1.25 var(--font-display);
  letter-spacing: -.035em;
}
.jar-home-hint { color: #56624f; font-size: clamp(11px, .82vw, 14px); line-height: 1.32; }
@container jar-home (max-width: 315px) {
  .jar-home-inner { grid-template-columns: minmax(0, .75fr) minmax(0, 1fr); }
  .jar-home-copy { padding: 8px; }
  .jar-link { padding: .4em .55em; font-size: 13px; }
  .jar-home-score { font-size: 14px; }
}
@container jar-home (max-width: 204px) {
  .jar-home-inner { grid-template-columns: 1fr; grid-template-rows: minmax(64px, 1fr) auto; }
  .jar-home-copy { align-items: center; text-align: center; gap: 3px; padding: 6px 4px; }
  .jar-home-score { margin: 0; font-size: 12px; }
  .jar-home-hint { font-size: 10.5px; }
}
@container jar-home (max-width: 145px) {
  .jar-link { font-size: 11.5px; gap: 2px; padding: .42em .4em; white-space: nowrap; }
  .jar-link .jar-arrow { font-size: .86em; }
}
@media(max-width:660px) {
  .jar-home { margin: 8px; border-radius: 12px; }
}
@media(max-width:520px) {
  .hero-set:has(.jar-home) { grid-template-columns: minmax(0,1fr) minmax(102px,.8fr); column-gap: 8px; padding: 12px; }
  .hero-set .jar-home { grid-column: 2; grid-row: 1/5; margin: 0; }
  .jar-home-inner { min-height: 118px; }
  .hero-set:has(.jar-home) .hero-actions { grid-row: 4; grid-column: 1; align-self: start; gap: 4px; margin-top: 4px; }
}

/* The full dialog leaves room for keyboard focus and can scroll at high zoom. */
#studio-dialog.jar-dialog {
  inset: 0;
  width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh;
  margin: 0; border: 0; border-radius: 0;
  overscroll-behavior: contain;
  background: #fefcf5;
}
.jar-dialog #dialog-content { min-height: 100%; }
.jar-dialog .jar-dialog-body {
  width: min(100%, 1250px);
  min-height: 100dvh;
  margin: auto;
  padding: clamp(12px, 2.4dvh, 30px) clamp(12px, 3.3vw, 50px);
  display: flex; flex-direction: column;
  gap: clamp(9px, 1.6dvh, 20px);
  text-align: left;
}
.jar-dialog .jar-top { align-items: center; margin: 0; }
.jar-dialog .jar-top > div { min-width: 0; }
.jar-dialog .jar-top .jar-context {
  color: #526b57; font-size: clamp(12px, 1.1vw, 17px); font-weight: 650;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 9px;
  line-height: 1.25; margin: 0 0 .25em; overflow-wrap: anywhere;
}
.jar-context .receipt-letters { margin: 0; gap: 3px; }
.jar-context .receipt-letters span { width: 22px; height: 23px; font-size: 15px; border-radius: 4px; }
.jar-dialog .jar-top .jar-title {
  margin: 0;
  color: #2d4d3b;
  font: 700 clamp(25px, min(4vw, 5dvh), 60px)/1.16 var(--font-display);
  letter-spacing: -.045em; overflow-wrap: anywhere;
}
.jar-dialog .jar-top .icon-button {
  width: 44px; height: 44px; margin: 0;
  border: 1px solid #cbd7c7; border-radius: 50%; color: #345844;
  background: #fefdfc;
}
.jar-stage {
  position: relative;
  display: flex; flex: 1 1 auto; flex-direction: column;
  overflow: hidden; min-width: 0; min-height: 235px;
  border: 1px solid #c6c8a9;
  border-radius: clamp(17px, 2.1vw, 28px);
  background: #fefcf5;
}
.jar-stage .jar-scene { flex: 1 0 145px; }
.jar-stage .jar-scene::before { opacity: .105; }
.jar-score {
  border-top: 1px solid #c2d1b7;
  display: grid; justify-items: center; align-content: center; gap: 2px;
  padding: clamp(7px, 1.25dvh, 15px) 12px;
  color: #35513e; text-align: center;
}
.jar-score-line {
  display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap;
  gap: 0 .27em; max-width: 100%; overflow-wrap: anywhere;
  font: 700 clamp(21px, min(3.8vw, 4.5dvh), 54px)/1.14 var(--font-display);
  letter-spacing: -.045em;
}
.jar-score-line strong { font-weight: 700; color: #264833; }
.jar-score-line > span { font-size: .74em; letter-spacing: -.025em; }
.jar-score-long .jar-score-line { font-size: clamp(17px, 2.5vw, 34px); }
.jar-hint { color: #53634f; font: 500 clamp(12px, 1.15vw, 17px)/1.32 var(--font-body); }
@media(min-width:768px) {
  .jar-hint { font-size: clamp(18px, 1.55vw, 25px); }
}
.jar-hint-star { width: 1.2em; height: 1.2em; margin: 0 .3em 0 0; vertical-align: -.22em; }
.jar-dialog .jar-footer { justify-content: center; flex: none; margin: 0; gap: 6px 10px; }
.jar-dialog .jar-footer .button { min-height: 44px; }
@media(max-width:520px) {
  .jar-dialog .jar-dialog-body { padding-inline: 10px; }
  .jar-dialog .jar-top { padding-inline: 2px; }
  .jar-dialog .jar-footer { column-gap: 6px; }
  .jar-dialog .jar-footer .button { padding-inline: 10px; }
}
@media(max-height:460px) {
  .jar-dialog .jar-dialog-body { padding-block: 7px; gap: 5px; }
  .jar-stage { min-height: 140px; }
  .jar-stage .jar-scene { flex-basis: 95px; }
  .jar-score { padding-block: 3px; }
  .jar-dialog .jar-footer .button { min-height: 39px; }
}
