:root {
  --base-rotation: 0deg;
  --flip-rotation: 0deg;
  --mirror-scale: 1;
  --bg-stop-1: #54bef3;
  --bg-stop-2: #1b6dfa;
  --grid-color: rgba(255, 255, 255, 0.4);
  --nav-icon-color: #ffffff;
  --footer-text: rgba(255, 255, 255, 0.8);
  --menu-bg: #ffffff;
  --menu-text: #333333;
  --border-color: #e8e8e8;
  --accent-color: #007aff;
  color-scheme: light;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  touch-action: pan-x pan-y;
  text-decoration: none !important;
}

html, body {
  visibility: visible !important;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: sans-serif;
  background-color: var(--bg-stop-2);
}

#color-red:checked ~ #canvas { --bg-stop-1: #ff5f6d; --bg-stop-2: #ffc371; --accent-color: #ff3b30; }
#color-green:checked ~ #canvas { --bg-stop-1: #11998e; --bg-stop-2: #38ef7d; --accent-color: #34c759; }
#color-orange:checked ~ #canvas { --bg-stop-1: #ff9966; --bg-stop-2: #ff5e62; --accent-color: #ff9500; }
#color-purple:checked ~ #canvas { --bg-stop-1: #8e2de2; --bg-stop-2: #4a00e0; --accent-color: #af52de; }
#color-pink:checked ~ #canvas { --bg-stop-1: #f06292; --bg-stop-2: #f8bbd0; --accent-color: #ff2d55; }
#color-teal:checked ~ #canvas { --bg-stop-1: #4db6ac; --bg-stop-2: #00796b; --accent-color: #5ac8fa; }
#color-indigo:checked ~ #canvas { --bg-stop-1: #3f51b5; --bg-stop-2: #1a237e; --accent-color: #5856d6; }
#color-yellow:checked ~ #canvas { --bg-stop-1: #fdd835; --bg-stop-2: #fbc02d; --accent-color: #ffcc00; }
#color-gray:checked ~ #canvas { --bg-stop-1: #757575; --bg-stop-2: #212121; --accent-color: #8e8e93; }

#theme-dark:checked ~ #canvas {
  --menu-bg: #1c1c1e;
  --menu-text: #ffffff;
  --border-color: #38383a;
}

@media (prefers-color-scheme: dark) {
  #theme-system:checked ~ #canvas {
    --menu-bg: #1c1c1e;
    --menu-text: #ffffff;
    --border-color: #38383a;
  }
}

@media (orientation: portrait) {
  #ori-auto:checked ~ #canvas {
    width: 100vw;
    height: 100vh;
  }
  #ori-land:checked ~ #canvas {
    --base-rotation: 90deg;
    width: 100vh;
    height: 100vw;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(calc(var(--base-rotation) + var(--flip-rotation))) scaleX(var(--mirror-scale));
  }
  #ori-land:checked ~ #canvas #wrapper {
    width: 100vh;
    height: 100vw;
  }
}

@media (orientation: landscape) {
  #ori-auto:checked ~ #canvas {
    width: 100vw;
    height: 100vh;
  }
  #ori-port:checked ~ #canvas {
    --base-rotation: 90deg;
    width: 100vh;
    height: 100vw;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(calc(var(--base-rotation) + var(--flip-rotation))) scaleX(var(--mirror-scale));
  }
  #ori-port:checked ~ #canvas #wrapper {
    width: 100vh;
    height: 100vw;
  }
}

/*
.noscript-highlight {
  background-color: var(--accent-color);
  color: #fff;
}

.noscript-highlight .m-menu_description {
  color: rgba(255, 255, 255, 0.8);
}
*/

#ori-flip:checked ~ #canvas { --flip-rotation: 180deg; }
#ori-mirr:checked ~ #canvas { --mirror-scale: -1; }

#canvas {
  width: 100vw;
  height: 100vh;
  position: fixed;
  inset: 0;
  transform-origin: center center;
  transform: rotate(calc(var(--base-rotation) + var(--flip-rotation))) scaleX(var(--mirror-scale));
  display: block;
  transition: none !important;
}

.theme-radio,
.ori-radio,
.ori-check,
.color-radio,
.lang-radio,
.m-menu_checkbox {
  display: none !important;
}

.background {
  width: 100%;
  height: 100%;
  position: fixed;
  inset: 0;
  z-index: 1;
}

.grid-circles,
.edge-circles {
  transform: translate(50%, 50%);
}

.grid-circles circle,
.grid-lines circle {
  fill: none;
  stroke: var(--grid-color);
  stroke-dasharray: 4 4;
}

.edge-circles circle {
  fill: none;
  stroke-width: 2;
  stroke: var(--grid-color);
}

.center-lines {
  stroke: var(--grid-color);
  stroke-width: 2;
}

#menu:checked ~ #canvas .footer {
  filter: blur(4px);
}

#wrapper {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.5) transparent;
}

#wrapper::-webkit-scrollbar {
  width: 6px;
}

#wrapper::-webkit-scrollbar-track {
  background: transparent;
}

#wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.5);
  border-radius: 3px;
}

.content {
  padding: 80px 20px 20px;
}

.placeholder {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 40px 20px;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.9);
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
  padding: 20px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--footer-text);
}