:root {
  --grid-size: calc(min(100vw, 100vh) / 4);
  --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);
  --text-color: #ffffff;
  --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;
}

#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 {
    --base-rotation: 0deg;
    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 .nav .m-menu {
    width: calc(100vh - 30px);
    height: 100vw;
  }
}

@media (orientation: landscape) {
  #ori-auto:checked ~ #canvas {
    --base-rotation: 0deg;
    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 .nav .m-menu {
    width: calc(100vh - 30px) !important;
    height: 100vw;
  }
}

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

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

html, body, #wrapper { 
  width: 100%;
  height: 100%; 
  overflow: hidden; 
  font-family: sans-serif; 
  background-color: #000;
}

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

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

label { cursor: pointer; }

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

circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.5);
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

#c1 { r: var(--grid-size); }
#c2 { r: calc(var(--grid-size) * 2); }
#c3 { r: calc(var(--grid-size) * 3); }

#logo-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--grid-size) * 4);
  height: calc(var(--grid-size) * 4);
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
}

#logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

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