/* The game's eight window styles (cpp/src/ui.cpp, kWindowStyleNames + DrawUIBorder), as CSS.
   Rounded | Square | Thick | Double | Dashed | Brackets | Beveled | Ornate. Chosen with the Style picker in the top bar
   (data-style on <html>). They change every panel, button and framed box, the same set of outlines the game restyles. */
:root, :root[data-style="rounded"] { --r: 10px; --bw: 3px; --bs: solid; }
:root[data-style="square"]   { --r: 0; }
:root[data-style="thick"]    { --bw: 7px; }                       /* game: line width x2.5 */
:root[data-style="double"]   { --bw: 7px; --bs: double; }         /* game: the border plus a second, inset one */
:root[data-style="dashed"]   { --r: 0; --bs: dashed; }            /* game: sharp rect, dash/gap segments */
:root[data-style="brackets"] { --r: 0; }                          /* game: just the four corners, reticle style */
:root[data-style="beveled"]  { --r: 0; }                          /* game: light top/left, dark bottom/right */
:root[data-style="ornate"]   { --bw: 7px; --bs: double; }         /* game: Double plus a diamond at each corner */

/* every framed box in the site */
:root[data-style="brackets"] :is(.lead, .hint, a.badge, span.badge, .plots .dirt, .stage),
:root[data-style="ornate"]   :is(.lead, .hint, a.badge, span.badge, .plots .dirt, .stage) { position: relative; }

:root[data-style="beveled"] :is(.menupanel, .win, .frame, .lead, .hint, main.doc, a.badge, span.badge, .stage, .themepick, .frame) {
  border-style: solid;
  border-color: color-mix(in srgb, var(--panel-border), #fff 50%) color-mix(in srgb, var(--panel-border), #000 45%)
                color-mix(in srgb, var(--panel-border), #000 45%) color-mix(in srgb, var(--panel-border), #fff 50%);
}

/* Brackets: the border goes invisible and four L-shaped corner marks are drawn over it */
:root[data-style="brackets"] :is(.menupanel, .win, .frame, .lead, .hint, main.doc, a.badge, span.badge, .stage) { border-color: transparent; }
:root[data-style="brackets"] :is(.menupanel, .win, .frame, .lead, .hint, main.doc, a.badge, span.badge, .stage)::after {
  --c: var(--panel-border); --a: 16px; --t: 3px;
  content: ""; position: absolute; inset: calc(var(--bw) * -1); pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--a) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) top left / var(--t) var(--a) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--a) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) top right / var(--t) var(--a) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--a) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / var(--t) var(--a) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--a) var(--t) no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / var(--t) var(--a) no-repeat;
}

/* Ornate: Double plus a small diamond on each corner */
:root[data-style="ornate"] :is(.menupanel, .win, .frame, .lead, .hint, main.doc, a.badge, span.badge, .stage)::after {
  --dia: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M5 0L10 5L5 10L0 5Z'/%3E%3C/svg%3E");
  content: ""; position: absolute; inset: -6px; pointer-events: none; z-index: 2; background: var(--panel-border);
  -webkit-mask: var(--dia) top left / 14px 14px no-repeat, var(--dia) top right / 14px 14px no-repeat,
                var(--dia) bottom left / 14px 14px no-repeat, var(--dia) bottom right / 14px 14px no-repeat;
          mask: var(--dia) top left / 14px 14px no-repeat, var(--dia) top right / 14px 14px no-repeat,
                var(--dia) bottom left / 14px 14px no-repeat, var(--dia) bottom right / 14px 14px no-repeat;
}
