/* ------------------------------------------------------------
   Brent Simulator - the look of the game screen
   Everything inside #bs-stage is laid out on a 960 x 540 screen that gets scaled to fit.
   ------------------------------------------------------------ */
#bs-wrap { max-width: 960px; margin: 0 auto; }
#bs-box { position: relative; width: 100%; aspect-ratio: 16 / 9; border: 3px solid #222; border-radius: 6px; overflow: hidden; background: #6fb85a;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
#bs-stage { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; overflow: hidden;
  font-family: "Comic Sans MS", "Comic Sans", "Comic Neue", cursive; font-weight: bold; color: #222; font-size: 15px; line-height: 1.25; }
#bs-stage canvas { position: absolute; left: 0; top: 0; width: 960px; height: 540px; }
#bs-stage * { box-sizing: border-box; }
#bs-stage button { font-family: inherit; font-weight: bold; cursor: pointer; color: #222; }
.bs-hide { display: none !important; }

/* buttons */
.bs-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 6px 12px; border: 1.5px solid #b38a00; border-radius: 8px;
  background: linear-gradient(#fff7c2, #ffe34d 45%, #f5c400 55%, #e0a800); box-shadow: inset 0 1px 0 rgba(255,255,255,.8), 0 2px 0 rgba(0,0,0,.25);
  font-size: 15px; white-space: nowrap; }
.bs-btn:active { transform: translateY(1px); box-shadow: inset 0 2px 3px rgba(0,0,0,.25); }
.bs-btn.big { font-size: 20px; padding: 9px 22px; }
.bs-btn.small { font-size: 13px; padding: 3px 8px; }
.bs-btn.green { background: linear-gradient(#d8ffd0, #6ee06a 50%, #2e9d3a); border-color: #1f6e28; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.bs-btn.blue { background: linear-gradient(#e8f4ff, #9fd0ff 55%, #5aa8f0); border-color: #1d4f99; }
.bs-btn.red { background: linear-gradient(#ffd6d0, #ff7a6a 50%, #d43a2a); border-color: #8e2a20; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4); }
.bs-btn.gray, .bs-btn:disabled { background: linear-gradient(#eee, #ccc 55%, #aaa); border-color: #888; color: #555; box-shadow: none; }
.bs-btn .badge, .bs-round .badge, .bs-badge { display: inline-block; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #e74c3c; color: #fff;
  font-size: 12px; line-height: 20px; text-align: center; border: 1.5px solid #fff; }

/* top bar */
#bs-hud { position: absolute; left: 0; top: 0; right: 0; height: 48px; background: #222; border-bottom: 3px solid #ffd23f; display: flex; align-items: center;
  gap: 10px; padding: 0 8px; color: #fff; font-size: 16px; z-index: 20; }
#bs-hud .face { width: 38px; height: 38px; border-radius: 6px; border: 2px solid #ffd23f; background: #fff center top / cover no-repeat; flex: none; cursor: pointer; }
#bs-hud .lvl { display: flex; flex-direction: column; gap: 2px; min-width: 92px; cursor: pointer; }
#bs-hud .lvl b { font-size: 14px; }
#bs-hud .xp { height: 8px; border-radius: 5px; background: #555; overflow: hidden; border: 1px solid #ffd23f; }
#bs-hud .xp i { display: block; height: 100%; background: #7dff9a; }
#bs-hud .coins { color: #7dff9a; font-size: 17px; }
#bs-hud .good { display: flex; align-items: center; gap: 2px; font-size: 14px; cursor: pointer; }
#bs-hud .good.full { color: #ff9f8a; }
#bs-hud .sp { flex: 1; }
#bs-hud .chip { font-size: 14px; display: flex; align-items: center; gap: 2px; cursor: pointer; }
#bs-net { font-size: 11px; color: #bbb; }

/* bottom bar */
#bs-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 62px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 8px;
  background: linear-gradient(rgba(34,34,34,0), rgba(34,34,34,.55) 35%); z-index: 20; pointer-events: none; }
#bs-bar .bs-btn { pointer-events: auto; position: relative; height: 46px; font-size: 15px; padding: 4px 11px; }
#bs-bar .bs-btn .badge { position: absolute; top: -8px; right: -6px; }
#bs-bar .raid { font-size: 19px; padding: 4px 16px; }
#bs-zoom { position: absolute; right: 8px; bottom: 70px; display: flex; flex-direction: column; gap: 6px; z-index: 15; }
#bs-zoom .bs-btn { width: 38px; height: 38px; padding: 0; font-size: 20px; }

/* panels (windows) */
.bs-panel { position: absolute; left: 110px; top: 58px; width: 740px; height: 412px; background: #fffdf2; border: 3px solid #222; border-radius: 12px;
  box-shadow: 0 6px 0 #f5c400, 0 10px 30px rgba(0,0,0,.35); z-index: 56; display: flex; flex-direction: column; overflow: hidden; }
.bs-panel.small { left: 230px; width: 500px; top: 90px; height: auto; max-height: 380px; }
.bs-panel.wide { left: 40px; width: 880px; height: 420px; top: 56px; }
.bs-panel h3 { margin: 0; padding: 8px 46px 8px 14px; background: #ffd23f; border-bottom: 3px solid #222; font-size: 20px; }
.bs-panel .x { position: absolute; right: 8px; top: 6px; width: 32px; height: 32px; padding: 0; font-size: 18px; border-radius: 50%; }
.bs-panel .body { flex: 1; overflow-y: auto; padding: 10px 14px; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.bs-panel .foot { padding: 8px 14px; border-top: 2px solid #eee3b0; display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.bs-panel .tabs { display: flex; gap: 6px; padding: 8px 14px 0; flex-wrap: wrap; }
.bs-panel .tabs .bs-btn.on { background: linear-gradient(#e0a800, #f5c400 50%, #ffe34d); box-shadow: inset 0 2px 3px rgba(0,0,0,.25); }
.bs-dim { position: absolute; inset: 0; background: rgba(0,0,0,.35); z-index: 55; }
.bs-note { font-size: 13px; color: #666; font-weight: normal; }
.bs-warn { color: #c0392b; }
.bs-good { color: #2e9d3a; }

/* lists of things (build list, units, orders...) */
.bs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.bs-card { position: relative; border: 2px solid #222; border-radius: 10px; background: #fff; padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.bs-card.off { background: #eee; color: #888; }
.bs-card.sel { outline: 3px solid #2e9d3a; }
.bs-card .t { font-size: 15px; }
.bs-card .n { position: absolute; right: 7px; top: 6px; font-size: 13px; }
.bs-card .d { font-size: 12px; font-weight: normal; color: #444; }
.bs-card img.pic { height: 64px; object-fit: contain; align-self: center; }
.bs-card canvas.pic { position: static !important; width: 90px !important; height: 64px !important; align-self: center; }
.bs-cost { display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 13px; }
.bs-cost .no { color: #c0392b; }
.bs-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 1.5px dashed #e6dba5; }
.bs-row .grow { flex: 1; }
.bs-bar { height: 12px; border: 2px solid #222; border-radius: 7px; background: #ddd; overflow: hidden; }
.bs-bar i { display: block; height: 100%; background: linear-gradient(#9cf0a0, #3cbf4a); }
.bs-bar.gold i { background: linear-gradient(#ffe680, #f5b400); }

/* toasts + floating words */
#bs-toast { position: absolute; left: 50%; top: 56px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 4px; align-items: center; pointer-events: none; }
#bs-toast div { background: rgba(0,0,0,.8); color: #fff; padding: 5px 14px; border-radius: 8px; font-size: 15px; }
#bs-toast div.good { color: #7dff9a; }
#bs-toast div.bad { color: #ffb3a8; }

/* placing a building */
#bs-place { position: absolute; left: 50%; top: 58px; transform: translateX(-50%); z-index: 30; display: flex; gap: 8px; align-items: center;
  background: rgba(0,0,0,.75); color: #fff; padding: 6px 10px; border-radius: 10px; }

/* the title screen */
#bs-title { position: absolute; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
#bs-title > * { pointer-events: auto; position: absolute; transition: transform .6s cubic-bezier(.55, 0, .8, .2), opacity .35s; }
#bs-title img { user-select: none; -webkit-user-select: none; }
#bs-title .t-brent { left: -4px; bottom: 0; height: 440px; }
#bs-title .t-boys { right: 0; bottom: 0; height: 360px; }
#bs-title h2 { border: 0; padding: 0; background: none; top: 12px; left: 0; right: 0; margin: 0; text-align: center; font-size: 78px; line-height: .92; letter-spacing: 1px; color: #ffd23f;
  -webkit-text-stroke: 3px #222; paint-order: stroke fill; text-shadow: 4px 5px 0 #222; transform: rotate(-3deg); pointer-events: none; }
#bs-title .t-mid { left: 330px; right: 330px; top: 196px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
#bs-title .t-mid .bs-btn.big { font-size: 30px; padding: 10px 34px; }
#bs-title .who { background: rgba(0,0,0,.65); color: #fff; padding: 4px 10px; border-radius: 8px; font-size: 13px; text-align: center; }
#bs-title.go .t-brent { transform: translateX(-110%); }
#bs-title.go .t-boys { transform: translateX(110%); }
#bs-title.go h2 { transform: translateY(-170%) rotate(-3deg); }
#bs-title.go .t-mid { opacity: 0; transform: translateY(60px); }

/* Brent's training screen */
.bs-stat { display: grid; grid-template-columns: 140px 1fr 70px; gap: 8px; align-items: center; margin: 4px 0; }
.bs-game { display: flex; gap: 8px; align-items: center; border: 2px solid #222; border-radius: 10px; padding: 6px 8px; background: #fff; }
.bs-game.off { background: #eee; color: #888; }
.bs-degrees { display: flex; gap: 6px; }
.bs-degrees div { flex: 1; text-align: center; font-size: 12px; padding: 4px; border: 2px solid #222; border-radius: 12px; background: #fff; }
.bs-degrees div.done { background: #2e9d3a; color: #fff; }
.bs-degrees div.now { background: #ffd23f; }
.bs-looks { display: flex; flex-wrap: wrap; gap: 6px; }
.bs-looks div { width: 74px; height: 92px; border: 2px solid #222; border-radius: 8px; background: #fff center bottom / contain no-repeat; position: relative; cursor: pointer; }
.bs-looks div.on { outline: 3px solid #2e9d3a; }
.bs-looks div.locked { background: #ddd; }
.bs-looks div.locked:after { content: "?"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; color: #888; }

/* raid screen */
#bs-raid { position: absolute; inset: 0; z-index: 45; }
#bs-rhud { position: absolute; left: 0; top: 0; right: 0; height: 44px; background: #222; border-bottom: 3px solid #ffd23f; color: #fff; display: flex; align-items: center; gap: 12px; padding: 0 10px; font-size: 16px; }
#bs-rhud .time { font-size: 22px; }
#bs-rbar { position: absolute; left: 0; right: 0; bottom: 0; height: 118px; background: #2d2d2d; border-top: 3px solid #ffd23f; }
#bs-meter { position: absolute; left: 10px; right: 10px; top: 6px; height: 20px; border: 2px solid #ffd23f; border-radius: 11px; background: #444; overflow: hidden; }
#bs-meter i { display: block; height: 100%; background: linear-gradient(#ffb15c, #e07b1f); }
#bs-meter span { position: absolute; left: 10px; top: 0; color: #fff; font-size: 13px; line-height: 16px; text-shadow: 0 1px 2px #000; }
#bs-units { position: absolute; left: 8px; top: 32px; right: 170px; display: flex; gap: 5px; }
.bs-ub { position: relative; width: 70px; height: 78px; border: 2px solid #b38a00; border-radius: 9px; background: linear-gradient(#fff, #ffe680 55%, #e0a800);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 2px 2px 3px; font-size: 11px; line-height: 1.1; text-align: center; overflow: hidden; }
.bs-ub img { height: 40px; max-width: 64px; object-fit: contain; }
.bs-ub .c { font-size: 12px; color: #7a5a00; }
.bs-ub.off { filter: grayscale(.9) brightness(.8); }
.bs-ub .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); }
.bs-ub .mys { width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 2px solid #111; display: flex; align-items: center; justify-content: center; font-size: 24px; }
#bs-formbtn { position: absolute; right: 8px; top: 32px; width: 154px; height: 78px; border: 2px solid #1d4f99; border-radius: 9px;
  background: linear-gradient(#e8f4ff, #9fd0ff 55%, #5aa8f0); display: flex; align-items: center; gap: 4px; padding: 3px 6px; font-size: 13px; text-align: left; }
#bs-formbtn img { height: 66px; width: 46px; object-fit: contain; }
#bs-formbtn .cd { position: absolute; left: 0; bottom: 0; height: 5px; background: #1d4f99; }
#bs-forms { position: absolute; right: 8px; bottom: 124px; display: flex; gap: 6px; z-index: 5; }
#bs-forms button { width: 110px; height: 128px; border: 2px solid #222; border-radius: 10px; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 4px; font-size: 13px; }
#bs-forms img { height: 92px; object-fit: contain; }
#bs-forms button.on { background: #d8ffd0; }
.bs-pick { display: flex; gap: 16px; justify-content: center; }
.bs-pick button { width: 220px; border: 3px solid #222; border-radius: 12px; background: #fff; padding: 8px 10px; text-align: center; box-shadow: 0 4px 0 #f5c400; }
.bs-pick button img { height: 150px; object-fit: contain; display: block; margin: 0 auto 4px; }
.bs-pick button b { font-size: 19px; display: block; }
.bs-pick button span { font-size: 13px; font-weight: normal; display: block; min-height: 52px; }
.bs-pick button.on { border-color: #2e9d3a; box-shadow: 0 4px 0 #2e9d3a; }
.bs-stars { font-size: 34px; letter-spacing: 6px; color: #f5c400; text-shadow: 0 2px 0 #222; }
.bs-stars .off { color: #ccc; }

/* minigames */
#bs-game { position: absolute; inset: 0; z-index: 48; background: #9fd6ff; }
#bs-ghud { position: absolute; left: 0; top: 0; right: 0; height: 42px; display: flex; align-items: center; gap: 12px; padding: 0 10px; color: #fff; font-size: 18px;
  background: rgba(0,0,0,.55); z-index: 3; }
#bs-gmsg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; background: rgba(255,255,255,.95); border: 3px solid #222; border-radius: 12px;
  padding: 14px 22px; text-align: center; min-width: 360px; max-width: 640px; box-shadow: 0 5px 0 #f5c400; }
#bs-gmsg h4 { margin: 0 0 6px; font-size: 24px; }
#bs-gmsg p { margin: 4px 0 10px; font-size: 15px; font-weight: normal; }

.bs-help p { margin: 4px 0 8px; font-weight: normal; }
.bs-help b { font-weight: bold; }

/* ---------- Clash-style controls (Oct 15) ---------- */
/* round buttons along the bottom: big Raid on the left, big Build on the right */
#bs-bar { justify-content: space-between; align-items: flex-end; height: 104px; padding: 0 10px 8px; background: none; }
#bs-bar .grp { display: flex; gap: 8px; align-items: flex-end; pointer-events: auto; }
.bs-round { position: relative; width: 64px; height: 64px; border-radius: 50%; border: 3px solid #222; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #fffbe0, #ffd23f 55%, #d9a400); box-shadow: 0 4px 0 rgba(0,0,0,.35); font-size: 26px; line-height: 1; padding: 0; }
.bs-round span { font-size: 11px; margin-top: 2px; }
.bs-round.big { width: 90px; height: 90px; font-size: 38px; }
.bs-round.big span { font-size: 14px; }
.bs-round.red { background: radial-gradient(circle at 35% 30%, #ffd6d0, #ff6a5a 55%, #c0392b); color: #fff; text-shadow: 0 1px 2px #000; }
.bs-round.blue { background: radial-gradient(circle at 35% 30%, #e8f4ff, #7fbff5 55%, #3a7bd5); }
.bs-round:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.bs-round .badge { position: absolute; top: -4px; right: -4px; }
#bs-zoom { bottom: 112px; }

/* what you can do with the thing you tapped */
#bs-acts { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 22; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
#bs-acts .name { color: #fff; font-size: 19px; text-shadow: 0 2px 0 #222, 0 0 6px #222; pointer-events: none; }
#bs-acts .row { display: flex; gap: 8px; pointer-events: auto; }
.bs-act { position: relative; width: 78px; height: 78px; border-radius: 14px; border: 3px solid #222; background: linear-gradient(#fff, #e9e3cf); box-shadow: 0 4px 0 rgba(0,0,0,.35);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 2px; font-size: 28px; line-height: 1; }
.bs-act span { font-size: 12px; }
.bs-act .cost { font-size: 11px; background: #222; color: #fff; border-radius: 6px; padding: 1px 4px; margin-top: 2px; white-space: nowrap; }
.bs-act .cost.no { color: #ff8a7a; }
.bs-act.green { background: linear-gradient(#d8ffd0, #6ee06a 60%, #2e9d3a); }
.bs-act.yellow { background: linear-gradient(#fff7c2, #ffe34d 50%, #e0a800); }
.bs-act.blue { background: linear-gradient(#e8f4ff, #9fd0ff 55%, #5aa8f0); }
.bs-act.gray { filter: grayscale(.8); opacity: .8; }
.bs-act.sure { outline: 4px solid #2e9d3a; }
.bs-act:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }

/* shop cards with a picture of the building */
.bs-shop { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.bs-shop .bs-card { align-items: center; text-align: center; padding: 6px 4px; }
.bs-shop .bs-card .n { position: static; font-size: 12px; }
.bs-shop canvas { position: static !important; width: 140px !important; height: 100px !important; }

/* the Bunkhouse room */
#bs-room { position: absolute; inset: 0; z-index: 44; background: #6b4a2b; }
#bs-room canvas { position: absolute; left: 0; top: 0; width: 960px; height: 540px; }
#bs-room .top { position: absolute; left: 0; right: 0; top: 0; height: 48px; background: #222; border-bottom: 3px solid #ffd23f; display: flex; align-items: center; gap: 10px; padding: 0 10px; color: #fff; font-size: 18px; }
#bs-room .slots { position: absolute; left: 10px; top: 56px; display: flex; flex-direction: column; gap: 6px; }
#bs-room .slotrow { display: flex; gap: 5px; align-items: center; background: rgba(0,0,0,.45); border-radius: 10px; padding: 4px 8px; color: #fff; font-size: 13px; }
#bs-room .slot { width: 40px; height: 40px; border-radius: 8px; border: 2px solid #ffd23f; background: #fff center / contain no-repeat; position: relative; }
#bs-room .slot.empty { background: rgba(255,255,255,.15); border-style: dashed; }

/* first-time tutorial: Brent's tip card + a pointing arrow */
#bs-tut { position: absolute; left: 254px; bottom: 6px; z-index: 58; width: 384px; min-height: 52px; box-sizing: border-box; display: flex; align-items: center; gap: 8px;
  background: #fffdf2; border: 3px solid #222; border-radius: 12px; padding: 5px 8px; box-shadow: 0 3px 0 rgba(0,0,0,.35); }
#bs-tut.high { bottom: 128px; }
#bs-tut .face { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #222; background: #ffd23f top center / 150% auto no-repeat; }
#bs-tut .say { flex: 1; font-size: 15px; line-height: 1.2; }
#bs-tut .skip { flex: none; align-self: flex-start; border: 0; background: none; color: #888; font: inherit; font-size: 12px; cursor: pointer; padding: 0 2px; text-decoration: underline; }
#bs-tut-arrow { position: absolute; z-index: 59; pointer-events: none; font-size: 44px; line-height: 1; color: #ffd23f; -webkit-text-stroke: 3px #222; paint-order: stroke fill;
  transform: translate(-50%, -100%); animation: bs-bob .8s ease-in-out infinite alternate; }
#bs-tut-arrow.up { transform: translate(-50%, 0); animation-name: bs-bob-up; }
@keyframes bs-bob { from { margin-top: -10px; } to { margin-top: 0; } }
@keyframes bs-bob-up { from { margin-top: 10px; } to { margin-top: 0; } }
.bs-card.tut-glow { outline: 4px solid #ffd23f; box-shadow: 0 0 0 7px #222; }

/* the training screen: 5 huge game buttons (3 on top, 2 below) */
#bs-train { position: absolute; inset: 0; z-index: 46; background: #2b2620; display: flex; flex-direction: column; padding: 8px; box-sizing: border-box; gap: 8px; }
#bs-train .top { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 18px; min-height: 34px; }
#bs-train .top .en { color: #ffd23f; }
#bs-train .grid { flex: 1; display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: 1fr 1fr; gap: 8px; }
#bs-train .game { grid-column: span 2; position: relative; border: 4px solid #222; border-radius: 16px; color: #fff; font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: inset 0 -8px 0 rgba(0,0,0,.25); text-shadow: 2px 2px 0 #222; }
#bs-train .game:nth-child(n+4) { grid-column: span 3; }
#bs-train .game:active { transform: translateY(2px); box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
#bs-train .game .ic { font-size: 64px; line-height: 1; text-shadow: none; }
#bs-train .game b { font-size: 30px; line-height: 1.05; text-align: center; }
#bs-train .game .st { font-size: 15px; background: rgba(0,0,0,.35); padding: 2px 10px; border-radius: 10px; text-shadow: none; }
#bs-train .game .info { position: absolute; top: 6px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.9); color: #222; text-shadow: none;
  font-size: 22px; line-height: 34px; text-align: center; border: 2px solid #222; }
#bs-train .no { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #ffd23f; padding: 4px 12px; border-radius: 8px; font-size: 14px; pointer-events: none; }
