*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --safe-top: env(safe-area-inset-top, 0px);
  --nav-height: 74px;
  --nav-total-height: calc(var(--nav-height) + var(--safe-top));
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  background: #050505;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #fff;
  overflow: hidden;
  overscroll-behavior: none;
}


button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nav {
  position: fixed;
  top: 0;
  height: var(--nav-total-height);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--safe-top) 22px 0;
  border-bottom: 1px solid rgba(255,255,255,0.22);
  background: rgba(5,5,5,0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  left: 0;
  right: 0;
  z-index: 50;
}

.logo {
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.04em;
  line-height: 1;
}

.menu {
  width: 40px;
  height: 34px;
  display: grid;
  align-content: center;
  gap: 7px;
  justify-items: end;
}

.menu span {
  display: block;
  width: 31px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
}

#app {
  position: fixed;
  top: var(--nav-total-height);
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(100vh - var(--nav-total-height));
  height: calc(100dvh - var(--nav-total-height));
  overflow: hidden;
}

.hidden-view {
  display: none !important;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(3, 1fr);
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 20px 18px 18px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.17);
  border-bottom: 1px solid rgba(255,255,255,0.17);
  background:
    radial-gradient(circle at 50% 45%, rgba(255,255,255,0.014), transparent 46%),
    linear-gradient(180deg, rgba(255,255,255,0.007), rgba(255,255,255,0));
}

.tile:nth-child(2n) {
  border-right: 0;
}

.tile:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  display: block;
  flex: 0 0 auto;
  margin: 0;
}

.label {
  display: block;
  width: 100%;
  margin: 0;
  font-size: 14px;
  line-height: 1.1;
  color: rgba(255,255,255,0.9);
  font-weight: 400;
  text-align: center;
}

.overlay {
  position: fixed;
  inset: var(--nav-total-height) 0 0 0;
  z-index: 30;
  background: rgba(0,0,0,0.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  right: 0;
  top: var(--nav-total-height);
  z-index: 40;
  width: min(31vw, 276px);
  min-width: 248px;
  height: calc(100vh - var(--nav-total-height));
  height: calc(100dvh - var(--nav-total-height));
  background:
    radial-gradient(circle at 50% 0%, rgba(255,255,255,0.04), transparent 34%),
    linear-gradient(180deg, #111111 0%, #070707 100%);
  border-left: 1px solid rgba(255,255,255,0.1);
  transform: translateX(100%);
  transition: transform 0.24s ease;
  box-shadow: -20px 0 64px rgba(0,0,0,0.42);
  overflow: hidden;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-content {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  min-height: 0;
}

.drawer-list {
  min-height: 0;
  display: grid;
  grid-template-rows: repeat(6, 1fr);
}

.drawer-item {
  width: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 17px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: left;
  overflow: hidden;
}

.drawer-item:last-child {
  border-bottom: 0;
}

.drawer-icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex: 0 0 auto;
}

.drawer-label {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  line-height: 1.1;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 62px;
  padding: 0 18px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.008), rgba(255,255,255,0.02));
}

.drawer-footer-brand {
  display: block;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,0.7);
}

.placeholder-view {
  min-height: calc(100vh - var(--nav-height));
  min-height: calc(100dvh - var(--nav-height));
  display: grid;
  place-items: center;
  color: rgba(255,255,255,0.68);
  font-size: 15px;
}

@media (max-width: 560px) {
  :root {
    --nav-height: 78px;
  }

  .nav {
    padding: 0 18px;
  }

  .logo {
    font-size: 23px;
  }

  .menu {
    width: 42px;
    height: 36px;
    gap: 7px;
  }

  .menu span {
    width: 32px;
  }

  .drawer {
    width: min(61vw, 250px);
    min-width: 0;
  }

  .drawer-item {
    padding: 0 18px;
    gap: 12px;
  }

  .drawer-icon {
    width: 24px;
    height: 24px;
  }

  .drawer-label {
    font-size: 15px;
    line-height: 1.1;
    letter-spacing: -0.01em;
  }

  .drawer-footer {
    min-height: 58px;
    padding: 0 16px;
  }

  .drawer-footer-brand {
    font-size: 12px;
  }

  .icon {
    width: 72px;
    height: 72px;
  }

  .tile {
    gap: 10px;
    padding: 18px 16px 16px;
  }

  .label {
    font-size: 13px;
  }
}

.app-view {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.app-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050505;
}

.drawer-item.is-active,
.tile.is-active {
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
}
