@layer common, base, components, utilities;
@layer common {
  * {
    margin: 0;
    padding: 0;
  }
  @font-face {
    font-family: "04b";
    src: url("../font/04b.ttf");
  }
  @font-face {
    font-family: "04bf";
    src: url("../font/04bf.woff");
  }
  @font-face {
    font-family: "mother";
    src: url("../font/mother.ttf");
  }
  @font-face {
    font-family: "3x3";
    src: url("../font/3x3.ttf");
  }
  body, html, :where(body), :where(html) {
    -webkit-tap-highlight-color: var(--profile-black) !important;
    -webkit-user-drag: none !important;
    -webkit-touch-callout: none !important;
    -webkit-overflow-scrolling: touch !important;
    -webkit-user-select: none !important;
    -webkit-font-smoothing: antialiased !important;
    cursor: default !important;
    user-select: none !important;
    text-rendering: optimizeLegibility !important;
    background-color: var(--profile-black) !important;
    transition: opacity 0.3s ease-in-out;
  }
  /*Common-open*/
  :root {
    --profile-base: oklch(75% 0.05 80);
    --profile-black: oklch(4% 0 0);
    --profile-orange: oklch(63% 0.19 32);
    --profile-cyan: oklch(66% 0.11 200);
    --profile-green: oklch(33% 0.05 160);
    --profile-d: oklch(from var(--profile-green) l c h / 0.40);
    --profile-o: color-mix(in oklch, var(--profile-base) 24%, var(--profile-black));
    --profile-1: oklch(from var(--profile-base) l c h / 0.60);
    --profile-2: oklch(from var(--profile-base) l c h / 0.40);
    --profile-3: oklch(from var(--profile-base) l c h / 0.30);
    --profile-4: oklch(from var(--profile-base) l c h / 0.20);
    --profile-5: oklch(from var(--profile-base) l c h / 0.04);
  }
  body::after, page00::after, screen::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    mix-blend-mode: overlay;
    transform-origin: top left;
    transform: translateZ(0);
    backface-visibility: hidden;
    background-size: 1px;
    will-change: transform;
  }
  body {
    z-index: 1;
    font-size: 8px;
    color: var(--profile-base);
    font-family: "3x3";
    text-align: center;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }
  body::after, page00::after {
    background-image: var(--background);
  }
}
@layer base {
  page00,
  page01, list, list01, list02, file, cta, label, setting,
  page02, display, gamepad, notification, joypad, invis, sec-12, sec-34 {
    display: grid;
    width: 100%;
    box-sizing: border-box;
  }
  page00, page01, page02 {
    position: absolute;
    height: 100%;
  }
  rom, file, logo, setting, vertical, label, opti, btn-state, btn-l, btn-r, btn-menu, sec-dpad, btn-1, btn-3, btn-2, btn-4, btn-select, btn-start {
    background-color: var(--profile-5) !important;
    outline: 1px solid var(--profile-o);
  }
  [hidden] {
    display: none !important
  }
  body.hide {
    opacity: 0 !important
  }
  [hide] {
    opacity: 0 !important
  }
  [op4] {
    opacity: 0.4 !important
  }
  [op8] {
    opacity: 0.8 !important
  }
  [fil] {
    filter: brightness(1) contrast(1.2) saturate(0.8) sepia(0.2) grayscale(0)
  }
  [jus], opti {
    justify-content: center
  }
}
@layer page-0 {
  page00 {
    z-index: 3;
    grid-template-rows: 1fr auto auto auto 1fr;
    height: calc(100vh - 30px);
    background: var(--profile-black);
    place-items: center;
  }
  title0, logo {
    white-space: pre;
    color: var(--profile-base);
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  title0 {
    font-size: 12px;
    padding: 1px 0px 10px 0px;
    padding-left: 3px;
  }
  logo {
    font-size: 16px;
    padding-left: 4px;
  }
  [green]::before {
    content: attr(green);
    color: var(--profile-green);
    text-shadow: -3px 0px 0px var(--profile-d);
  }
  logo[green]::before {
    text-shadow: -4px 0px 0px var(--profile-d);
  }
  [gray]::after {
    content: attr(gray);
    color: var(--profile-3);
  }
  message0, switch0 {
    color: var(--profile-3);
    padding-left: 2px;
    white-space: pre;
  }
  switch0 {
    padding: 8px 8px 8px 10px;
    outline: 1px solid var(--profile-o);
    width: 100px;
    margin-top: 60px;
    display: inline-block;
  }
}
@layer page-1 {
  page01 {
    grid-template-rows: 1fr 50px;
    padding: 20px 20px 40px 20px;
    gap: 8px;
  }
  list, list01, list02 {
    grid-template-rows: repeat(12, auto);
    text-align: left;
    align-content: start;
    transform: rotate(180deg);
    gap: 1px;
    grid-row: 1;
  }
  rom, titl, file, cont {
    display: flex;
    column-gap: 1px;
    transform: rotate(180deg);
    max-width: calc(100vw - 40px);
  }
  titl {
    padding: 16px 0px 6px 0px;
    color: var(--profile-3);
  }
  name, ver, opti {
    flex: 1;
    padding: 17px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  cta {
    grid-template-columns: auto 50px 50px 90px;
    gap: 8px;
    grid-row: 2;
  }
  more {
    width: 40px;
    background: linear-gradient(var(--profile-3), var(--profile-3));
    mask: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 1H2M0 5H2M0 9H2M4 1H6M8 1H10M4 5H6M8 5H10M4 9H6M8 9H10' stroke='%23C5AF90' stroke-width='2'/%3E%3C/svg%3E%0A") no-repeat center;
  }
  dele {
    width: 40px;
    background: linear-gradient(var(--profile-3), var(--profile-3));
    mask: url("data:image/svg+xml,%3Csvg width='10' height='8' viewBox='0 0 10 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 4H10M6 4H4M2 4H0' stroke='%23C5AF90' stroke-width='2'/%3E%3C/svg%3E%0A") no-repeat center;
  }
  setting, label, more, down, dele {
    background-position: center;
    background-repeat: no-repeat;
    place-items: center;
  }
}
@layer page-2 {
  page02 {
    justify-items: center;
  }
  /* layer display */
  display {
    position: relative;
    grid-template-rows: 1fr 10px;
    justify-items: left;
  }
  screen {
    z-index: 2;
    position: relative;
  }
  screen::after {
    background-image: var(--shader);
    background-size: var(--size);
    width: var(--width);
    height: var(--height);
    transform: scale(var(--scale));
  }
  canvas {
    width: 100%;
    image-rendering: pixelated;
    transition: opacity 0.5s ease-in-out;
  }
  notification {
    position: relative;
    font-family: "04b";
    grid-template-columns: 1fr auto;
    color: var(--profile-2);
    text-align: left;
    align-items: end;
  }
  notification title1, time1 {
    line-height: 6px;
    height: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background-color: var(--profile-black);
  }
  notification title1 {
    max-width: 70%
  }
  notification time1 {
    font-family: "04bf";
    position: absolute;
    right: -1px;
  }
  /* layer gamepad */
  page02 gamepad {
    padding: 0px 6px;
    grid-template-columns: 1fr 1px 1fr 1px 1fr 1px 1fr 1px 10px 1px 1fr 1px 1fr 1px 1fr 1px 1fr;
    grid-template-rows: 24px 8px 1fr 1px 1fr 1px 24px;
  }
  btn-l {
    position: relative;
    grid-area: btn-l;
    grid-row: 01 / 01;
    grid-column: 01 / 09
  }
  btn-r {
    position: relative;
    grid-area: btn-r;
    grid-row: 01 / 01;
    grid-column: 11 / 16;
    margin-right: 1px;
  }
  btn-menu {
    position: relative;
    grid-area: btn-menu;
    grid-row: 01 / 01;
    grid-column: 16 / 18
  }
  sec-12 {
    position: relative;
    grid-area: sec-12;
    grid-row: 03 / 03;
    grid-column: 11 / 18
  }
  sec-34 {
    position: relative;
    grid-area: sec-34;
    grid-row: 05 / 05;
    grid-column: 11 / 18
  }
  btn-select {
    position: relative;
    grid-area: btn-select;
    grid-row: 07 / 07;
    grid-column: 11 / 14
  }
  btn-start {
    position: relative;
    grid-area: btn-start;
    grid-row: 07 / 07;
    grid-column: 15 / 18
  }

  btn-r, btn-l, btn-menu, btn-state, btn-select, btn-start {
    display: grid;
    font-size: 8px;
    padding-left: 2px;
    place-items: center;
    color: var(--profile-2);
    white-space: pre;
  }
  btn-select, btn-start {
    padding-left: 3px
  }
  sec-dpad {
    position: relative;
    grid-area: sec-dpad;
    grid-row: 03 / 08;
    grid-column: 01 / 09;
    background-image:
      linear-gradient(var(--profile-base), var(--profile-base)),
      linear-gradient(var(--profile-base), var(--profile-base)),
      linear-gradient(var(--profile-base), var(--profile-base)),
      linear-gradient(var(--profile-base), var(--profile-base));
    background-size: 3px 6px, 3px 6px, 6px 3px, 6px 3px;
    background-position: top 20px center, bottom 20px center, left 20px center, right 20px center;
    background-repeat: no-repeat;
  }
  sec-12, sec-34 {
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    gap: 1px
  }
  joypad svg {
    background: url("data:image/svg+xml,%3Csvg width='175' height='175' viewBox='0 0 175 175' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M88 87H137V88H88V137H87V88H38V87H87V38H88V87Z' fill='%231D1A15'/%3E%3C/svg%3E%0A");
  }
  btn-state, btn-menu, btn-l, btn-r, btn-1, btn-2, btn-3, btn-4, btn-select, btn-start, #joypad {
    background-position: center !important;
    background-repeat: no-repeat !important;
  }
  btn-1, btn-2, btn-3, btn-4 {
    font-size: 12px;
    display: grid;
    place-items: center;
    letter-spacing: -3px;
  }
  joypad {
    justify-content: end;
  }
  invis {
    width: 90%;
    height: 20px;
    position: absolute;
    bottom: 0;
    z-index: 10;
  }
}
@layer page-3 {}