/* Ideas Per Second */
:root {
  --bg: #101b24;
  --ink: #fdf6e3;
  --muted: #b9c2c9;
  --gold: #ffd75e;
  --green: #7dff6b;
  --red: #ff7a6b;
  --wood-d: #2b1708;
  --wood: #6b3f1d;
  --wood-l: #9a6233;
  --display: 'Bree Serif', Georgia, serif;
  --body: 'Nunito Sans', system-ui, sans-serif;
  --plank: 14px;
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='60'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012 .55' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .05 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='300' height='60' filter='url(%23g)'/%3E%3C/svg%3E");
  --grainv: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='300'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.55 .012' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .05 0 0 0 0 0 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='60' height='300' filter='url(%23g)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg) var(--noise); color: var(--ink); font: 15px/1.4 var(--body);
  overflow: hidden; -webkit-tap-highlight-color: transparent; overscroll-behavior: none;
}
button { font: inherit; color: inherit; }
img { -webkit-user-drag: none; user-select: none; }
.outline { text-shadow: 0 2px 0 #000, 0 0 6px rgba(0,0,0,.8); }

#game {
  position: relative; height: 100vh; height: 100dvh;
  display: grid; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(280px, 28vw) var(--plank) minmax(0, 1fr) var(--plank) clamp(340px, 31vw, 440px);
}

#left { grid-column: 1; grid-row: 1; } #p1 { grid-column: 2; grid-row: 1; } #mid { grid-column: 3; grid-row: 1; }
#p2 { grid-column: 4; grid-row: 1; } #store { grid-column: 5; grid-row: 1; }
/* wooden planks between the columns: the genre's frame */
.plank { position: relative; z-index: 30; }
.plank.v {
  background: var(--grainv), linear-gradient(90deg, #1c0e04, var(--wood) 22%, var(--wood-l) 46%, var(--wood) 72%, #1c0e04);
  box-shadow: 0 0 10px rgba(0,0,0,.7);
}

/* ------------------------------------------------------------- left: the pad */
#left {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center;
  background:
    radial-gradient(ellipse 70% 45% at 50% 58%, rgba(255,214,120,.16), transparent 70%),
    linear-gradient(180deg, #13222d, #0b141b 70%, #0a1016);
}
#rays {
  position: absolute; left: 50%; top: 58%; width: 140vmax; height: 140vmax; transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, rgba(255,226,140,.075) 0 9deg, rgba(255,226,140,0) 9deg 22.5deg);
  -webkit-mask: radial-gradient(circle, #000 0, rgba(0,0,0,.6) 18%, transparent 42%); mask: radial-gradient(circle, #000 0, rgba(0,0,0,.6) 18%, transparent 42%);
  animation: spin 70s linear infinite; pointer-events: none;
}
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
#banner {
  position: relative; z-index: 2; width: 100%; padding: 12px 10px 10px; text-align: center;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.25)); border-bottom: 1px solid rgba(255,255,255,.06);
  font: 25px/1.1 var(--display); letter-spacing: .01em; text-shadow: 0 2px 0 #000, 0 0 8px rgba(0,0,0,.7);
}
#counts { position: relative; z-index: 2; text-align: center; padding: 14px 10px 0; text-shadow: 0 2px 0 #000, 0 0 8px rgba(0,0,0,.9); }
#ideas { font: 30px/1.1 var(--display); }
#ideasN { font-weight: 400; }
#ips { margin-top: 4px; font: 15px/1.2 var(--display); color: #e8e1cf; }
#ips b { font-weight: 400; }
#padArea { position: relative; z-index: 2; flex: 1; width: 100%; display: grid; place-items: center; min-height: 0; padding: 4px 0 30px; }
#pad {
  all: unset; cursor: pointer; display: block; width: min(76%, 330px, 46vh); aspect-ratio: 667 / 626;
  transition: transform .09s ease-out; filter: drop-shadow(0 18px 18px rgba(0,0,0,.55)); touch-action: manipulation;
}
#pad img { width: 100%; height: 100%; display: block; filter: saturate(1.35) brightness(1.04) hue-rotate(-4deg); pointer-events: none; }
#pad:hover { transform: scale(1.03); }
#pad.squash { animation: squash .16s ease-out; }
@keyframes squash { 0% { transform: scale(1.03); } 35% { transform: scale(.955, .93); } 100% { transform: scale(1.03); } }
#pad:focus-visible { outline: 3px solid var(--gold); outline-offset: 6px; border-radius: 8px; }
#buffs { position: absolute; z-index: 3; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; pointer-events: none; }
.buff { width: 120px; padding: 4px 8px 6px; border-radius: 6px; background: rgba(0,0,0,.6); border: 1px solid rgba(255,215,94,.6); font: 13px var(--display); text-align: center; color: var(--gold); }
.buff i { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--gold); }
#floaters { position: absolute; inset: 0; z-index: 4; pointer-events: none; perspective: 700px; }
.plus { position: absolute; z-index: 3; font: 26px var(--display); color: #fff; white-space: nowrap; transform: translate(-50%, 0); pointer-events: none;
  text-shadow: 0 2px 0 #3d2300, 2px 0 0 #3d2300, -2px 0 0 #3d2300, 0 -2px 0 #3d2300, 0 3px 6px rgba(0,0,0,.6); }
.sheet {
  position: absolute; z-index: 1; left: 0; top: 0; width: 100px; height: 100px; transform-origin: 0 0; border-radius: 1px;
  background: linear-gradient(160deg, #fffd7a 0%, #fffa5c 45%, #f6e845 100%);
  box-shadow: 0 0 0 .6px rgba(170,130,0,.45), 6px 10px 14px rgba(60,40,0,.35);
}
.sheet::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 22%; background: linear-gradient(180deg, rgba(150,110,0,.18), transparent); }

/* ------------------------------------------------------------- middle: the rows */
#mid { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; background: #0d151c var(--noise); }
#topbar {
  position: relative; z-index: 40; display: flex; align-items: stretch; gap: 6px; padding: 7px 8px;
  background: var(--grain), linear-gradient(180deg, #7a4a24, #4e2c12); border-bottom: 3px solid #1d0e04; box-shadow: 0 4px 10px rgba(0,0,0,.5);
}
.mbtn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid rgba(0,0,0,.6); border-radius: 6px; cursor: pointer;
  background: linear-gradient(180deg, #3b2a1d, #23170d); color: #f6e7c8; font: 15px var(--display); text-shadow: 0 1px 0 #000;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.mbtn svg { width: 16px; height: 16px; fill: currentColor; opacity: .8; }
.mbtn:hover { background: linear-gradient(180deg, #4d3626, #2d1e12); color: #fff; }
.mbtn:focus-visible, .tile:focus-visible, .row:focus-visible, .up:focus-visible, #qty button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#ticker {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 0 10px; overflow: hidden;
  background: rgba(0,0,0,.45); border-radius: 6px; box-shadow: inset 0 2px 6px rgba(0,0,0,.6);
}
@media (min-width: 900px) {
  #topbar { flex-wrap: wrap; row-gap: 7px; }
  #ticker { order: 5; flex-basis: 100%; min-height: 46px; padding: 4px 14px; }
  .mbtn[data-menu="info"] { margin-left: auto; }
}
#tickerLine { font: 15px/1.2 var(--display); color: #f2ead8; text-align: center; text-shadow: 0 1px 0 #000; }
#tickerLine b { font-weight: 400; color: var(--gold); }
#tickerLine.in { animation: news .7s ease-out; }
@keyframes news { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#rows { position: relative; overflow-y: auto; overflow-x: hidden; padding: 64px 0 40px; scrollbar-width: thin; scrollbar-color: #4e2c12 transparent; }
.row {
  all: unset; box-sizing: border-box; position: relative; display: block; width: 100%; height: 112px; cursor: pointer;
  border-top: 9px solid transparent;
  border-image: linear-gradient(180deg, #a26a38, #5b3416 55%, #241005) 1;
}
.row:last-child { border-bottom: 9px solid transparent; }
.row-cv { position: absolute; left: 0; bottom: 0; width: 100%; pointer-events: none; }
.row .tag {
  position: absolute; left: 8px; top: 6px; z-index: 2; display: inline-flex; gap: 6px; align-items: baseline; padding: 3px 9px 4px;
  background: rgba(16,10,4,.78); border: 1px solid rgba(255,215,94,.35); border-radius: 5px; font: 14px var(--display); color: #fff3d6;
  opacity: 0; transform: translateY(-3px); transition: opacity .15s, transform .15s; pointer-events: none;
}
.row .tag b { font-weight: 400; }
.row .tag i { font-style: normal; color: var(--gold); }
.row:hover .tag, .row:focus-visible .tag { opacity: 1; transform: none; }
.row:hover { filter: brightness(1.08); }
.row.lot .row-cv { filter: saturate(.45) brightness(.5); }
.row.lot:hover .row-cv { filter: saturate(.7) brightness(.7); }
.tile.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: inset 0 0 0 3px var(--gold); } 100% { box-shadow: inset 0 0 0 0 transparent; } }
.row.new { animation: arrive 1.4s ease-out; }
@keyframes arrive { 0% { filter: brightness(2.2); } 100% { filter: none; } }
.row.boost { animation: boost .9s ease-out; }
@keyframes boost { 0%, 100% { filter: none; } 30% { filter: brightness(1.6) saturate(1.4); } }

/* ------------------------------------------------------------- right: the store */
#store { position: relative; display: flex; flex-direction: column; min-height: 0; background: #17120d var(--noise); }
#storeHead {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 12px;
  background: var(--grain), linear-gradient(180deg, #7a4a24, #4e2c12); border-bottom: 3px solid #1d0e04; box-shadow: 0 4px 10px rgba(0,0,0,.5); position: relative; z-index: 2;
}
#storeHead h2 { margin: 0; font: 26px/1 var(--display); font-weight: 400; text-shadow: 0 2px 0 #000; }
#qty { display: flex; align-items: center; gap: 3px; font: 14px var(--display); color: #f6e7c8; }
#qty span { margin-right: 4px; }
#qty button { min-width: 38px; padding: 4px 6px; border: 1px solid rgba(0,0,0,.6); border-radius: 5px; background: #2a1c11; cursor: pointer; font: 14px var(--display); }
#qty button[aria-pressed="true"] { background: linear-gradient(180deg, #ffe27a, #e0a92f); color: #2a1604; text-shadow: none; }
#upgrades {
  display: grid; grid-template-columns: repeat(auto-fill, 46px); gap: 6px; padding: 10px 12px; min-height: 66px;
  background: rgba(0,0,0,.35); border-bottom: 2px solid #000;
}
#upgrades.empty { min-height: 0; padding: 0; border: 0; }
.up {
  all: unset; position: relative; width: 46px; height: 46px; border-radius: 7px; cursor: pointer; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, #6c4a2a, #2b1a0c); box-shadow: inset 0 0 0 2px #8c5b2e, 0 2px 4px rgba(0,0,0,.6);
  filter: grayscale(.6) brightness(.6);
}
.up.t1 { background: radial-gradient(circle at 35% 30%, #8d97a3, #2f343b); box-shadow: inset 0 0 0 2px #c4ccd6, 0 2px 4px rgba(0,0,0,.6); }
.up.t2 { background: radial-gradient(circle at 35% 30%, #c9a43a, #4d3608); box-shadow: inset 0 0 0 2px #ffd75e, 0 2px 4px rgba(0,0,0,.6); }
.up.t3 { background: radial-gradient(circle at 35% 30%, #3fa18a, #0b3a31); box-shadow: inset 0 0 0 2px #7fe0c6, 0 2px 4px rgba(0,0,0,.6); }
.up.t4 { background: radial-gradient(circle at 35% 30%, #c24a5c, #4a0b16); box-shadow: inset 0 0 0 2px #ff9fb0, 0 2px 4px rgba(0,0,0,.6); }
.up.pad { background: radial-gradient(circle at 35% 30%, #fff1a6, #7d6413); box-shadow: inset 0 0 0 2px #fff3b0, 0 2px 4px rgba(0,0,0,.6); }
.up.c1 img { filter: hue-rotate(-55deg) saturate(1.3) drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.up.c2 img { filter: hue-rotate(140deg) drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.up.c3 img { filter: hue-rotate(60deg) drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.up.c4 img { filter: hue-rotate(-25deg) saturate(1.4) drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.up.c5 img { filter: hue-rotate(200deg) drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.up.c6 img { filter: hue-rotate(260deg) drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.up img { max-width: 80%; max-height: 80%; object-fit: contain; filter: drop-shadow(0 1px 1px rgba(0,0,0,.6)); }
.up.can { filter: none; }
.up.can:hover { transform: translateY(-1px); box-shadow: inset 0 0 0 2px #fff, 0 3px 8px rgba(0,0,0,.6); }

#tiles { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4e2c12 transparent; }
.tile {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 172px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 100%; min-height: 104px; padding: 8px 12px 8px 8px; cursor: pointer; position: relative;
  background: var(--grain), linear-gradient(180deg, #3a2a1c, #251a10); border-bottom: 2px solid #0e0904; box-shadow: inset 0 1px 0 rgba(255,255,255,.07);
}
.tile:hover { background: var(--grain), linear-gradient(180deg, #4a3624, #2e2014); }
.tile .thumb { position: relative; width: 172px; aspect-ratio: 16 / 9; border-radius: 4px; overflow: hidden; background: #000; box-shadow: 0 0 0 2px #120a03, 0 3px 6px rgba(0,0,0,.6); }
.tile .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .25s; }
.tile .thumb.tall img { object-position: 50% 22%; }
.tile .info { min-width: 0; display: grid; gap: 4px; }
.tile .name { font: 20px/1.12 var(--display); text-shadow: 0 2px 0 #000; overflow-wrap: anywhere; }
.tile .price { display: inline-flex; align-items: center; gap: 6px; font: 15px var(--display); color: var(--red); text-shadow: 0 1px 0 #000; }
.tile .ico { width: 15px; height: 15px; flex: none; border-radius: 1px; background: linear-gradient(135deg, #fff59a, #f4d73c); box-shadow: 1px 1px 0 #b8901d, 2px 2px 0 #7a5d0c; transform: rotate(-6deg); }
.tile .own { font: 44px/1 var(--display); color: rgba(255,255,255,.2); text-shadow: none; min-width: 1ch; text-align: right; }
.tile:not(.can) .thumb img { filter: saturate(.55) brightness(.72); }
.tile:not(.can) .name { color: #c7bba5; }
.tile.can .price { color: var(--green); }
.tile.can::before { content: ''; position: absolute; inset: 0; box-shadow: inset 4px 0 0 var(--gold); pointer-events: none; }
.tile.nope { animation: nope .3s; }
@keyframes nope { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tile.open, .tile.open:hover { background: var(--grain), linear-gradient(180deg, #4a3624, #2e2014); }
.tile.open .thumb { box-shadow: 0 0 0 2px var(--gold), 0 3px 6px rgba(0,0,0,.6); }
/* the tile's card: thumbnail, a real line, Buy, and the plain way in */
.tcard {
  padding: 12px 14px 14px; background: rgba(14,10,6,.97) var(--noise); border-bottom: 2px solid #000;
  box-shadow: inset 0 3px 8px rgba(0,0,0,.7), inset 4px 0 0 #6b4a24; animation: cardin .18s ease-out;
}
@keyframes cardin { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tc-img { display: block; width: 100%; height: auto; max-height: 46vh; object-fit: contain; border-radius: 4px; background: #000; box-shadow: 0 0 0 1px #000; }
.tc-img.tall { width: auto; max-width: 100%; max-height: min(300px, 40vh); margin: 0 auto; }
.tc-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-top: 10px; }
.tc-name { font: 21px/1.15 var(--display); font-weight: 400; }
.tc-client { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tc-q { display: block; margin: 8px 0 0; font: italic 15px/1.35 var(--body); color: #e9dcc2; }
.tc-stats { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: #c9cfd5; display: grid; gap: 2px; }
.tc-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; }
.tc-buy {
  display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; border: 1px solid rgba(0,0,0,.7); border-radius: 7px; cursor: pointer;
  background: linear-gradient(180deg, #3b2a1d, #23170d); color: #c7bba5; font: 18px var(--display); text-shadow: 0 1px 0 #000; box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  touch-action: manipulation;
}
.tc-buy .price { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--red); }
.tc-buy .ico { width: 14px; height: 14px; flex: none; border-radius: 1px; background: linear-gradient(135deg, #fff59a, #f4d73c); box-shadow: 1px 1px 0 #b8901d, 2px 2px 0 #7a5d0c; transform: rotate(-6deg); }
.tc-buy.can { background: linear-gradient(180deg, #ffe27a, #e0a92f); color: #2a1604; text-shadow: none; border-color: #5a3a06; box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 2px 6px rgba(0,0,0,.5); }
.tc-buy.can .price { color: #2a1604; }
.tc-buy.can:hover { filter: brightness(1.08); }
.tc-buy.can:active { transform: translateY(1px); }
.tc-buy.nope { animation: nope .3s; }
.tc-buy:focus-visible, .tc-see:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.tc-see { font: 17px var(--display); color: var(--gold); text-decoration: underline; text-underline-offset: 3px; padding: 8px 0; }
.tc-see:hover { color: #fff3c4; }

/* ------------------------------------------------------------- tooltips */
#tip {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; width: 400px; max-width: calc(100vw - 16px); padding: 12px;
  background: rgba(14,10,6,.96) var(--noise); border: 1px solid #6b4a24; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.7), inset 0 0 0 1px rgba(255,255,255,.04);
}
#tip.tip-up, #tip.tip-row { width: 300px; }
.tip-img { display: block; width: 100%; height: auto; border-radius: 4px; margin-bottom: 10px; box-shadow: 0 0 0 1px #000; }
.tip-img.tall { width: auto; max-width: 100%; max-height: 300px; margin: 0 auto 10px; }
.tip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.tip-name { font: 21px/1.15 var(--display); font-weight: 400; }
.tip-price { font: 15px var(--display); color: var(--gold); white-space: nowrap; }
.tip-client { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 2px; }
.tip-q { display: block; margin: 10px 0 0; font: italic 14px/1.35 var(--body); color: #e9dcc2; }
.tip-what { margin: 8px 0 0; font-size: 14px; }
.tip-stats { list-style: none; margin: 10px 0 0; padding: 8px 0 0; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: #d6dbe0; display: grid; gap: 3px; }

/* ------------------------------------------------------------- golden sheet */
#golden { position: fixed; z-index: 80; width: 74px; height: 74px; margin: -37px 0 0 -37px; animation: gin .8s ease-out, bob 3s ease-in-out infinite .8s; }
#golden.out { animation: gout 1.5s ease-in forwards; }
#golden button {
  all: unset; display: block; width: 100%; height: 100%; cursor: pointer; border-radius: 3px; transform: rotate(var(--r, 0deg));
  background: linear-gradient(135deg, #fff6c8 0%, #ffd84a 30%, #e7a816 62%, #fff0a0 80%, #c88a0c 100%);
  box-shadow: 0 0 22px 6px rgba(255,210,80,.6), 3px 4px 0 #b07a0a, 0 10px 18px rgba(0,0,0,.5);
}
#golden button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
@keyframes gin { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes gout { to { opacity: 0; transform: scale(.7); } }
@keyframes bob { 50% { transform: translateY(-6px) rotate(3deg); } }
.gnote { position: fixed; z-index: 85; transform: translate(-50%, -100%); text-align: center; pointer-events: none; text-shadow: 0 2px 0 #000, 0 0 8px #000; animation: rise 3.4s ease-out forwards; }
.gnote { max-width: min(420px, 90vw); }
.gnote b { display: block; font: 24px/1.15 var(--display); font-weight: 400; color: var(--gold); }
.gnote span { font: 16px var(--display); }
@keyframes rise { 0% { opacity: 0; margin-top: 10px; } 10% { opacity: 1; margin-top: 0; } 80% { opacity: 1; } 100% { opacity: 0; margin-top: -30px; } }
#notes { position: fixed; z-index: 85; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 24px)); pointer-events: none; }
.note { position: relative; pointer-events: auto; padding: 12px 40px 12px 16px; background: rgba(14,10,6,.95) var(--noise); border: 1px solid #6b4a24; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.6); animation: gin .4s ease-out; }
.note b { display: block; font: 19px var(--display); font-weight: 400; color: var(--gold); }
.note-x { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border: 0; background: none; cursor: pointer; font-size: 22px; color: #ccc; }

/* ------------------------------------------------------------- panel: case study and menus */
#panel {
  grid-column: 3 / 6; grid-row: 1; z-index: 60; position: relative; min-width: 0; min-height: 0;
  background: #0f1820 var(--noise); box-shadow: -8px 0 24px rgba(0,0,0,.6);
  animation: pin .28s ease-out;
}
#panel[hidden] { display: none; }
@keyframes pin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#panelScroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #4e2c12 transparent; }
#panelHead { position: relative; height: 210px; border-bottom: 9px solid transparent; border-image: linear-gradient(180deg, #a26a38, #5b3416 55%, #241005) 1; overflow: hidden; background: #0b1218; }
#panelWorld { position: absolute; inset: 0; width: 100%; height: 100%; }
#panel:not([data-kind="case"]) #panelHead { height: auto; padding-top: 18px; }
#panel:not([data-kind="case"]) #panelWorld { display: none; }
#panelSign {
  position: relative; display: inline-block; margin: 16px 0 0 18px; max-width: calc(100% - 90px); padding: 8px 16px 9px;
  background: var(--grain), linear-gradient(180deg, #7a4a24, #4e2c12); border: 2px solid #1d0e04; border-radius: 6px; box-shadow: 0 6px 14px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.15);
}
#panel:not([data-kind="case"]) #panelSign { margin-top: 0; }
#panelTitle { margin: 0; font: 30px/1.1 var(--display); font-weight: 400; text-shadow: 0 2px 0 #000; }
#panelClient { margin: 3px 0 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #f0dcb8; }
#panelClient:empty { display: none; }
#panelClose {
  position: absolute; right: 14px; top: 14px; z-index: 5; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 2px solid #1d0e04; background: linear-gradient(180deg, #8a5428, #4e2c12); color: #fff; font: 30px/40px var(--display); text-shadow: 0 2px 0 #000;
  box-shadow: 0 4px 10px rgba(0,0,0,.6);
}
#panelClose:hover { filter: brightness(1.2); }
#panelClose:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
#panelBody { padding: 18px 24px 60px; max-width: 980px; }
.cs-lede { margin: 0; font: 20px/1.35 var(--display); color: #fff7e6; }
.cs-game { margin: 6px 0 0; font-size: 13px; color: var(--gold); }
.cs-game:empty { display: none; }
.cs-work { margin-top: 22px; --ab-fg: #f3eee2; --ab-muted: #aeb6be; --ab-accent: #ffd75e; --ab-chrome: 140px; }
.cs-work .ab-heading { font: 21px/1.2 var(--display); font-weight: 400; color: #ffe7a8; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.cs-work .ab-text { color: #cfd5da; }
.cs-work .ab-frame, .cs-work .ab-image img { box-shadow: 0 0 0 2px #000, 0 6px 18px rgba(0,0,0,.6); }
.cs-work .ab-credits { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.cs-work .ab-audio { padding: 10px 12px; border-radius: 8px; background: rgba(0,0,0,.35); }
.cs-work .ab-audio figcaption { margin: 0 0 6px; font: 15px var(--display); color: #f3eee2; }
.opt, .links { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.obtn {
  display: inline-block; padding: 9px 16px; border: 1px solid rgba(0,0,0,.6); border-radius: 6px; cursor: pointer; text-decoration: none;
  background: linear-gradient(180deg, #3b2a1d, #23170d); color: #f6e7c8; font: 16px var(--display); box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.obtn:hover { filter: brightness(1.25); }
.obtn.warn { color: #ffb4a8; }
.small { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: max-content 1fr; gap: 8px 22px; margin: 0; font-size: 16px; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; font-family: var(--display); }
.about .bio { font: 19px/1.45 var(--display); max-width: 40em; margin: 0 0 8px; }
.about .links { gap: 6px 22px; margin-top: 14px; }
.about .links a { font: 18px var(--display); color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.about .links a:hover { color: #fff3c4; }

/* ------------------------------------------------------------- phones and narrow windows */
@media (max-width: 899px) {
  :root { --plank: 8px; }
  body { font-size: 14px; }
  #game { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto var(--plank) auto var(--plank) minmax(0, 1fr); }
  #left, #p1, #mid, #p2, #store { grid-column: 1; }
  #left { grid-row: 1; } #p1 { grid-row: 2; } #mid { grid-row: 3; } #p2 { grid-row: 4; } #store { grid-row: 5; }
  .plank.v { background: var(--grain), linear-gradient(180deg, #1c0e04, var(--wood) 22%, var(--wood-l) 46%, var(--wood) 72%, #1c0e04); }
  #left { display: grid; grid-template-columns: 46% 1fr; grid-template-rows: auto auto 1fr; align-items: center; min-height: 168px; height: 25svh; max-height: 230px; padding-top: env(safe-area-inset-top); }
  #rays { left: 23%; top: 52%; }
  #padArea { grid-column: 1; grid-row: 1 / 4; height: 100%; padding: 6px 0; }
  #pad { width: min(88%, 18svh, 190px); }
  #banner { grid-column: 2; grid-row: 1; background: none; border: 0; padding: 12px 6px 0; font-size: 19px; }
  #counts { grid-column: 2; grid-row: 2; padding: 6px 6px 0; }
  #ideas { font-size: 21px; overflow-wrap: anywhere; }
  #ips { font-size: 13px; }
  #buffs { left: 46%; bottom: 8px; }
  .buff { width: 96px; font-size: 12px; }
  #topbar { padding: 5px 6px; gap: 4px; }
  .mbtn { padding: 6px 8px; }
  .mbtn span { display: none; }
  .mbtn svg { width: 18px; height: 18px; }
  #tickerLine { font-size: 13px; }
  #rows { padding: 46px 0 14px; max-height: 31svh; }
  #rows:empty { padding: 0; }
  .row { height: 78px; border-top-width: 6px; }
  .row .tag { font-size: 12px; padding: 2px 7px; top: 4px; }
  #storeHead { padding: 5px 10px; }
  #storeHead h2 { font-size: 21px; }
  #upgrades { grid-template-columns: repeat(auto-fill, 40px); gap: 5px; padding: 7px 10px; min-height: 52px; }
  .up { width: 40px; height: 40px; }
  .tile { grid-template-columns: 128px minmax(0, 1fr) auto; min-height: 80px; gap: 10px; padding: 6px 10px 6px 6px; }
  .tile .thumb { width: 128px; }
  .tile .name { font-size: 17px; }
  .tile .price { font-size: 13px; }
  .tile .own { font-size: 32px; }
  /* phones: the store is short, so the card sits picture-left with Buy and the way in underneath */
  .tcard { display: grid; grid-template-columns: 40% minmax(0, 1fr); column-gap: 10px; align-items: start; padding: 10px 10px 12px; }
  .tc-img { grid-column: 1; grid-row: 1 / span 3; max-height: none; }
  .tc-img.tall { max-height: 150px; margin: 0; }
  .tc-head, .tc-q, .tc-stats { grid-column: 2; }
  .tc-head { margin-top: 0; }
  .tc-name { font-size: 18px; }
  .tc-client { font-size: 11px; }
  .tc-q { font-size: 14px; margin-top: 4px; }
  .tc-stats { font-size: 12px; margin-top: 4px; }
  .tc-act { grid-column: 1 / -1; margin-top: 10px; }
  #panel { position: fixed; inset: 0; z-index: 70; box-shadow: none; }
  #panelHead { height: 150px; }
  #panelSign { margin: 12px 0 0 12px; max-width: calc(100% - 76px); padding: 6px 12px 7px; }
  #panelTitle { font-size: 23px; }
  #panelClose { right: 10px; top: max(10px, env(safe-area-inset-top)); }
  #panelBody { padding: 14px 14px 60px; }
  .cs-lede { font-size: 17px; }
  .cs-work { --ab-chrome: 110px; }
}
@media (hover: none) {
  .row .tag { opacity: .92; transform: none; }
  .tile:hover { background: var(--grain), linear-gradient(180deg, #3a2a1c, #251a10); }
}
@media (prefers-reduced-motion: reduce) {
  #rays, #golden { animation: none; }
  #tickerLine.in, #panel, .row.new, .row.boost { animation: none; }
}
