/* Cocoa — the game's UI with drawn pieces: cocoa-brown frames with a cream stitch, cream panels, sky-blue ribbon titles,
   glossy jelly buttons, embossed slots, round badge menu icons. Art: img/*.svg drawn in code (tools/draw-cocoa.mjs),
   menu icons img/ico/*.png drawn by meta.ai and cut out (tools/cut-icons.py, sheets in design/cocoa-icons/).
   Loaded after the build's stylesheet (serve-decoded.mjs, brand.json "theme" / SEAL_THEME): it only overrides.
   1. colour tokens  2. windows  3. buttons, tabs, slots, bars  4. HUD  5. touch controls  6. tooltips */

/* ---------------------------------------------------------------- 1. colour tokens */
:root, #hud, .win, .dialog, .popup, #ctx-menu, #social-invites {
  --co-panel: #fffaf1; --co-panel-2: #f6ead6; --co-rim: #a97f56; --co-rim-l: #e6cba4; --co-ink: #3a2a1c;
  --co-sky: #38b4ea; --co-sky-d: #1b78a8; --co-sky-ink: #0d3b55; --co-or: #f5841c; --co-or-d: #a8520a;
  --co-text: #3b2d20; --co-text-2: #6a5440; --co-glass: #3a2a1cc4; --co-glass-edge: #e6cba466;
  /* the build's primary scale (sky) becomes cocoa: window heads, borders, small buttons, slots follow */
  --sky-50: #fffaf1 !important; --sky-100: #f6ead6 !important; --sky-200: #eadbc3 !important; --sky-300: #d6bd98 !important; --sky-400: #c2a27b !important;
  --sky-500: #a97f56 !important; --sky-600: #8a6646 !important; --sky-700: #5e432d !important; --sky-800: #3a2a1c !important;
  --c-sky-50: #fffaf1 !important; --c-sky-100: #f6ead6 !important; --c-sky-200: #eadbc3 !important; --c-sky-300: #d6bd98 !important; --c-sky-400: #c2a27b !important;
  --c-sky-500: #a97f56 !important; --c-sky-600: #8a6646 !important; --c-sky-700: #5e432d !important; --c-sky-800: #3a2a1c !important;
  --ink: #3b2d20 !important; --ink-2: #6a5440 !important; --ink-3: #8a735c !important; --ink-soft: #6a5440 !important;
  --surface: #fffaf1 !important; --surface-solid: #fffaf1 !important; --card: #fffdf8 !important;
  --sunken: #5e432d12 !important; --line: #5e432d26 !important; --line-strong: #5e432d45 !important;
  --glass: #3a2a1cc4 !important; --glass-2: #2e2116e0 !important; --glass-line: #e6cba44d !important; --scrim: #2a1d126b !important;
  --ring: 0 0 0 3px #38b4ea59 !important;
}

/* ---------------------------------------------------------------- 2. windows */
/* the frame is a 9-slice (corners kept, edges tiled so the stitch stays even) drawn 14 px outside the window's own box,
   so the build's layout keeps its room (the build's border is 3 px; a 22 px one squeezed the bag grid);
   the panel: cream with a faint dot pattern */
.win, .dialog, .popup {
  border-style: solid !important; border-color: transparent !important; border-width: 3px !important;
  border-image: url(img/frame.svg) 30 / 22px / 14px round !important;
  background: radial-gradient(circle, #e6cba44d 2px, transparent 2.6px) 0 0 / 22px 22px padding-box, var(--co-panel) padding-box !important;
  border-radius: 4px !important; box-shadow: 0 14px 30px #2a1d1240 !important;
}
.win::before, .dialog::before { background: none !important; }
.win-head { background: none !important; color: var(--co-text) !important; min-height: 40px !important; }
.win-head > svg { color: var(--co-or) !important; filter: drop-shadow(0 1px 0 #fff); }
/* the title on a sky-blue ribbon */
.win-title {
  border-style: solid !important; border-color: transparent !important; border-width: 0 17px !important;
  border-image: url(img/title.svg) 0 30 fill / 0 17px stretch !important;
  background: none !important; box-shadow: none !important; padding: 3px 1px 5px !important; border-radius: 0 !important;
  color: #fff !important; font-weight: 700; font-size: 17px !important; letter-spacing: .3px; line-height: 1.25;
  -webkit-text-stroke: 4px var(--co-sky-ink); paint-order: stroke fill;
}
.win-close {
  background: url(img/close.svg) center / contain no-repeat !important; box-shadow: none !important; border: 0 !important;
  width: 32px !important; height: 32px !important; border-radius: 50% !important;
}
.win-close:hover { background-image: url(img/close_hover.svg) !important; }
.win-close svg { opacity: 0 !important; }
.win-body { color: var(--co-text); }
.win-foot { border-top: 2px dashed var(--line-strong); }

/* ---------------------------------------------------------------- 3. buttons, tabs, slots, bars */
/* buttons: jelly pills, the ends kept and the middle stretched */
.btn {
  border-style: solid !important; border-color: transparent !important; border-width: 0 14px !important;
  border-image: url(img/btn_cream.svg) 0 16 fill / 0 14px stretch !important;
  background: none !important; box-shadow: none !important; border-radius: 0 !important;
  color: var(--co-text) !important; font-weight: 700; text-shadow: 0 1px 0 #fff !important;
}
.btn.primary { border-image-source: url(img/btn_blue.svg) !important; color: #fff !important; text-shadow: 0 1px 0 #165f98, 1px 0 0 #165f98, -1px 0 0 #165f98, 0 -1px 0 #165f98 !important; }
.btn.gold, .btn.danger { border-image-source: url(img/btn_orange.svg) !important; color: #fff !important; text-shadow: 0 1px 0 #a8520a, 1px 0 0 #a8520a, -1px 0 0 #a8520a, 0 -1px 0 #a8520a !important; }
.btn.ghost { border-image: none !important; border-color: transparent !important; color: var(--co-text-2) !important; text-shadow: none !important; }
/* the 14 px ends take the place of the build's padding (2 px border + 16 px), so buttons keep their width */
.btn { padding: 0 4px !important; }
.btn.sm { padding: 0 !important; }
/* square icon buttons: too narrow for the ends — the pill is drawn as a background instead */
.btn.icon { padding: 0 !important; border-width: 2px !important; border-image: none !important; background: url(img/btn_cream.svg) center / 100% 100% no-repeat !important; }
.btn.icon.primary { background-image: url(img/btn_blue.svg) !important; }
.btn.icon:is(.gold, .danger) { background-image: url(img/btn_orange.svg) !important; }
.btn:hover { filter: brightness(1.06) saturate(1.05); }
.btn:active { transform: translateY(1px); filter: brightness(.96); }
.btn:disabled, .btn.disabled { filter: grayscale(.6) opacity(.7); }

.tab {
  border-style: solid !important; border-color: transparent !important; border-width: 0 12px !important;
  border-image: url(img/tab.svg) 0 14 fill / 0 12px stretch !important; background: none !important; box-shadow: none !important;
  border-radius: 0 !important; color: var(--co-text-2) !important; font-weight: 700;
}
.tab.active, .tab.on {
  border-image-source: url(img/tab_on.svg) !important; color: #fff !important;
  -webkit-text-stroke: 3px var(--co-sky-d); paint-order: stroke fill;
}

.slot {
  background: url(img/slot.svg) center / 100% 100% no-repeat !important; box-shadow: none !important;
  border-color: transparent !important; border-radius: 10px !important;
}
.slot:hover { filter: brightness(1.05); box-shadow: 0 0 0 2px #38b4ea99 !important; }

/* bars: a dark capsule with a thin cream rim; the build's own fills inside */
.bar {
  border: 2px solid var(--co-ink) !important; border-image: none !important; border-radius: 99px !important;
  background: #2a1d12 !important; box-shadow: inset 0 2px 3px #0009, 0 0 0 1.5px #e6cba4aa !important; overflow: hidden !important;
}
.bar i { border-radius: 99px; box-shadow: inset 0 2px 0 #ffffff66; }

.scroll::-webkit-scrollbar, .win-body::-webkit-scrollbar { width: 10px; }
.scroll::-webkit-scrollbar-thumb, .win-body::-webkit-scrollbar-thumb { background: linear-gradient(90deg, #c2a27b, #a97f56); border-radius: 99px; border: 2px solid var(--co-panel-2); }
.scroll::-webkit-scrollbar-track, .win-body::-webkit-scrollbar-track { background: var(--co-panel-2); border-radius: 99px; }


/* ---------------------------------------------------------------- 4. HUD */
body:not(.hud-kub) #hud-self {
  border-style: solid !important; border-color: transparent !important; border-width: 4px !important;
  border-image: url(img/frame.svg) 30 / 16px / 10px round !important;
  background: #fffaf1e8 padding-box !important; border-radius: 4px !important; box-shadow: 0 8px 18px #2a1d1238 !important;
}
body:not(.hud-kub) #self-ring { background: url(img/ring.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; padding: 6px; }
#self-lvd { color: #fff !important; -webkit-text-stroke: 3px var(--co-sky-ink); paint-order: stroke fill; }
#hud-self .bar span { color: #fff; -webkit-text-stroke: 2.5px #2a1d12; paint-order: stroke fill; font-weight: 700; }

/* the minimap: the window frame without a panel, the map showing through */
#mm-frame { position: relative; border-radius: 12px !important; box-shadow: none !important; }
#mm-frame::after {
  content: ""; position: absolute; inset: -11px; pointer-events: none; z-index: 3;
  border: 22px solid transparent; border-image: url(img/frame_open.svg) 30 / 22px round;
}
/* (the build puts a small tilted mascot in this ::after: its size, turn and picture are reset here) */
body #hud #mm-frame::after { content: "" !important; display: block !important; inset: -11px !important; width: auto !important; height: auto !important; transform: none !important; filter: none !important; border: 22px solid transparent !important; border-image: url(img/frame_open.svg) 30 / 22px round !important; background: none !important; box-shadow: none !important; }
#map-name { color: #fff !important; -webkit-text-stroke: 3px var(--co-ink); paint-order: stroke fill; background: none !important; font-weight: 700; z-index: 4 !important; } /* on the frame's lower edge */

/* menu buttons: theme.js gives each known button its picture (data-ico, --ico) — the picture alone, no round badge
   behind it (a soft shadow keeps it readable on the map); a button without a picture keeps the cream badge for its line icon */
.mbtn-ico { background: url(img/badge.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 50% !important; color: #6a4a2c !important; }
.mbtn-ico svg { color: #6a4a2c !important; }
.mbtn[data-ico] .mbtn-ico { background: var(--ico) center / contain no-repeat !important; border-radius: 0 !important; width: 40px !important; height: 40px !important; filter: drop-shadow(0 1px 1.5px rgba(40, 24, 10, .55)); }
.mbtn[data-ico] .mbtn-ico svg { display: none !important; }
.mbtn:hover .mbtn-ico { filter: brightness(1.06); transform: translateY(-1px); }
.mbtn[data-ico]:hover .mbtn-ico { filter: drop-shadow(0 1px 1.5px rgba(40, 24, 10, .55)) brightness(1.08); }
/* "all menus" (a line icon, no picture): cream lines with a dark edge instead of the badge */
#hud-menu #btn-more .mbtn-ico { background: none !important; border-radius: 0 !important; width: 40px !important; height: 40px !important; }
#hud-menu #btn-more .mbtn-ico svg { width: 30px !important; height: 30px !important; color: #fff4dc !important; stroke-width: 2.6; filter: drop-shadow(0 0 1px #3b2414) drop-shadow(0 0 1px #3b2414) drop-shadow(0 1px 1px rgba(40, 24, 10, .6)); }
/* the labels: a small cocoa name tag under the picture, plain cream letters (a 3px stroke on 10px Thai letters had
   filled their loops in); tall enough for Thai marks above and below */
.mbtn small {
  display: block !important; box-sizing: border-box; max-width: calc(100% + 2px) !important; height: auto !important; margin-top: 1px !important;
  flex-shrink: 0 !important; /* (the button is 50px tall: the tag hangs a little below it, into the gap between rows) */
  padding: 1px 3px 0 !important; border-radius: 7px; background: rgba(52, 36, 22, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 226, 180, .16), 0 1px 2px rgba(20, 12, 4, .35);
  color: #fff4e0 !important; -webkit-text-stroke: 0 !important; text-shadow: none !important;
  font-weight: 400 !important; font-size: 10px !important; line-height: 14px !important; letter-spacing: -.2px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.mbtn:hover small { background: rgba(70, 48, 28, .85); }

#hud-chat { background: var(--co-glass) !important; border: 2px solid var(--co-glass-edge) !important; border-radius: 14px !important; }
body:not(.touch) #hud #hud-chat { background: var(--co-glass) !important; box-shadow: none !important; }
body.touch #hud:is(.chat-expanded, .chatting) #hud-chat { background: #2e2116e6 !important; }
.ct-tab.on { background: linear-gradient(180deg, #9be6ff, #38b4ea) !important; color: #fff !important; -webkit-text-stroke: 2.5px var(--co-sky-d); paint-order: stroke fill; }

.hot { background: url(img/hot.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 10px !important; }
.hot-key { color: #fff !important; -webkit-text-stroke: 2.5px var(--co-ink); paint-order: stroke fill; }

#quest-tracker { background: var(--co-glass) !important; box-shadow: inset 0 0 0 2px var(--co-glass-edge) !important; border-radius: 14px !important; }
.qt-title, .qt-name { color: #fff !important; }

/* the build's classic Seal status bar (hud-kub): left entirely to the build (frame, portrait, bars) */
body.hud-kub #hud-self .bar { border: 0 !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; overflow: visible !important; }
body.hud-kub #hud-self .bar i { box-shadow: none; }

/* ---------------------------------------------------------------- 5. touch controls (phones / tablets) */
body.touch #joy-base { background: url(img/joy_base.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 50% !important; }
body.touch #joy-knob { background: url(img/joy_knob.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 50% !important; }
body.touch #btn-attack { background: url(img/orb_orange.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 50% !important; color: #fff !important; }
body.touch #btn-attack svg { filter: drop-shadow(0 2px 0 #a8520a); }
body.touch .mskill { background: url(img/round_blue.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 50% !important; }
body.touch .mskill .icon { border-radius: 50%; transform: scale(.78); }
.hud-ibtn:not(#btn-auto):not(.ch-pill) { background: url(img/round_cream.svg) center / 100% 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 50% !important; color: #5e432d !important; }
.hud-ibtn:not(#btn-auto) svg { filter: none; }
/* the buttons by the minimap (and PK on touch screens): our own pictures (img/hud/*.svg) instead of the build's line
   icons, no round badge behind them */
#hud :is(#btn-questview, #btn-worldmap, #btn-minimap, #btn-pk, #btn-pklist) {
  background: center / 92% no-repeat !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  filter: drop-shadow(0 1px 1.5px rgba(40, 24, 10, .55)); transition: transform .12s, filter .12s;
}
#hud :is(#btn-questview, #btn-worldmap, #btn-minimap, #btn-pk, #btn-pklist) > svg { display: none !important; }
#hud #btn-questview { background-image: url(img/hud/quest.svg) !important; }
#hud #btn-worldmap { background-image: url(img/hud/worldmap.svg) !important; }
#hud #btn-minimap { background-image: url(img/hud/eye.svg) !important; }
#hud #btn-pk { background-image: url(img/hud/pk.svg) !important; }
#hud #btn-pklist { background-image: url(img/hud/target.svg) !important; }
#hud :is(#btn-questview, #btn-worldmap, #btn-minimap, #btn-pk, #btn-pklist):hover { transform: translateY(-1px); filter: drop-shadow(0 1px 1.5px rgba(40, 24, 10, .55)) brightness(1.08); }
/* PK on: the swords glow red; where PK can't be used (.zone): faded */
#hud :is(#btn-pk, #btn-pklist).on { filter: drop-shadow(0 0 3px #ff3b2f) drop-shadow(0 0 2px #ff3b2f) drop-shadow(0 1px 1px rgba(40, 24, 10, .6)); }
#hud #btn-pk.zone, #hud #btn-pk[aria-disabled="true"] { filter: grayscale(.85) opacity(.6) drop-shadow(0 1px 1.5px rgba(40, 24, 10, .4)); }
/* the auto-hunt row under the minimap: Gaius' blessing (potion), auto combo, start / stop — pictures, no badge; the
   "ออโต้" pill keeps its look, its round blue icon becomes the robot */
#hud :is(#btn-gaius, #btn-auto-combo, #btn-auto-go) {
  background: center / 92% no-repeat !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
  filter: drop-shadow(0 1px 1.5px rgba(40, 24, 10, .55)); transition: transform .12s, filter .12s;
}
#hud :is(#btn-gaius, #btn-auto-combo, #btn-auto-go) > svg { display: none !important; }
#hud #btn-gaius { background-image: url(img/hud/gaius.svg) !important; }
#hud #btn-auto-combo { background-image: url(img/hud/combo.svg) !important; }
#hud #btn-auto-go { background-image: url(img/hud/play.svg) !important; }
#hud #btn-auto-go.on { background-image: url(img/hud/stop.svg) !important; } /* running: the button stops it */
#hud :is(#btn-gaius, #btn-auto-combo, #btn-auto-go):hover { transform: translateY(-1px); }
#hud #btn-auto-combo:not(.on) { filter: saturate(.4) brightness(.97) drop-shadow(0 1px 1.5px rgba(40, 24, 10, .5)); } /* OFF */
#hud #btn-auto-combo.on { filter: drop-shadow(0 0 3px #ffc93c) drop-shadow(0 0 2px #ffb21e) drop-shadow(0 1px 1px rgba(40, 24, 10, .6)); }
#hud :is(#btn-auto-combo, #btn-auto-go):disabled { filter: grayscale(1) opacity(.55); }
#hud #btn-auto .auto-ico { background: url(img/hud/bot.svg) center / 100% no-repeat !important; box-shadow: none !important; border: 0 !important; border-radius: 0 !important; filter: drop-shadow(0 1px 1px rgba(40, 24, 10, .35)); }
#hud #btn-auto .auto-ico > svg { display: none !important; }
/* the channel pill's "switch" button: the two-arrow picture */
#hud #ch-pill .ch-sw { background: url(img/hud/swap.svg) center / 100% no-repeat !important; box-shadow: none !important; border: 0 !important; }
#hud #ch-pill .ch-sw > svg { display: none !important; }

/* ---------------------------------------------------------------- 6. tooltips (item / skill): dark cocoa glass, cream edge */
.skin-tip { background: linear-gradient(160deg, #4a3826f7, #2c1f14f7) !important; border-color: #f3e3c8 !important; box-shadow: 0 0 0 2px #a97f56cc, 0 8px 18px #1e140c66 !important; color: #fbf3e4 !important; border-radius: 12px !important; }
.skin-tip.docked .item-tip .it-head { background: #3a2a1c !important; box-shadow: 0 6px 6px -4px #1e140ce6 !important; }
.skin-tip .tip-more { color: #ffb15c !important; }
.tip-x { color: var(--co-or-d) !important; background: radial-gradient(circle at 35% 30%, #fff 55%, #f6ead6) !important; }
.item-tip .it-opts { background: #f3e3c81a !important; box-shadow: inset 0 0 0 1px #f3e3c838 !important; }

/* ---------------------------------------------------------------- 7. character select + creation (phase 61) */
/* both panels in the window frame, their titles on the ribbon; creation's steps as cocoa badges on a stitched line */
:is(#create-form .cc-panel, #chars-select .cs-panel) {
  border-style: solid !important; border-color: transparent !important; border-width: 3px !important;
  border-image: url(img/frame.svg) 30 / 22px / 14px round !important;
  background: radial-gradient(circle, #e6cba44d 2px, transparent 2.6px) 0 0 / 22px 22px padding-box, var(--co-panel) padding-box !important;
  border-radius: 4px !important; box-shadow: 0 14px 30px #2a1d1240 !important; margin: 14px 14px 14px 4px; color: var(--co-text);
}
:is(#create-form .cc-head, #chars-select .cs-head) { position: relative; justify-content: center; min-height: 40px; }
:is(#create-form .cc-head, #chars-select .cs-head) h2 {
  flex: none; border-style: solid; border-color: transparent; border-width: 0 17px; border-image: url(img/title.svg) 0 30 fill / 0 17px stretch;
  padding: 3px 10px 5px; color: #fff; font-weight: 700; font-size: 18px; letter-spacing: .3px; line-height: 1.25;
  -webkit-text-stroke: 4px var(--co-sky-ink); paint-order: stroke fill;
}
:is(#create-form .cc-head, #chars-select .cs-head) h2::before { display: none; }
#create-form .cc-cancel { position: absolute; left: 0; top: 50%; transform: translateY(-50%); margin: 0; }
#chars-select .cs-head .chip { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
/* the character cards: cream with a cocoa rim, the one picked glows sky blue, the empty ones dashed */
#chars-select .cs-card { background: #fffdf8 !important; border: 2px solid var(--co-rim-l) !important; border-radius: 14px !important; box-shadow: 0 2px 0 var(--co-rim-l) !important; }
#chars-select .cs-card:hover { border-color: var(--co-sky) !important; }
#chars-select .cs-card.selected { border-color: var(--co-sky) !important; background: linear-gradient(90deg, #eef8ff, #fffdf8) !important; box-shadow: 0 0 0 3px #38b4ea55, 0 2px 0 var(--co-sky-d) !important; }
#chars-select .cs-card.vacant { background: #fffaf180 !important; border-style: dashed !important; box-shadow: none !important; }
#chars-select .cs-plus { background: var(--co-panel-2) !important; color: var(--co-rim) !important; border-color: var(--co-rim-l) !important; }
#create-form .cc-steps li button { color: var(--co-text-2); }
#create-form .cc-stepno {
  width: 34px; height: 34px; background: url(img/round_cream.svg) center / 100% 100% no-repeat !important; box-shadow: none !important;
  color: var(--co-text-2) !important; font-weight: 800; font-size: 15px; transition: transform .2s;
}
#create-form .cc-steps li.active .cc-stepno { background-image: url(img/round_blue.svg) !important; color: #fff !important; -webkit-text-stroke: 3px #165f98; paint-order: stroke fill; transform: scale(1.12); }
#create-form .cc-steps li.done .cc-stepno { color: #2f8a3c !important; font-size: 0; }
#create-form .cc-steps li.done .cc-stepno::after { content: "✓"; font-size: 17px; font-weight: 900; }
#create-form .cc-steps li.active button { color: var(--co-sky-d) !important; }
#create-form .cc-steps li + li::before { top: 18px; height: 3px; background: repeating-linear-gradient(90deg, var(--co-rim-l) 0 6px, transparent 6px 10px) !important; }
#create-form .cc-steps li.done + li::before, #create-form .cc-steps li.done::before, #create-form .cc-steps li.active::before { background: repeating-linear-gradient(90deg, var(--co-sky) 0 6px, transparent 6px 10px) !important; }
/* boy / girl with their signs */
#create-form .cc-gender .seg-btn::before { content: "♂"; margin-right: 6px; font-weight: 900; font-size: 1.15em; color: #2f98e0; }
#create-form .cc-gender .seg-btn:nth-child(2)::before { content: "♀"; color: #f0679a; }
/* the job cards: two a row (the frame takes a few px: auto-fill fell to one), cream with a cocoa rim; the one picked glows sky blue */
#create-form .cc-jobs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#create-form .cc-job { background: #fffdf8 !important; border: 2px solid var(--co-rim-l) !important; border-radius: 14px !important; box-shadow: 0 2px 0 var(--co-rim-l) !important; }
#create-form .cc-job:hover { border-color: var(--co-sky) !important; }
#create-form .cc-job.selected { border-color: var(--co-sky) !important; background: #eef8ff !important; box-shadow: 0 0 0 3px #38b4ea55, 0 2px 0 var(--co-sky-d) !important; }
#create-form .cc-job.selected .cc-job-main b { color: var(--co-sky-d); }
#create-form .cc-jobdetail, #create-form .cc-sumcard { background: #fffdf8; border: 2px solid var(--co-rim-l); border-radius: 14px; padding: 10px 12px; box-shadow: 0 2px 0 var(--co-rim-l); }
#create-form .cc-jobdetail { margin-top: 10px; }
#create-form .sdcc-sec { border: 2px solid var(--co-rim-l); box-shadow: 0 2px 0 var(--co-rim-l); background: #fffdf8; }
/* short screens (a phone on its side): a thinner frame, a smaller ribbon and step badges, so the steps keep their room */
@media (max-height: 520px) {
  :is(#create-form .cc-panel, #chars-select .cs-panel) { border-image: url(img/frame.svg) 30 / 16px / 8px round !important; margin: 8px 8px 8px 2px; padding: 8px 10px !important; }
  :is(#create-form .cc-head, #chars-select .cs-head) { min-height: 30px; margin-bottom: 4px; }
  :is(#create-form .cc-head, #chars-select .cs-head) h2 { font-size: 15px; padding: 1px 8px 3px; }
  #create-form .cc-steps { margin-bottom: 4px; }
  #create-form .cc-steps li button { min-height: 32px; gap: 4px; }
  #create-form .cc-stepno { width: 26px; height: 26px; font-size: 13px; }
  #create-form .cc-steps li.active .cc-stepno { transform: none; }
  #create-form .cc-nav { margin-top: 6px; }
  #create-form .cc-nav .btn { min-height: 36px; }
  #create-form .cc-step > .cc-label { display: none; }
  #create-form .cc-gender { margin-bottom: 6px; }
  #create-form .cc-gender .seg-btn { min-height: 34px; }
}

/* ---------------------------------------------------------------- 8. Rascal Marble (phase 62) */
/* the board in the original's manner, drawn here (img/marble/*.svg are ours): a cocoa frame with a cream rim and two
   knobs, stone tiles, a peach middle with a faded prize pile, a MARBLE wordmark with a bunny, a yellow PUSH pill, the
   die with red 1 and 4, a red ribbon over the result. The photo banner gives way to the wordmark. */
#win-marble .ev-art { display: none !important; }
#win-marble .mg-board-wrap { position: relative; padding-top: 50px; }
/* the wordmark: a brown outline layer under a gradient fill layer */
#win-marble .mg-board-wrap::before, #win-marble .mg-board-wrap::after {
  content: "MARBLE"; position: absolute; left: 74px; top: 6px; z-index: 3; pointer-events: none;
  font: 900 34px/1.15 "Arial Black", "Segoe UI Black", "Arial Rounded MT Bold", system-ui, sans-serif; letter-spacing: 1.5px;
}
#win-marble .mg-board-wrap::before { color: #6b3d1c; -webkit-text-stroke: 8px #6b3d1c; filter: drop-shadow(0 3px 2px #2a1d1270); }
#win-marble .mg-board-wrap::after {
  background: linear-gradient(#fff3a0 8%, #ffc43c 45%, #f5851c 80%, #e4621a); -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-stroke: 0;
}
#win-marble .mg-board {
  position: relative; margin: 10px; padding: 9px !important; gap: 4px !important;
  background: #f4e6cb !important; border: 0 !important; border-radius: 26px !important;
  box-shadow: inset 0 0 0 3px #fff7e2, inset 0 0 0 5px #e3c9a2, 0 0 0 7px #a8754a, 0 0 0 9px #5e3d22, 0 9px 14px #2a1d1252 !important;
}
/* the bunny over the board's corner, the two knobs on the frame's top right */
#win-marble .mg-board::before {
  content: ""; position: absolute; left: -14px; top: -62px; width: 82px; height: 82px; z-index: 4; pointer-events: none;
  background: url(img/marble/bunny.svg) center / contain no-repeat; filter: drop-shadow(0 3px 2px #2a1d1259); transform: rotate(-8deg);
}
#win-marble .mg-board::after {
  content: ""; position: absolute; right: 18px; top: -27px; width: 46px; height: 26px; pointer-events: none;
  background: radial-gradient(circle at 30% 30%, #d9a47a, #a8754a 60%, #5e3d22 63%, transparent 66%) 0 6px / 20px 20px no-repeat,
    radial-gradient(circle at 30% 30%, #d9a47a, #a8754a 60%, #5e3d22 63%, transparent 66%) 22px 0 / 24px 24px no-repeat;
}
/* the stone tiles; the corners (start, the three balloon tiles) gold */
#win-marble .mg-tile {
  background: linear-gradient(#ece3d5, #cfbfa9) !important; border: 1.5px solid #927659 !important; border-radius: 10px !important;
  box-shadow: inset 0 2px 0 #ffffffb3, inset 0 -3px 0 #00000026, 0 1px 0 #5e3d2233 !important;
}
#win-marble .mg-tile.corner { background: linear-gradient(#fff0b8, #f3c75f) !important; border-color: #b9822b !important; }
#win-marble .mg-tile.here { background: linear-gradient(#fff6db, #f7dc94) !important; }
#win-marble .mg-tile:hover { border-color: #e0601d !important; }
#win-marble .mg-tile.sel { border-color: #e0601d !important; box-shadow: inset 0 2px 0 #ffffffb3, 0 0 0 3px #ff9b4f !important; }
#win-marble .mg-tile-n { color: #6b543e; font-weight: 800; }
#win-marble .mg-tile-star { background: #ff8a1f; }
#win-marble .mg-go { background: linear-gradient(#ff7a5c, #e2433b); box-shadow: 0 1px 0 #8f2a1c; }
/* the peach middle with the faded prize pile */
#win-marble .mg-center {
  border: 2px solid #fff6df !important; border-radius: 14px !important;
  background: url(img/marble/gifts.svg) center 70% / min(82%, 320px) auto no-repeat, linear-gradient(135deg, #f8cda4, #f8e4c3 50%, #f5ccb8) !important;
  box-shadow: inset 0 0 0 1px #d9a77a, inset 0 8px 16px #ffffff6b !important;
}
/* the counts: brown capsules */
#win-marble .mg-stats .chip { background: #7a573d !important; color: #fff !important; border: 2px solid #fff3d9 !important; box-shadow: 0 2px 0 #5e3d2266 !important; font-weight: 700; }
/* PUSH: a yellow jelly pill, red letters with a white edge */
#win-marble .mg-push.btn {
  border-image: none !important; border: 3px solid #f2a02a !important; border-radius: 999px !important; min-height: 50px; padding: 0 20px !important;
  background: linear-gradient(#fff6b0, #ffdc4e 45%, #ffbb2c) !important;
  box-shadow: inset 0 3px 0 #fffbe2, inset 0 -4px 0 #e8961a, 0 3px 0 #b36d18, 0 7px 12px #2a1d1240 !important;
  color: #e2412b !important; text-shadow: none !important; -webkit-text-stroke: 4px #fff; paint-order: stroke fill; font-weight: 900; font-size: 19px !important;
}
#win-marble .mg-push.btn .ico { color: #e2412b; stroke: #e2412b; }
#win-marble .mg-push.btn:disabled { filter: grayscale(.45) brightness(.97); }
/* the die: ivory, black pips, red 1 and 4 */
#win-marble .mg-die { background: linear-gradient(150deg, #fff, #f2e8da) !important; border: 2px solid #c8b196 !important; box-shadow: inset 0 -3px 0 #e6d6c0, 0 4px 0 #b49a7c, 0 7px 10px #2a1d1240 !important; }
#win-marble .mg-die i.on { background: #2e2521 !important; }
#win-marble .mg-die:is([data-face="1"], [data-face="4"]) i.on { background: #e23b3b !important; }
/* the result under a red ribbon */
#win-marble .mg-result-t {
  position: relative; z-index: 0; align-self: center; margin: 2px 16px 4px; padding: 3px 16px 5px; border-radius: 3px;
  background: linear-gradient(#ff8b6c, #e4523a); color: #fff !important; font-weight: 800; -webkit-text-stroke: 3px #a8321f; paint-order: stroke fill;
  box-shadow: inset 0 2px 0 #ffffff59, 0 2px 0 #8f2a1c;
}
#win-marble .mg-result-t::before, #win-marble .mg-result-t::after {
  content: ""; position: absolute; z-index: -1; top: 5px; width: 18px; height: 100%; background: #c4412b;
}
#win-marble .mg-result-t::before { left: -12px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 38% 50%); }
#win-marble .mg-result-t::after { right: -12px; clip-path: polygon(0 0, 100% 0, 62% 50%, 100% 100%, 0 100%); }
#win-marble .mg-got { background: #fffaf0 !important; border: 1.5px solid #e3c9a2 !important; }
/* touch screens: the board scrolls sideways — a thinner frame, the wordmark smaller */
body.touch #win-marble .mg-board { padding: 6px !important; gap: 2px !important; margin: 9px 9px 9px 9px; }
body.touch #win-marble .mg-board-wrap { padding-top: 44px; }
body.touch #win-marble .mg-board-wrap::before, body.touch #win-marble .mg-board-wrap::after { font-size: 28px; left: 64px; }
body.touch #win-marble .mg-board::before { width: 68px; height: 68px; top: -52px; }
