/* Baloo Bhaijaan 2 (SIL Open Font License, fonts/OFL.txt), one variable file per alphabet, kept
   here so the game needs no other site and works offline in the app */
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/baloo-bhaijaan-2-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/baloo-bhaijaan-2-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Baloo Bhaijaan 2';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/baloo-bhaijaan-2-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #2b1d14;
  --muted: #6d5c4d;
  --green: #1f6f5c;
  --green-dark: #164f42;
  --red: #c8321f;
  --yellow: #f2c14e;
  --cream: #fff8ec;
  --font: 'Baloo Bhaijaan 2', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
}
/* each shop's colour, for the hint, ticks and titles */
#app[data-shop="foul"] { --green: #2b5c9a; --green-dark: #1d4170; }
#app[data-shop="falafel"] { --green: #a4511d; --green-dark: #7a3a12; }
#app[data-shop="shawarma"] { --green: #a3262a; --green-dark: #7a1a1e; }
#app[data-shop="feteer"] { --green: #6a4c93; --green-dark: #4d356e; }
#app[data-shop="ahwa"] { --green: #146c7a; --green-dark: #0d4f5a; }
#app[data-shop="masmat"] { --green: #8a6d1a; --green-dark: #654f10; }
[data-theme="koshari"] { --tc: #1f6f5c; }
[data-theme="foul"] { --tc: #2b5c9a; }
[data-theme="falafel"] { --tc: #a4511d; }
[data-theme="shawarma"] { --tc: #a3262a; }
[data-theme="feteer"] { --tc: #6a4c93; }
[data-theme="ahwa"] { --tc: #146c7a; }
[data-theme="masmat"] { --tc: #8a6d1a; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  background: radial-gradient(circle at 50% 40%, #4a3324, #1e140d);
  color: var(--ink);
  font-family: var(--font);
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
svg { display: block; }

/* the stage: main.js sets its width (860 to 1100) and scales and centres it on the screen */
#app {
  position: absolute;
  left: 0;
  top: 0;
  width: 1000px;
  height: 460px;
  transform-origin: 0 0;
  overflow: hidden;
  background: #e4f1ea;
}
#scene { position: absolute; left: 0; right: 0; top: 0; height: 300px; }
#counterArt { position: absolute; left: 0; right: 0; top: 250px; height: 210px; pointer-events: none; }

/* ---- the customers, behind the glass, each with their order in a bubble ---- */
.slots {
  position: absolute;
  left: 0;
  right: 0;
  top: 52px;
  height: 248px;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 26px;
  direction: ltr;            /* A S D serve left to right in both languages */
}
.slots[data-n="3"] .slot[data-slot="3"] { display: none; }
.slots[data-n="4"] { gap: 6px; }
.slot { position: relative; width: 190px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; cursor: pointer; }
.slot.empty { visibility: hidden; }
.slot.in .figure { animation: walkin .5s ease-out; }
.slot.out .ticket, .slot.out .bar { opacity: 0; transition: opacity .2s; }
.slot.out .figure { animation: walkout 1.2s ease-in forwards; }
@keyframes walkin { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes walkout { 0%, 45% { transform: none; opacity: 1; } 100% { transform: translateY(80px); opacity: 0; } }
.figure svg { width: 140px; height: 168px; margin-bottom: -26px; }

.ticket {
  position: relative;
  width: 186px;
  min-height: 70px;
  padding: 4px 6px 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .14), 0 6px 14px rgba(0, 0, 0, .12);
}
.ticket .size {
  border-radius: 10px;
  text-align: center;
  font-weight: 800;
  font-size: 15px;
  line-height: 21px;
  background: #ebe4d6;
}
.ticket .size.second { background: var(--yellow); }
.ticket .items { display: flex; flex-wrap: wrap; justify-content: center; gap: 1px 3px; margin-top: 3px; }
.ticket .plain { font-weight: 700; font-size: 14px; color: var(--muted); line-height: 30px; }
.it { position: relative; width: 32px; height: 32px; }
.it svg { width: 100%; height: 100%; }
.it b {
  position: absolute;
  right: -5px;
  bottom: -3px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 15px;
  direction: ltr;
}
.it.side { border-radius: 50%; background: #fff1cc; }
.it.no::after {
  content: '';
  position: absolute;
  left: -1px;
  right: -1px;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: var(--ink);
  border-radius: 2px;
  transform: rotate(-40deg);
}
/* a star customer: a gold bubble, and they pay double */
.slot.vip .ticket { background: #fff6d8; box-shadow: 0 0 0 3px #f2c14e, 0 3px 0 rgba(0, 0, 0, .14), 0 6px 14px rgba(0, 0, 0, .12); }
.vipTag {
  position: absolute;
  top: -10px;
  right: -8px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 0 7px 0 3px;
  border-radius: 999px;
  background: linear-gradient(#ffd966, #e0a21b);
  color: #6b4206;
  font-weight: 800;
  font-size: 13px;
  line-height: 22px;
  direction: ltr;
  box-shadow: 0 2px 0 #a3700c;
}
.vipTag svg { width: 18px; height: 18px; }
/* how long they'll still wait, along the bottom of the bubble */
.bar { position: relative; z-index: 1; width: 130px; height: 9px; margin: -10px 0 4px; border: 2px solid #fff; border-radius: 6px; background: #e6ddd0; overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: #3bb273; }

/* what a customer says, and the coins they pay */
.say {
  position: absolute;
  top: 6px;
  left: 50%;
  z-index: 3;
  width: max-content;
  max-width: 170px;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.3;
  text-align: center;
  unicode-bidi: plaintext;   /* the customers' row is left to right; the words follow the language */
  transform: translateX(-50%);
  transform-origin: center bottom;
  animation: pop .18s ease-out;
}
.say.good { background: var(--green); }
.float {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 800;
  font-size: 26px;
  color: #fff;
  text-shadow: 0 2px 0 #b47c0e, 0 0 6px #b47c0e;
  transform: translateX(-50%);
  animation: rise 1.2s ease-out forwards;
}
.float svg { width: 26px; height: 26px; }
@keyframes pop { from { scale: .6; } to { scale: 1; } }
@keyframes rise { from { opacity: 1; margin-top: 0; } to { opacity: 0; margin-top: -70px; } }

/* ---- the counter: machines and stacks of dishes on the left, the dish in the middle, the bin on
   the right, the topping trays along the front ---- */
#kitchen { position: absolute; left: 0; right: 0; top: 236px; bottom: 0; pointer-events: none; }
#kitchen button { pointer-events: auto; }
#left { position: absolute; left: 12px; top: 0; display: flex; align-items: flex-end; gap: 6px; direction: ltr; }
#sides, #kinds { display: flex; align-items: flex-end; gap: 2px; }
.station {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
}
.station .pic { transition: transform .08s; }
.station:active .pic { transform: translateY(2px) scale(.96); }
.tag {
  position: relative;
  margin-top: -8px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(43, 29, 20, .84);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
}
.side .pic svg { width: 84px; height: 103px; }
#kinds .pic svg { width: 76px; height: 84px; }
#bin { position: absolute; right: 14px; top: 8px; }
#bin .pic svg { width: 74px; height: 92px; }
.station .n, .tray .n {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 24px;
  padding: 0 5px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 24px;
  direction: ltr;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.station .n:empty, .tray .n:empty { display: none; }
.no { animation: shake .3s; }
kbd { display: none; }
@media (hover: hover) and (pointer: fine) {
  kbd {
    display: block;
    position: absolute;
    top: 2px;
    left: 4px;
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .8);
    font: 700 11px/15px var(--font);
    color: #6b747b;
  }
}

/* a machine: a ring while it's making, a glow when it's ready, red when it's burnt */
.ring { position: absolute; top: 0; right: 0; width: 30px; height: 30px; display: none; }
.side.making .ring, .side.ready[data-burns] .ring { display: block; }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { fill: #fff; stroke: #e2d8c8; }
.ring .fg { stroke: #3bb273; stroke-dasharray: 100; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.side.ready .ring .fg { stroke: #f2a541; }
.side.ready .pic { animation: ready 1s ease-in-out infinite; }
.side.burnt .pic { filter: drop-shadow(0 0 6px #d6453b); }
@keyframes ready { 50% { filter: drop-shadow(0 0 7px #ffe066) drop-shadow(0 0 2px #3bb273); } }

/* the dish being made, on a wooden board, and the menu items put out beside it */
#dish { position: absolute; left: calc(50% + 10px); top: -16px; width: 190px; height: 152px; transform: translateX(-50%); }
#dish::before {
  content: '';
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 4px;
  height: 38px;
  border-radius: 50%;
  background: radial-gradient(#c99263, #9a6640);
  box-shadow: 0 3px 0 #6b4430;
}
#dish svg { position: relative; width: 190px; height: 152px; transition: transform .15s; }
#dish .dish-small { transform: scale(.84) translateY(10px); }
#dish .dish-big { transform: scale(1.02); }
#dish .dish-sandwich { transform: scale(.94); }
#dish .dish-plate { transform: translateY(-12px) scale(1.06); }
#dish .dish-fino { transform: scale(.96); }
#dish .dish-salty, #dish .dish-sweet { transform: translateY(-10px) scale(1.04); }
#dish .dish-shai, #dish .dish-qahwa { transform: translateY(-6px); }
#dish .dish-fatta { transform: scale(.98); }
#dish .dish-shorba { transform: translateY(-4px); }
#dish.bump svg { animation: bump .18s; }
@keyframes bump { 50% { transform: scale(1.1); } }
#tray { position: absolute; left: calc(50% + 96px); top: 80px; display: flex; direction: ltr; pointer-events: none; }
#tray svg { width: 42px; height: 42px; margin-left: -8px; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
#hint {
  position: absolute;
  left: calc(50% + 10px);
  top: 124px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 800;
  font-size: 15px;
  color: var(--green-dark);
  text-shadow: 0 1px 0 #fff, 0 0 5px #fff, 0 0 5px #fff;
  pointer-events: none;      /* only words: taps go through to what's under them */
}
#hint.warn { color: var(--red); animation: shake .3s; }
@keyframes shake { 0%, 100% { translate: 0; } 25% { translate: -6px; } 75% { translate: 6px; } }

/* the toppings, in steel trays along the front */
#pots { position: absolute; left: calc(50% + 10px); bottom: 4px; transform: translateX(-50%); display: flex; gap: 8px; }
.tray { position: relative; width: 108px; height: 78px; padding: 0; border: 0; background: none; }
.tray svg { width: 108px; height: 76px; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .3)); transition: transform .08s; }
.tray:active svg { transform: translateY(2px) scale(.97); }
.tray .tag { position: absolute; left: 50%; bottom: -2px; margin: 0; transform: translateX(-50%); }

/* ---- the top bar: the clock, the coins and the customers served; how near the stars are; buttons ---- */
#hud {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  z-index: 4;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
.pills { display: flex; gap: 6px; direction: ltr; }
.pill, #goalbar, .iconbtn {
  border: 2px solid #fff1d0;
  background: linear-gradient(#ffc565, #e8861b);
  box-shadow: 0 3px 0 #a3570c, 0 5px 8px rgba(0, 0, 0, .2);
  color: #fff;
  text-shadow: 0 2px 0 #96500a;
}
.pill {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 12px 0 5px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 19px;
}
.pill i svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .3)); }
#goalbar {
  position: absolute;
  left: 50%;
  top: -2px;
  width: 300px;
  padding: 3px 18px 9px;
  border-top: 0;
  border-radius: 0 0 22px 22px;
  transform: translateX(-50%);
  text-align: center;
}
.sign { font-weight: 800; font-size: 15px; line-height: 18px; white-space: nowrap; }
.track { position: relative; height: 16px; margin: 3px 4px 0; border-radius: 8px; background: #7a3f0a; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .45); direction: ltr; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 8px; background: linear-gradient(#a8ea72, #34a96a); transition: width .3s; }
.mark { position: absolute; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; }
.mark svg { width: 100%; height: 100%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); }
.mark.on svg { animation: pop2 .35s ease-out; }
.btns { display: flex; gap: 6px; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.iconbtn svg { width: 20px; height: 20px; filter: drop-shadow(0 1px 0 #96500a); }

#banner {
  position: absolute;
  top: 120px;
  left: 50%;
  z-index: 5;
  padding: 6px 28px;
  border: 3px solid #fff1d0;
  border-radius: 18px;
  background: linear-gradient(#ff7a5c, #d63a22);
  color: #fff;
  font-weight: 800;
  font-size: 32px;
  white-space: nowrap;
  text-shadow: 0 2px 0 #8f2213;
  box-shadow: 0 5px 0 #8f2213, 0 10px 20px rgba(0, 0, 0, .25);
  transform: translateX(-50%) scale(0);
  pointer-events: none;
}
#banner.show { animation: banner 2s ease-out forwards; }
@keyframes banner {
  0% { transform: translateX(-50%) scale(0); }
  12% { transform: translateX(-50%) scale(1.1); }
  20%, 80% { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 0; }
}

/* ---- the screens: the shops, a day's card, upgrades, paused, the end of a day ---- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(30, 18, 10, .6);
}
.screen.hidden { display: none; }
.card {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  padding: 12px 22px 14px;
  border: 5px solid #f0a53a;
  border-radius: 28px;
  background: linear-gradient(#fffaf0, #fbe7c4);
  box-shadow: 0 6px 0 #b8680f, 0 14px 30px rgba(0, 0, 0, .4);
  text-align: center;
  overflow: auto;
}
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: start; }
.card .bottom { display: flex; align-items: center; justify-content: center; gap: 20px; }
.card .col { min-width: 0; }
h1 { margin: 0; font-size: 36px; line-height: 1.05; color: var(--red); text-shadow: 0 2px 0 #fff; }
h2 { margin: 2px 0 6px; font-size: 28px; line-height: 1.15; color: var(--green-dark); }
.tagline { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.big {
  min-width: 220px;
  padding: 7px 20px;
  border: 2px solid #ffd5c8;
  border-radius: 16px;
  background: linear-gradient(#ff7a5c, #d63a22);
  color: #fff;
  font-weight: 800;
  font-size: 21px;
  text-shadow: 0 2px 0 #8f2213;
  box-shadow: 0 4px 0 #8f2213;
}
.big:active { transform: translateY(3px); box-shadow: 0 1px 0 #8f2213; }
.link { margin-top: 6px; border: 0; background: none; font-weight: 700; font-size: 16px; color: var(--green); text-decoration: underline; }
#privacy { font-size: 14px; font-weight: 600; color: var(--muted); }
.keys { display: none; margin: 6px 0 0; font-size: 12px; color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .keys { display: block; } }

/* the coins to spend */
.wallet {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 12px 2px 6px;
  border-radius: 999px;
  background: #f6e2b8;
  box-shadow: inset 0 2px 0 rgba(0, 0, 0, .06);
  font-weight: 800;
  white-space: nowrap;
}
.wallet svg { width: 26px; height: 26px; }
.wallet b { font-size: 20px; direction: ltr; }
.wallet span { font-size: 13px; font-weight: 700; color: var(--muted); }

/* the shops, four to a row (the last row centred), each with its days */
#shops .card { width: 860px; padding-top: 8px; padding-bottom: 10px; }
#shops h1 { font-size: 30px; }
#shops .tagline { margin: 0; }
#shopList { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 8px; }
.shop {
  width: calc((100% - 24px) / 4);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 8px 8px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .1);
}
.shop .head { display: flex; align-items: center; gap: 4px; height: 36px; }
.shop .art svg { width: 44px; height: 35px; }
.shop .title { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.shop.closed .art { filter: grayscale(1); opacity: .45; }
.shop h3 { max-width: 100%; margin: 0; font-size: 18px; line-height: 1.05; color: var(--tc); text-align: start; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.count { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; line-height: 15px; font-weight: 800; color: var(--muted); direction: ltr; }
.count svg { width: 13px; height: 13px; }
.ups {
  display: grid;
  place-items: center;
  width: 34px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--tc);
  color: #fff;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.ups svg { width: 20px; height: 20px; }
.days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.day {
  height: 33px;
  padding: 1px 0 0;
  border: 0;
  border-radius: 10px;
  background: var(--tc);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .25);
}
.day:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.day b { font-size: 15px; line-height: 1; }
.day[disabled] { background: #ebe4d6; box-shadow: none; cursor: default; }
.day[disabled] svg { width: 20px; height: 20px; }
/* the days after the one that opens the next shop: a darker shade, for the stars */
.day.late:not([disabled]) { background: color-mix(in srgb, var(--tc) 72%, #000); }
.mini { display: flex; justify-content: center; }
.mini svg { width: 10px; height: 10px; }
.shop .note { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 13px; line-height: 1.25; color: var(--muted); text-align: start; }
.note svg { flex: none; width: 24px; height: 24px; }
#play { min-width: 380px; }

/* a day's card: the dish and the day on the left; what's new and the coins for the stars on the right */
#dayCard .card { width: 720px; display: grid; grid-template-columns: 230px 1fr; gap: 18px; align-items: center; }
#dayCard .hero svg { width: 220px; height: 176px; margin: 0 auto; }
.news { margin: 0 0 10px; padding-inline-start: 22px; text-align: start; font-size: 16px; line-height: 1.4; }
.news li { margin-bottom: 4px; }
.goals { margin: 0 0 12px; }
.goals .label { font-size: 14px; font-weight: 700; color: var(--muted); }
.goalRow { display: flex; justify-content: center; gap: 22px; margin-top: 2px; }
.goal { display: flex; flex-direction: column; align-items: center; }
.goal .mini svg { width: 17px; height: 17px; }
.goal b { font-size: 21px; line-height: 1.2; direction: ltr; }

/* a shop's upgrades, two by two */
#upgrades .card { width: 820px; }
#upList { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0 12px; text-align: start; }
.up { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 rgba(0, 0, 0, .08); }
.up.have { background: #eef7f0; }
.up .ic svg { width: 48px; height: 48px; }
.up .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.up .txt b { font-size: 17px; line-height: 1.2; }
.up .txt small { font-size: 13px; line-height: 1.3; color: var(--muted); }
.buy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px 6px 8px;
  border: 2px solid #ffd5c8;
  border-radius: 12px;
  background: linear-gradient(#ff7a5c, #d63a22);
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 3px 0 #8f2213;
}
.buy:active { transform: translateY(2px); box-shadow: 0 1px 0 #8f2213; }
.buy svg { width: 20px; height: 20px; }
.buy b { direction: ltr; }
.buy[disabled] { border-color: transparent; background: #d6ccbb; box-shadow: none; cursor: default; }
.got { font-weight: 800; color: #2a8a52; white-space: nowrap; }
#upgrades h2 { margin: 0; color: var(--tc); }

/* paused, and the end of a day */
#paused .card { width: 360px; }
#end .card { width: 700px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 18px; align-items: center; }
.stars { display: flex; justify-content: center; gap: 6px; margin: 2px 0 6px; }
.stars svg { width: 60px; height: 60px; }
.stars svg.on { animation: pop2 .35s ease-out backwards; }
.stars svg:nth-child(2) { animation-delay: .25s; }
.stars svg:nth-child(3) { animation-delay: .5s; }
@keyframes pop2 { from { transform: scale(0); } to { transform: scale(1); } }
.best { min-height: 24px; font-weight: 800; font-size: 17px; color: var(--red); }
.stats { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; margin: 0 0 12px; font-size: 17px; text-align: start; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-weight: 800; direction: ltr; text-align: end; }
.links { display: flex; justify-content: center; gap: 18px; }

/* how much of the screen the notch and the home bar take (main.js reads it to fit the stage) */
#safe {
  position: fixed;
  inset: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  visibility: hidden;
  pointer-events: none;
}

/* phones held upright: ask for the phone on its side */
#rotate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 24px;
  background: radial-gradient(circle at 50% 40%, #4a3324, #1e140d);
  color: #fff;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
}
#rotate p { margin: 0; max-width: 320px; }
.phone { width: 64px; height: 112px; border: 6px solid #fff; border-radius: 14px; animation: turn 2.4s ease-in-out infinite; }
@keyframes turn { 0%, 20% { transform: rotate(0); } 50%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (orientation: portrait) { #rotate { display: flex; } }
