.file-table td,
.file-table th {
  font-size: 14px;
  padding: 8px 6px;
  color: inherit;
}

.file-table a {
  color: inherit;
  text-decoration: none;
}

.file-table a:hover {
  color: #ffffff !important;
  text-decoration: underline;
}

.file-search {
  min-width: 220px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
}

.file-search::placeholder { color: rgba(255,255,255,0.85); opacity: 1; }
.file-search::-webkit-input-placeholder { color: rgba(255,255,255,0.85); }
.file-search:-ms-input-placeholder { color: rgba(255,255,255,0.85); }
.file-search::-ms-input-placeholder { color: rgba(255,255,255,0.85); }

.card-bg h1 {
  margin: 6px 0 2px 0;
  font-size: 20px;
}

.card-bg p { margin: 0; font-size: 13px; opacity: 0.85; }

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-section + .settings-section {
  margin-top: -12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 4px 0;
}

@font-face {
  font-family: AdwaitaSans;
  src: url(/fonts/AdwaitaSans-Regular.ttf);
}

@font-face {
  font-family: AdwaitaMono;
  src: url(/fonts/AdwaitaMono-Regular.ttf);
}

@font-face {
  font-family: GoogleSans;
  src: url(/fonts/GoogleSansRounded-Medium.ttf)
}

@font-face {
  font-family: GoogleSans-Bold;
  src: url(/fonts/GoogleSansRounded-Bold.ttf)
}

@font-face {
  font-family: SFPro;
  src: url(/fonts/SFPro.otf);
}

@font-face {
  font-family: SFPro-Bold;
  src: url(/fonts/SFPro-Bold.otf);
}


html {
  transition: background 0.3s, color 0.3s;
  min-height: 100vh;
  background: none;
  background-color: #1a1b26;
  overflow-x: hidden;
  --wallpaper-image: none;
  --wallpaper-blur: none;
  --accent-color-primary: #5d94c233;
  --accent-color-primary-opaque: #5d94c280;
  --accent-color-hover: #569cd633;
  --accent-color-hover-opaque: #569cd680;
  --accent-color-button-bg: #4a8ac780;
  --accent-color-button-bg-opaque: #4a8ac780;
}


body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: #ECEFF4;
  font-family: GoogleSans, sans-serif;
  background-color: transparent;
  position: relative;
  isolation: isolate;
}

body::before {
  content: "";
  position: fixed;
  top: -50px;
  right: -50px;
  bottom: -50px;
  left: -50px;
  background-image: var(--wallpaper-image, url(/images/background.jpg));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: var(--wallpaper-blur, none);
  transform: scale(1.1);
  transform-origin: center center;
  will-change: filter, transform, opacity;
  z-index: -1;
  pointer-events: none;
  transition: opacity 0.32s ease, filter 0.32s ease, transform 0.32s ease;
}

html.wallpaper-transitioning body::before {
  opacity: 0;
}

html.gradient-wallpaper body::before {
  background-size: 200% 200%;
  animation: gradient-animate 18s ease infinite;
}

html.gradient-static body::before {
  animation: none;
}

@keyframes gradient-animate {
  0% {
    background-position: 20% 30%;
  }
  50% {
    background-position: 80% 70%;
  }
  100% {
    background-position: 20% 30%;
  }
}

@keyframes page-enter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98) perspective(1px);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1) perspective(1px);
  }
}

@keyframes topnav-enter {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px) scale(0.96) perspective(1px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1) perspective(1px);
  }
}

@keyframes topnav-left-enter {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(-12px) scale(0.96) perspective(1px);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1) perspective(1px);
  }
}

@keyframes topnav-right-enter {
  from {
    opacity: 0;
    transform: translateY(-50%) translateX(12px) scale(0.96) perspective(1px);
  }

  to {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1) perspective(1px);
  }
}

@keyframes minimize-button-enter {
  0% {
    opacity: 0;
    transform: translateX(-10px) scale(0.45) rotate(-18deg) perspective(1px);
  }

  70% {
    opacity: 1;
    transform: translateX(2px) scale(1.12) rotate(4deg) perspective(1px);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg) perspective(1px);
  }
}

@keyframes minimize-button-enter-vertical {
  0% {
    opacity: 0;
    transform: translateY(-10px) scale(0.45) rotate(-18deg) perspective(1px);
  }

  70% {
    opacity: 1;
    transform: translateY(2px) scale(1.12) rotate(4deg) perspective(1px);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes minimize-button-reveal {
  0% {
    width: 0;
    opacity: 0;
    transform: translateX(-8px) scale(0.7) rotate(-12deg) perspective(1px);
  }

  60% {
    width: 28px;
    opacity: 1;
    transform: translateX(2px) scale(1.02) rotate(2deg) perspective(1px);
  }

  100% {
    width: 28px;
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0deg) perspective(1px);
  }
}

.social-bg {
  display: flex;
  gap: 12px;
  background: rgba(0, 0, 0, 0.9375);
  border-radius: 16px;
  padding: 14px 18px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  width: fit-content;
  margin: 0 auto;
}

.card-bg {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: rgba(0, 0, 0, 0.9375);
  border-radius: 16px;
  padding: 14px;
  width: fit-content;
  min-width: 220px;
  max-width: 560px;
  margin: 0 auto;
  gap: 8px;
  box-sizing: border-box;
}

.card-bg > * {
  margin: 0;
}

.card-bg > .settings {
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 0;
  margin: 0;
}

.card-bg h2 {
  margin: 0 0 2px 0;
}

.card-bg .settings h2,
.card-bg .settings p {
  margin: 0;
}

.card-bg > img {
  margin: 0 auto;
  display: block;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
}

.card-bg p,
.card-bg #welcome {
  margin: 0;
  line-height: 1.3;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  background: transparent;
  border: none;
}

.status-badge {
  display: block;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  border: none;
  max-height: 32px;
  width: auto;
}

.social-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none !important;
}

.social-label {
  font-size: 0.65rem;
  margin-top: 6px;
  color: #ffffff !important;
  font-weight: 600;
  letter-spacing: 0.05em;
  display: none;
}

html.show-social-labels .social-label {
  display: block;
}

html.hide-figcaptions figcaption {
  display: none !important;
}

.icon-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s;
}

a {
  color: var(--accent-color-primary);
  text-decoration: none;
  color: #87cefa;
}

a:not(.device-card-link):hover {
  color: var(--accent-color-hover);
  transition: 0.3s ease, opacity 0.3s ease;
  opacity: 0.7;
}

a:visited {
  color: #acacff;
  text-decoration: none;
}

ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

li {
  padding: 0;
}

img {
  border-radius: 6.25%;
  max-width: 100%;
  height: auto;
}

.card-bg > img {
  width: 220px;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

button {
  background-color: #14171d;
  color: #ECEFF4;
  font-family: "Noto Sans", sans-serif;
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
}

.pfp-name {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-family: GoogleSans-Bold;
  font-optical-sizing: auto;
  font-weight: 700;
  font-style: bold;
}

.topnav {
  background-color: #00000039;
  overflow: visible;
  border-radius: 6.25px;
  padding: 4px 5px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) perspective(1px);
  width: fit-content;
  z-index: 1000;
  transition: padding 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0s linear 0.2s;
              border-radius 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  animation: topnav-enter 0.45s ease both;
}

html.topbar-transitioning .topnav,
html.topbar-transitioning .topnav a:not(.minimize-btn),
html.topbar-transitioning .minimize-btn {
  transition-duration: 0.28s !important;
}

.topbar-top .topnav {
  top: 18px;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%) perspective(1px);
  flex-direction: row;
  animation-name: topnav-enter;
}

.topbar-bottom .topnav {
  top: auto;
  bottom: 16px;
  left: 50%;
  right: auto;
  transform: translateX(-50%) perspective(1px);
  flex-direction: row;
  animation-name: topnav-enter;
}

.topbar-left .topnav {
  top: 50%;
  bottom: auto;
  left: 16px;
  right: auto;
  transform: translateY(-50%) perspective(1px);
  flex-direction: column;
  animation-name: topnav-left-enter;
}

.topbar-right .topnav {
  top: 50%;
  bottom: auto;
  right: 16px;
  left: auto;
  transform: translateY(-50%) perspective(1px);
  flex-direction: column;
  animation-name: topnav-right-enter;
}

.topbar-top .main {
  margin: 80px auto 20px auto;
}

.topbar-bottom .main {
  margin: 20px auto 80px auto;
}

.topbar-left .main,
.topbar-right .main {
  margin: 20px auto 20px auto;
}

.topbar-left .minimize-btn,
.topbar-right .minimize-btn {
  width: 28px;
  max-width: 28px;
  height: 0;
  max-height: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-8px) scale(0.7) rotate(-12deg) perspective(1px);
  transition: height 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.2s ease,
              transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0s linear 0.2s;
}

.topbar-left .topnav:hover .minimize-btn,
.topbar-left .topnav:focus-within .minimize-btn,
.topbar-right .topnav:hover .minimize-btn,
.topbar-right .topnav:focus-within .minimize-btn {
  height: 28px;
  max-height: 28px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1) rotate(0deg) perspective(1px);
  transition-delay: 0s;
}

.topbar-minimized .topnav {
  width: auto;
  padding: 4px;
}

.topbar-minimized .topnav a:not(.minimize-btn) {
  width: 28px;
  height: 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              height 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              padding 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              font-size 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.minimize-btn {
  background-color: var(--navy-hover-bg, var(--accent-color-hover, #07006333));
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0;
  max-width: 0;
  height: 28px;
  max-height: 28px;
  overflow: hidden;
  padding: 0 !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-8px) scale(0.7) rotate(-12deg) perspective(1px);
  transform-origin: center;
  flex-shrink: 0;
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              background-color 0.3s,
              color 0.3s,
              opacity 0.2s ease,
              transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0s linear 0.2s;
}

.topnav:hover .minimize-btn,
.topnav:focus-within .minimize-btn {
  width: 28px;
  max-width: 28px;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(0) scale(1) rotate(0deg) perspective(1px);
  animation: minimize-button-reveal 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition-delay: 0s;
}

.topnav:not(:hover):not(:focus-within) .minimize-btn {
  animation: none;
  transition: width 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              opacity 0.18s ease,
              transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1),
              visibility 0s linear 0.2s;
}

.minimize-btn:hover {
  background-color: var(--navy-hover-bg, var(--accent-color-hover, #07006333)) !important;
  opacity: 1 !important;
}

.topnav a {
  color: #fff;
  text-align: center;
  padding: 4px 5px;
  border-radius: 6.25px;
  text-decoration: none;
  font-size: 16px;
  font-family: GoogleSans-Bold;
  font-weight: 100;
  margin: 0;
  margin-right: 4px;
  transition: background-color 0.3s, color 0.3s, opacity 0.3s, padding 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), font-size 0.28s cubic-bezier(0.2, 0.8, 0.2, 0.2, 1), transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (max-width: 600px) {
  .topnav {
    gap: 4px;
    padding: 4px 5px;
    align-items: center;
  }

  .topbar-left .minimize-btn,
  .topbar-right .minimize-btn {
    width: 0;
    max-width: 0;
    height: 28px;
    max-height: 28px;
    transform: translateX(-8px) scale(0.7) rotate(-12deg) perspective(1px);
  }

  .topbar-left .topnav:hover .minimize-btn,
  .topbar-left .topnav:focus-within .minimize-btn,
  .topbar-right .topnav:hover .minimize-btn,
  .topbar-right .topnav:focus-within .minimize-btn {
    width: 28px;
    max-width: 28px;
    transform: translateX(0) scale(1) rotate(0deg) perspective(1px);
  }

  .main {
    max-width: calc(100% - 10px);
  }

  .topnav a {
    flex: unset;
    text-align: center;
    font-size: 16px;
    padding: 4px 5px;
    color: #fff;
    margin: 0;
    line-height: 1;
  }

  .mobile-hidden-setting {
    display: none !important;
  }

  .minimize-btn {
    display: flex !important;
    height: 28px;
    min-height: 28px;
    box-sizing: border-box;
  }

  .social-title {
    font-size: 1.25rem !important;
  }

  .social-bg,
  .card-bg {
    padding: 8px 12px !important;
    gap: 8px !important;
    border-radius: 16px !important;
  }

  .icon-img {
    width: 28px !important;
    height: 28px !important;
  }
}

.topnav a:hover {
  background-color: var(--navy-hover-bg, var(--accent-color-hover, #07006333));
  color: #fff;
  opacity: 1;
}

.main {
  background-color: #00000039;
  overflow: hidden;
  border-radius: 6.25px;
  margin: 80px auto 20px auto;
  width: fit-content;
  max-width: 95vw;
  box-sizing: border-box;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
  animation: page-enter 0.45s ease 0.08s both;
}

.main>* {
  margin: 0;
}

.main h2 {
  margin-top: 28px;
  margin-bottom: 4px;
}

html.no-bg {
  background-color: #2e3440;
}

html.no-bg body::before {
  background-image: none !important;
}

.light-mode {
  background-color: #ffffff !important;
  color: #2E3440;
}

.light-mode .topnav a,
.light-mode .pfp-name,
.light-mode h1,
.light-mode h2,
.light-mode h3,
.light-mode h4,
.light-mode h5,
.light-mode h6,
.light-mode li,
.light-mode .setting-item {
  color: #2E3440;
}

.light-mode a {
  color: #5E81AC;
}

.light-mode button {
  background-color: #E5E9F0;
  color: #2E3440;
}

.adwaita-font body {
  font-family: AdwaitaSans, sans-serif !important;
}

.adwaita-font .pfp-name,
.adwaita-font .topnav a {
  font-family: AdwaitaMono, monospace !important;
}

.sfpro-font body,
.sfpro-font .pfp-name,
.sfpro-font .topnav a {

.file-list-container {
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.file-list-container::-webkit-scrollbar { width: 0; height: 0; }

.file-table { min-width: 0; width:100%; table-layout: auto; }

.file-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

  font-family: SFPro, sans-serif !important;
}

.sfpro-bold-font body,
.sfpro-bold-font .pfp-name,
.sfpro-bold-font .topnav a {
  font-family: SFPro-Bold, sans-serif !important;
}

.google-font body,
.google-font .pfp-name,
.google-font .topnav a {
  font-family: GoogleSans, sans-serif !important;
}

.google-bold-font body,
.google-bold-font .pfp-name,
.google-bold-font .topnav a {
  font-family: GoogleSans-Bold, sans-serif !important;
}

.google-bold-font body,
.google-bold-font .pfp-name,
.google-bold-font .topnav a {
  font-family: GoogleSans-Bold, sans-serif !important;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
}

.switch {
  position: relative;
  display: inline-flex;
  min-width: 120px;
  width: auto;
  height: 24px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  right: 0;
  bottom: 0;
  width: 44px;
  background-color: #4c566a;
  transition: background-color 0.2s ease, transform 0.2s ease;
  border-radius: 24px;
}

.switch:hover .slider,
.switch input:focus + .slider {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: transform 0.2s ease;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-color-button-bg);
}

input:checked+.slider:before {
  transform: translateX(20px) perspective(1px);
}

.custom-select {
  background-color: var(--accent-color-button-bg);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 8px 12px 8px 14px;
  padding-right: 44px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, color 0.2s ease;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath fill='none' stroke='%23FFFFFF' stroke-width='1.5' d='M1 1.5l4 3 4-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px 6px;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.custom-select:hover,
.custom-select:focus {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px) scale(1.01);
}

.custom-select:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

html.reduced-motion *,
html.reduced-motion *::before,
html.reduced-motion *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}

html.reduced-motion .slider,
html.reduced-motion .custom-select,
html.reduced-motion .topnav a,
html.reduced-motion button,
html.reduced-motion .card-bg,
html.reduced-motion .social-bg,
html.reduced-motion .main {
  transition: none !important;
}

.custom-select option {
  background: #4a5162;
  color: #ffffff;
}

html.accent-blue {
  --accent-color-primary: rgba(93, 148, 194, 0.0925);
  --accent-color-hover: rgba(86, 156, 214, 0.0925);
  --accent-color-button-bg: #4a8bc780;
}

html.accent-default {
  --accent-color-primary: rgba(81, 92, 102, 0.093);
  --accent-color-primary-opaque: #5d95c280;
  --accent-color-hover: rgba(86, 156, 214, 0.0925);
  --accent-color-hover-opaque: #569cd680;
  --accent-color-button-bg: #4a8bc780;
  --accent-color-button-bg-opaque: #4a8ac780;
}

html.accent-navy {
  --accent-color-primary: rgba(92, 112, 214, 0.0925);
  --accent-color-primary-opaque: #5c70d680;
  --accent-color-hover: rgba(123, 143, 237, 0.0925);
  --accent-color-hover-opaque: #7b8fed;
  --accent-color-button-bg: #4052b580;
  --accent-color-button-bg-opaque: #4052b580;
  --navy-hover-bg: rgba(92, 112, 214, 0.0925);
}

html.accent-nord {
  --accent-color-primary: rgba(59, 66, 82, 0.123);
  --accent-color-primary-opaque: #3b425280;
  --accent-color-hover: rgba(67, 76, 94, 0.0925);
  --accent-color-hover-opaque: #434c5e;
  --accent-color-button-bg: #434c5e80;
  --accent-color-button-bg-opaque: #434c5e80;
}

.main,
.topnav {
  background: var(--accent-color-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.social-bg,
.card-bg {
  background: var(--accent-color-primary) !important;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

html.blur-disabled .main,
html.blur-disabled .topnav,
html.blur-disabled .social-bg,
html.blur-disabled .card-bg,
html.blur-disabled .popup-empty {
  background: var(--accent-color-primary-opaque) !important;
}

.main {
  border-radius: 32px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.topnav {
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.social-bg,
.card-bg {
  border-radius: 24px;
}

.topnav a {
  border-radius: 20px;
}

.roms-container,
.devices {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  justify-items: stretch;
  width: 100%;
  align-items: stretch;
}

@media (max-width: 720px) {
  .devices {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 0 12px;
  }

  .topnav {
    gap: 2px;
    padding: 4px 5px;
    align-items: center;
  }

  .topnav a {
    font-size: 0.9rem;
    padding: 4px 5px;
    line-height: 1;
  }

  .device-card {
    min-height: 220px;
  }

  .device-card img {
    max-height: 120px;
  }
}

.device-card,
.roms-container figure,
.roms-container .phone-item {
  display: flex;
  flex-direction: column;
}

.device-card {
  width: 100%;
  min-width: 0;
  max-width: none;
  margin: 0;
  padding: 18px;
  border-radius: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  will-change: transform, box-shadow, border-color;
  min-height: 0;
  justify-content: center;
}

.device-card a {
  color: #ffffff
}

.device-card .item {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  flex: 1;
}

.device-card figcaption {
  margin: 0;
}

.device-card-link {
  display: flex;
  width: 100%;
  text-decoration: none;
  color: inherit;
  align-items: stretch;
}

.device-card-trigger {
  cursor: pointer;
}

.device-card-link:hover .device-card,
.device-card-link:focus-visible .device-card {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.35);
}

.device-card {
  flex: 1;
}

.device-card img {
  max-height: 130px;
  object-fit: contain;
}

.device-card figcaption {
  color: #ffffff;
  opacity: 1;
}

.device-card .item {
  opacity: 0;
  transform: translateY(10px);
  animation: device-card-appear 0.6s ease forwards;
}

.device-card:nth-child(1) .item { animation-delay: 0.08s; }
.device-card:nth-child(2) .item { animation-delay: 0.16s; }
.device-card:nth-child(3) .item { animation-delay: 0.24s; }
.device-card:nth-child(4) .item { animation-delay: 0.32s; }
.device-card:nth-child(5) .item { animation-delay: 0.40s; }
.device-card:nth-child(6) .item { animation-delay: 0.48s; }
.device-card:nth-child(7) .item { animation-delay: 0.56s; }

@keyframes device-card-appear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[hidden] {
  display: none !important;
}

.device-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--accent-color-primary);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 2000;
  animation: device-modal-fade-in 0.22s ease forwards;
}

.device-modal {
  width: min(480px, 100%);
  background: var(--accent-color-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 24px;
  color: #f8fafc;
  position: relative;
  transform: translateY(8px) scale(0.98);
  animation: device-modal-pop-in 0.24s ease forwards;
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
}

.device-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.device-modal-close:hover,
.device-modal-close:focus-visible {
  background: var(--accent-color-hover, rgba(86, 156, 214, 0.33));
  transform: scale(1.03);
}

.device-modal h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
  color: #ffffff;
}

.device-modal-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  opacity: 0.95;
  line-height: 1.55;
}

.device-modal-list a {
  color: #8ec5ff;
  text-decoration: underline;
  font-weight: 600;
  opacity: 1;
  display: inline-block;
  font-size: 15px;
}

.device-modal-list a:hover,
.device-modal-list a:focus-visible {
  text-decoration: underline;
  opacity: 1;
}

body.device-modal-open {
  overflow: hidden;
}

@keyframes device-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes device-modal-pop-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
