/* The site's look, in the style of the TMFRZ website: near-black background,
   one hot red accent, wide uppercase lettering, and panels with two corners
   cut off. Loaded last on every page, so it restyles what tools.css and each
   page's own styles set up.

   What this deliberately does NOT take from tmfrz.com: their logo, their
   stylesheet, or their typeface (it is a licensed font). The fonts here are
   free ones from Google Fonts chosen to give a similar feel. */
@import url("https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;900&family=Unbounded:wght@400;600;700&display=swap");

:root {
  color-scheme: dark;                       /* their site is dark only */
  --accent: #fc264c;
  --window: #0a090e;
  --sidebar: #0a090e;
  --canvas: #07060a;
  --text: #ffffff;
  --text2: rgba(255, 255, 255, .56);
  --text3: rgba(255, 255, 255, .32);
  --sep: rgba(255, 255, 255, .1);
  --group: rgba(255, 255, 255, .03);
  --control: rgba(255, 255, 255, .05);
  --control-hi: rgba(255, 255, 255, .14);
  --field: rgba(255, 255, 255, .04);
  --field-edge: rgba(255, 255, 255, .16);
  --row-hover: rgba(255, 255, 255, .06);
  --check-a: #17161c; --check-b: #100f14;
  --display: "Unbounded", "Orbitron", "Arial Black", sans-serif;   /* labels, buttons, headings */
  --num: "Orbitron", "Unbounded", sans-serif;                      /* figures */
  /* a panel with its top-right and bottom-left corners cut off */
  --cut-l: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  --cut-m: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 9px 100%, 0 calc(100% - 9px));
  --cut-s: polygon(0 0, calc(100% - 6px) 0, 100% 6px, 100% 100%, 6px 100%, 0 calc(100% - 6px));
}

/* ---------- page frame: bar across the top, legal line across the bottom ---------- */
body {
  grid-template-columns: 236px minmax(0, 1fr) 284px;
  grid-template-rows: auto minmax(0, 1fr) auto;
  /* a sparse grid of tiny dots, one every 160px, over the near-black */
  background: var(--window) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Crect width='1.5' height='1.5' fill='rgba(255,255,255,0.48)'/%3E%3C/svg%3E");
}
/* the panes sit on the page background, so the dots show through them */
#page, #sidebar, #inspector, #topbar, #toolbar, #legal { background: transparent; }
body.two { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; }
#topbar, #legal { grid-column: 1 / -1; }

#topbar { display: flex; align-items: center; gap: 28px; height: 76px; padding: 0 30px; }
.brand { font: italic 900 21px/1 var(--num); letter-spacing: .02em; text-transform: uppercase; color: #fff; text-decoration: none; white-space: nowrap; }
.brand span { color: var(--accent); }
.links {
  display: flex; align-items: center; height: 46px; padding: 0 8px;
  clip-path: var(--cut-m);
  background: rgba(255, 255, 255, .02);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
}
.links a {
  display: flex; align-items: center; height: 100%; padding: 0 13px;
  font: 600 11px/1 var(--display); text-transform: uppercase; white-space: nowrap;
  color: #fff; text-decoration: none; transition: color 120ms;
}
.links a:hover, .links a[aria-current="page"] { color: var(--accent); }

#legal {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 24px;
  padding: 9px 30px 11px; border-top: 1px solid var(--sep); font-size: 10.5px; color: var(--text3);
}
#legal .contact { color: var(--text2); }
/* the Discord name: looks like a link, copies the name when clicked */
.handle {
  padding: 0; border: 0; background: none; cursor: pointer;
  font: inherit; font-weight: 700; color: var(--accent);
}
.handle:hover { text-decoration: underline; }

/* ---------- lettering ---------- */
.heading { font: 600 10px/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--text2); }
#title b { font: 600 14px/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; }
#title small { margin-top: 3px; }
.row > span:first-child, .row > label > span:first-child { font: 600 10px/1.3 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--text2); }
.row .value, .numfield input, #link { font-family: var(--num); }

/* ---------- overlay list (the picker's left column) ---------- */
#sidebar { border-right: 1px solid var(--sep); padding: 16px 12px; }
#sidebar .heading { padding: 8px 8px 7px; }
.item, .disclosure { border-radius: 0; font: 600 10.5px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.disclosure { color: #fff; }
.item { color: var(--text2); }
.item:hover, .disclosure:hover { background: var(--row-hover); color: #fff; }
.item[aria-current="true"] { background: var(--accent); color: #fff; clip-path: var(--cut-s); }

/* "want a custom overlay?" note: under the overlay list, and in the settings panel */
.request {
  margin: 14px 4px 4px; padding: 11px 12px;
  border-left: 2px solid var(--accent); background: var(--control);
  font-size: 12px; line-height: 1.5; color: var(--text2);
  user-select: text; cursor: auto;
}
.request b { display: block; margin-bottom: 3px; font: 600 10px/1.3 var(--display); letter-spacing: .06em; text-transform: uppercase; color: #fff; }
.request.in-panel { margin: 0 0 10px; border-left: 0; padding: 12px 14px; }

/* ---------- toolbar ---------- */
/* the controls drop to a second line when the window is too narrow, instead of spilling out of the column */
#toolbar { height: auto; min-height: 60px; padding: 8px 18px; flex-wrap: wrap; row-gap: 8px; }
#title { flex: 1 1 150px; }
.tool { border-radius: 0; clip-path: var(--cut-s); background: var(--control); color: #fff; }
.tool:hover { background: var(--control-hi); }

/* segmented controls become a row of cut-corner tabs; the chosen one is red */
.seg { background: none; border-radius: 0; padding: 0; gap: 4px; flex-wrap: wrap; }   /* tabs wrap rather than overflow */
.seg .thumb { display: none; }
.seg button {
  height: 30px; padding: 0 13px; border-radius: 0;
  clip-path: var(--cut-s);
  background: var(--control);
  font: 700 10px/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  color: #fff; transition: background-color 120ms;
}
.seg button:hover { background: var(--control-hi); }
.seg button[aria-pressed="true"] { background: var(--accent); }
/* in the narrow settings column the tabs share the width, and wrap if a label won't fit */
#inspector .seg { flex-wrap: wrap; }
#inspector .seg button { flex: 1 1 auto; padding: 0 9px; font-size: 9px; letter-spacing: .02em; }

.btn {
  /* centre the label whether the button is a <button> or a link styled as one */
  display: inline-flex; align-items: center; justify-content: center;
  height: 30px; padding: 0 14px; border-radius: 0;
  clip-path: var(--cut-s);
  background: var(--control-hi); box-shadow: none;
  font: 700 10px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: #fff;
}
.btn[hidden] { display: none; }           /* setting display above would otherwise un-hide it */
.btn:active { background: rgba(255, 255, 255, .22); }
.btn.primary { height: 34px; padding: 0 18px; background: var(--accent); box-shadow: none; }
.btn.primary.done { background: #1fbf6b; }

/* ---------- panels and controls ---------- */
.group { border-radius: 0; clip-path: var(--cut-l); background: var(--group); box-shadow: inset 0 0 0 1px var(--sep); }
.textfield { border-radius: 0; clip-path: var(--cut-s); background: var(--field); box-shadow: inset 0 0 0 1px var(--field-edge); }
.textfield:focus-within { box-shadow: inset 0 0 0 1px var(--accent); }
input[type="color"] { border-radius: 0; box-shadow: inset 0 0 0 1px var(--field-edge); }
input[type="color"]::-webkit-color-swatch { border-radius: 0; }
#link { border-radius: 0; background: var(--field); box-shadow: inset 0 0 0 1px var(--field-edge); }

.switch i { border-radius: 0; clip-path: var(--cut-s); background: var(--control-hi); box-shadow: none; }
.switch i::after { border-radius: 0; clip-path: polygon(0 0, calc(100% - 4px) 0, 100% 4px, 100% 100%, 4px 100%, 0 calc(100% - 4px)); box-shadow: none; }
.switch input:checked + i { background: var(--accent); }

/* ---------- preview stage and grid ---------- */
#stage { border-radius: 0; box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 16px 44px rgba(0, 0, 0, .5); }
#dots { border-radius: 0; background: rgba(10, 9, 14, .7); clip-path: var(--cut-s); padding: 7px 11px; }
#dots button { border-radius: 0; width: 8px; height: 8px; }
#dots button[aria-current="true"] { background: var(--accent); }
.tile canvas, .tile iframe { border-radius: 0; }
#grid .heading, .mrow .fam, .tile span { border-radius: 0; font: 600 9px/1.3 var(--display); letter-spacing: .08em; text-transform: uppercase; background: rgba(10, 9, 14, .82); padding: 3px 7px; }
.tile[aria-current="true"] canvas, .tile[aria-current="true"] iframe { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- home ---------- */
.hero h1 { font: 700 40px/1.05 var(--display); letter-spacing: -.01em; text-transform: uppercase; }
.hero p { font-size: 15px; }
.start .textfield, .start .btn.primary { height: 40px; border-radius: 0; }
.start .btn.primary { font-size: 11px; padding: 0 22px; }
.card { border-radius: 0; clip-path: var(--cut-l); background: var(--group); box-shadow: inset 0 0 0 1px var(--sep); }
.card:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px var(--accent); }
.card h2 { font: 600 13px/1.2 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.card .go { font: 700 10px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; }
.mock .big, .mock td { font-family: var(--num); }
.mock td.k { font: 600 9px/1 var(--display); letter-spacing: .08em; }

/* ---------- sensitivity + compare ---------- */
.result .big { font-family: var(--num); letter-spacing: 0; }
.result .big small { font: 600 10px/1 var(--display); letter-spacing: .1em; text-transform: uppercase; margin-left: 8px; }
table td { font-family: var(--num); }
th, td.label { font: 600 9px/1.3 var(--display) !important; letter-spacing: .1em; text-transform: uppercase; color: var(--text2); }
#games-body td:first-child { font: 600 10px/1.3 var(--display); letter-spacing: .04em; text-transform: uppercase; }
.pick .vs { font: 700 11px/1 var(--display); color: var(--accent); }
.head b { font: 600 14px/1.2 var(--display); letter-spacing: .03em; text-transform: uppercase; }
.tally b { font: 600 10px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }

/* ---------- narrow windows and phones ---------- */
@media (max-width: 860px) {
  body, body.two { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; grid-auto-rows: auto; }
  #topbar { height: auto; flex-wrap: wrap; gap: 10px 18px; padding: 14px 16px; }
  .links { height: 40px; padding: 0 4px; max-width: 100%; overflow-x: auto; }
  .links a { padding: 0 9px; font-size: 10px; }
  #sidebar { display: none; }               /* the Grid view, arrows and dots pick an overlay here */
  #content { min-height: 420px; }
  #legal { padding: 9px 16px 11px; }
}
