/* ==========================================================================
   CSS Variables & Optimizations
   ========================================================================== */
:root {
  /* Original variable names maintained for compatibility */
  --divs-and-sections: #81A1C1;
  --background-and-accents: #2e3440;
  --lighter-black: #434c5e;
  --text-colors: #EBCB8B;
  --mlp-color: #B48EAD;
  --dark-text: #4C566A;
  --nord-aurora-red: #BF616A;
  --nord-aurora-purple: #B48EAD;
  --nord-aurora-blue: #5E81AC;
  --nord-aurora-green: #A3BE8C;
  --nord-aurora-orange: #D08770;

  /* Layout variables from shapes.css */
  --iconListPadding: 12px 2px 5px 7px;
  --iconListMaxWidth: 1055px;
  --iconListWebkitMaxWidth: 1045px;
  --normalWidth: 169px;
  --webkitnormalWidth: 169px;
  --maxWidth: 338px;
  --webkitmaxWidth: 338px;
  --webkitmaxWidthVideo: 545px;
  --WidthVOne: 270px;
  --webkitWidthVOne: 270px;
  --WidthTwo: 338px;
  --webkitWidthTWo: 338px;
  --WidthThree: 507px;
  --webkitWidthThree: 507px;
  --WidthFour: 650px;
  --webkitWidthFour: 650px;
  --WidthFive: 865px;
  --webkitWidthFive: 865px;

  /* Style variables */
  --box-shape: 6px 6px;

  /* Optimized Font Stacks */
  --font-fallback: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-primary-stack: OpenSans, var(--font-fallback);
  --font-bold-stack: OpenSansB, var(--font-fallback);

  /* Legacy font variables for compatibility */
  --font-bold: OpenSansB;
  --font-primary: OpenSans;
}

/* ==========================================================================
   Font Loading Classes for Smooth Loading
   ========================================================================== */

/* Initial state - fonts not loaded */
.fonts-loading body {
  visibility: hidden;
}

/* Fonts loaded state */
.fonts-loaded body {
  visibility: visible;
}

/* Fallback timeout */
.fonts-loaded body,
.fonts-failed body {
  visibility: visible;
}

/* ==========================================================================
   Optimized Font Loading (replaces original font loading)
   ========================================================================== */
@font-face {
  font-family: "OpenSans";
  src: local(OpenSans), url(static/OpenSans-SemiBold.woff2) format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "OpenSansB";
  src: local(OpenSansB), url(static/OpenSans-ExtraBold.woff2) format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


/* ==========================================================================
   Error Pages (400s.css integration)
   ========================================================================== */
body.error-400,
body[data-error="400"] {
  background-color: #2e3440;
  background-image: url("/static/images/header/png/Riolu400s.png");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: top;
}

/* ==========================================================================
   Loading Animation (from style.css)
   ========================================================================== */
.loading {
  position: fixed;
  z-index: 99;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-and-accents);
  display: flex;
  justify-content: center;
  align-items: center;
}

.loading::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 10px solid var(--dark-text);
  border-top-color: var(--divs-and-sections);
  border-radius: 50%;
  transform: rotate(0.16turn);
  animation: loading 1s ease infinite;
}

.loading.hidden {
  animation: fadeOut 1s;
  animation-fill-mode: forwards;
}

@keyframes fadeOut {
  100% {
    opacity: 0;
    visibility: collapse;
    display: none;
  }
}

@keyframes loading {
  to {
    transform: rotate(1turn);
  }
}

/* ==========================================================================
   Base Styles with Optimized Fonts
   ========================================================================== */
body {
  margin: 0;
  padding: 0;
  background-color: var(--background-and-accents) !important;
  background-image: none !important;
  font-family: var(--font-primary-stack);
}

/* ==========================================================================
   All Original IDs Maintained (from style.css)
   ========================================================================== */
#ArtistsAndCategories,
#ArtistsAndCategories2 {
  -webkit-max-logical-width: 868px;
  padding: 5px 5px 8px 7px;
  max-width: 880px;
}

#ArtistsAndCategories,
#ArtistsAndCategories2,
#BackButton2,
#BasicSection,
#BasicSection2,
#DYCF,
#Description,
#Description1,
#Description2,
#Description3,
#Description4,
#Enter,
#MainVideos,
#NEW,
#NextAndPreveee,
#Oldenough,
#TITL,
#Videos,
#Videos2,
#ZoomVideo,
#comments,
#description-wallets,
#masterIconList,
#masterImages,
#masterMain,
#masterMain2,
#masterMain3,
#masterMain4,
#masterVMain,
#masterVMain2,
#masterVMain3,
#masterVideos,
#torbigarea {
  background-color: var(--divs-and-sections);
  border-radius: var(--box-shape);
  box-shadow: #000 1px 12px 30px;
  margin: 10px auto;
  text-align: center;
}

#BackButton2 {
  max-width: 350px;
  min-width: 200px;
  padding: 12px 14px 8px 14px;
}

#Decription-bb,
.BExLarge,
.ExLarge,
.blueup,
.orangeup,
.greenup,
.purpleup,
.redup,
a.Basic,
a.ExxLarge,
a.ExxxxxxLarge,
a.Large,
a.Large2 {
  text-align: left;
}

#Decriptions-bb {
  margin: 10px auto;
  padding: 10px 25px 5px 15px;
}

#Decriptions-bb,
#Decriptions-bb2 {
  background-color: var(--background-and-accents);
  max-width: 800px;
}

#Decriptions-bb2 {
  margin: 5px auto;
  padding: 1px 25px 1px 15px;
  text-align: center;
}

#Description {
  max-width: 800px;
  padding: 5px 15px;
}

#Descriptionwhite {
  border-color: #fff;
  border-style: solid;
  padding: 1px;
  text-align: center;
  width: 170px;
}

#Descriptionwhite,
#thumbdisplay,
.container,
.numbertext,
.CR {
  margin: auto;
}

#Enter {
  width: 330px;
  padding: 8px 5px 5px 5px;
}

#Enter img {
  border: 5px solid;
  border-color: var(--lighter-black);
  height: auto;
  max-width: 100%;
}

#MainVideos {
  max-width: 865px;
  padding: 2px 1px 2px 2px;
}

#NextAndPreveee {
  -webkit-max-logical-width: 198px;
  max-width: 198px;
  padding: 10px 10px 5px;
}

#Oldenough {
  max-width: 800px;
  padding: 5px 25px 5px 15px;
}

#Sections {
  background-color: var(--divs-and-sections);
  border-radius: 15px;
  box-shadow: #000 1px 12px 30px;
  margin: 10px auto;
  max-width: 445px;
  min-width: 70px;
  padding: 10px 1px 5px;
  text-align: center;
}

#THUMBS {
  display: none;
}
#THUMBS img {
  position: relative;
}

#TITL {
  max-width: 800px;
  min-width: 150px;
  padding: 15px 30px 15px 20px;
}

#Videos {
  -webkit-max-logical-width: 845px;
  max-width: 865px;
  padding: 5px 5px 5px 10px;
}

#Videos2 {
  -webkit-max-logical-width: 430px;
  max-width: 445px;
  padding: 5px 5px 5px 10px;
}

#description-wallets {
  overflow: hidden;
  padding: 5px 25px 5px 15px;
  width: 630px;
}

#masterIconList {
  -webkit-max-logical-width: var(--iconListWebkitMaxWidth);
  max-width: var(--iconListMaxWidth);
  padding: var(--iconListPadding);
}

#masterImages {
  padding: 20px 30px 15px;
  width: 850px;
  min-height: 20vh;
  max-height: 30%;
}
#masterImages img {
  position: relative;
}

#masterMain {
  -webkit-max-logical-width: var(--webkitnormalWidth);
  max-width: var(--normalWidth);
  padding: 5px 5px 6px 10px;
}

#masterMain2 {
  -webkit-max-logical-width: var(--webkitWidthTWo);
  max-width: var(--WidthTwo);
  padding: 5px 5px 6px 10px;
}

#masterMain3 {
  -webkit-max-logical-width: var(--webkitWidthThree);
  max-width: var(--WidthThree);
  padding: 5px 5px 6px 10px;
}

#masterMain4 {
  -webkit-max-logical-width: var(--webkitWidthFour);
  max-width: var(--WidthFour);
  padding: 5px 5px 6px 10px;
}

#masterVMain {
  -webkit-logical-width: var(--webkitWidthVOne);
  padding: 5px 5px 6px 10px;
  width: var(--WidthVOne);
}

#masterVMain2 {
  -webkit-logical-width: 540px;
  padding: 5px 5px 6px 10px;
  width: 540px;
}

#masterVMain3 {
  -webkit-logical-width: 800px;
  padding: 5px 5px 6px 10px;
  width: 800px;
}

#masterVideos {
  padding: 15px;
  width: 600px;
}

#thumbdisplay {
  padding: 0 10px 5px;
  text-align: center;
}

#torbigarea {
  padding: 12px 24px 8px 14px;
  width: 100px;
}

/* ==========================================================================
   All Original Classes Maintained with Optimized Font Stacks
   ========================================================================== */
.BExLarge {
  color: var(--background-and-accents);
  font: 400 200% var(--font-primary-stack);
  text-decoration: none;
}

.BExLarge:link {
  color: var(--background-and-accents);
}

.BExLarge:visited,
.redup,
.redup:link,
.redup:visited {
  color: var(--nord-aurora-red);
}

.CATEGORY {
  height: 350px;
  width: 191px;
}

.CATEGORY,
.CATEGORY50p,
.CATEGORYEXTRASMALL,
.CATEGORY150p,
.CATEGORYSNALLER,
.CATEGORYEXTRASMALL,
.MLPCATEGORY,
.MLPCATEGORY50p,
.wallets,
.VIDEOCATEGORY {
  border: 5px solid;
  border-color: var(--background-and-accents);
  margin-right: 5px;
  margin-top: 5px;
}

.CATEGORY150p {
  height: 263px;
  width: 150px;
}

.CATEGORY50p {
  height: 175px;
  width: 95px;
}

.CATEGORYEXTRASMALL {
  height: 127px;
  width: 70px;
}

.CATEGORYSNALLER {
  height: 220px;
  width: 120px;
}

.CK {
  -moz-animation: fadein 0.75s;
  -o-animation: fadein 0.75s;
  -webkit-animation: fadein 0.75s;
  animation: fadein 0.75s;
  width: 700px;
}

.ExLarge,
.dropbtn,
.dropdown-content a,
.numbertext,
a.Basic,
a.ExxLarge,
a.Head,
a.Large,
a.Large2,
a.LargeUpdate,
a.LightBlue,
a.Small {
  color: var(--text-colors);
}

.ExLarge,
a.ExxLarge {
  font: 400 200% var(--font-primary-stack);
  text-decoration: none;
}

.MasterFoot {
  background-color: var(--divs-and-sections);
  bottom: 0;
  flex-shrink: 0;
  font-family: var(--font-primary-stack);
  margin-top: 50px;
  min-height: 40px;
  position: relative;
  text-align: center;
  width: 100%;
}

.NP {
  border: 3px solid;
  border-color: var(--background-and-accents);
  border-radius: 15px;
  cursor: pointer;
  height: 50px;
  width: 85px;
}

.New22 {
  cursor: pointer;
  height: 150px;
  margin-bottom: 0.5%;
  margin-right: 0.5%;
  object-fit: cover;
  opacity: 0.6;
  overflow: hidden;
  width: 150px;
}

.Row {
  display: inline-flex;
  overflow: scroll;
  width: 300px;
}

.SHT {
  border: 3px solid;
  border-color: var(--background-and-accents);
  border-radius: 7px;
  cursor: pointer;
  height: 50px;
  width: 85px;
}

.TOPBOI {
  color: none;
}

.VIDEOCATEGORY {
  height: 250px;
  width: 250px;
}

.active,
.New22:hover {
  opacity: 1;
}

.blueup {
  color: var(--nord-aurora-blue);
  font: 400 120% var(--font-primary-stack);
  text-decoration: none;
}

.blueup:link,
.blueup:visited,
pre code,
pre.code-css code {
  color: var(--nord-aurora-blue);
}

.dropbtn {
  background-color: var(--background-and-accents);
  border: none;
  border-radius: var(--box-shape);
  cursor: pointer;
  font: 14px var(--font-bold-stack);
  padding: 16px;
}

.dropdown {
  display: inline-block;
  font-family: var(--font-bold-stack);
  position: relative;
}

.dropdown-content {
  background-color: #2e3440;
  border-radius: var(--box-shape);
  box-shadow: 0 8px 16px 0 #0003;
  display: none;
  font-family: var(--font-bold-stack);
  min-width: 160px;
  position: absolute;
  z-index: 1;
}

.dropdown-content a {
  display: block;
  font: 14px var(--font-bold-stack);
  padding: 12px 16px;
  text-decoration: none;
}

.dropdown-content a:hover {
  background-color: var(--dark-text);
  border-radius: var(--box-shape);
}

.dropdown:hover .dropbtn {
  background-color: var(--dark-text);
  font-family: var(--font-bold-stack);
}

.dropdown:hover .dropdown-content {
  display: block;
  font-family: var(--font-bold-stack);
}

.greenup {
  color: var(--nord-aurora-green);
  font: 400 120% var(--font-primary-stack);
  text-decoration: none;
}

.greenup:link,
.greenup:visited {
  color: var(--nord-aurora-green);
}

.line-1 {
  background: #fff;
  height: 2px;
  width: 800px;
}

.numbertext {
  font: 25px var(--font-bold-stack);
}

.orangeup {
  color: var(--nord-aurora-orange);
  font: 400 120% var(--font-primary-stack);
  text-decoration: none;
}

.orangeup:link,
.orangeup:visited {
  color: var(--nord-aurora-orange);
}

.prev,
.next {
  cursor: pointer;
}

.purpleup {
  color: var(--nord-aurora-purple);
  font: 400 120% var(--font-primary-stack);
  text-decoration: none;
}

.purpleup:link,
.purpleup:visited {
  color: var(--nord-aurora-purple);
}

.redup,
a.Large,
a.Large2 {
  font: 400 120% var(--font-primary-stack);
  text-decoration: none;
}

.wallets {
  height: 350px;
  width: 350px;
}

a.Head {
  font: 250% var(--font-primary-stack);
  text-align: center;
}

a.LargeUpdate {
  font: 400 120% var(--font-primary-stack);
  text-align: left;
  text-decoration: none;
}

a.LightBlue {
  font-family: var(--font-primary-stack);
  font-weight: 400;
  text-align: left;
  text-decoration: none;
}

a.Small {
  font: 400 90% var(--font-primary-stack);
  text-align: left;
  text-decoration: none;
}

.CR {
  overflow: hidden;
}

.Header {
  background-color: var(--divs-and-sections);
  border-radius: var(--box-shape);
  box-shadow: #000 1px 5px 30px;
  font-family: var(--font-primary-stack);
  margin: 0 auto;
  max-width: 930px;
  min-width: 70px;
  padding: 5px 25px 5px 15px;
  text-align: center;
}

img {
  -khtml-user-drag: none;
  -moz-user-drag: none;
  -o-user-drag: none;
  -webkit-user-drag: none;
}

img.BACK {
  border: 5px solid;
  border-color: var(--lighter-black);
}

img.BACK,
img.titl,
.CK {
  height: auto;
  width: 100%;
}

img.alphabetlinks {
  border-radius: 25px;
  height: 80px;
  width: 195px;
}

img.extended {
  max-width: none;
}

nav {
  padding: 0;
}

pre {
  background: var(--background-and-accents);
  overflow: hidden;
  white-space: pre;
  word-wrap: break-word;
}

pre.code {
  border: 1px solid var(--background-and-accents);
  border-radius: 4px;
  margin: 20px 25px;
  position: relative;
}

pre.code code {
  display: block;
  font: 13px/19px Inconsolata, Monaco, Consolas, "Andale Mono", "Bitstream Vera Sans Mono", "Courier New", Courier, monospace;
  margin: 0;
  overflow-x: hidden;
  padding: 15px 16px 14px;
}

.New22,
img.alphabetlinks,
img.titl {
  border: 5px solid;
  border-color: var(--background-and-accents);
}

/* ==========================================================================
   Navigation (from topnav.css)
   ========================================================================== */
.topnav {
  width: 100%;
  border-radius: var(--box-shape);
  margin: auto;
  margin-top: 10px;
  margin-bottom: 12px;
  overflow: hidden;
  background-color: var(--divs-and-sections);
  box-shadow: black 1px 5px 30px;
}

.topnav a {
  float: left;
  color: var(--text-colors);
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-family: var(--font-bold-stack);
  font-size: 150%;
  transition-duration: 0.3s;
}

.topnav a:hover,
.topnav a.AfterScript:hover,
.topnav a.Highlighted {
  background-color: var(--text-colors);
  color: var(--dark-text);
}

.topnav a.BeforeScript:hover,
a.BeforeScript,
a.AfterScript {
  background-color: var(--divs-and-sections);
  color: var(--dark-text);
}

.topnav a.MLPHOVER:hover {
  background-color: var(--mlp-color);
}

#myList {
  align-items: center;
  justify-content: center;
  background-color: #2e3440;
  border-radius: var(--box-shape);
  box-shadow: 0 8px 16px 0 #0003;
  display: none;
  font-family: var(--font-bold-stack);
  min-width: 120px;
  max-width: 220px;
  height: 200px;
  overflow-y: scroll;
  position: absolute;
  margin-top: 1px;
  text-align: center;
  z-index: 1;
  padding: 6px;
}

#myList a {
  font-size: 18px;
  border-radius: var(--box-shape);
  text-align: center;
}

#listy {
  display: inline-block;
  font-family: var(--font-bold-stack);
  float: right;
}

.topnav input[type=text] {
  background-color: var(--background-and-accents);
  border-radius: var(--box-shape);
  color: var(--text-colors);
  padding: 6px;
  border: none;
  margin-top: 14px;
  margin-right: 40px;
  font-size: 17px;
  font-family: var(--font-primary-stack);
}

/* ==========================================================================
   Optimizations & Performance Improvements
   ========================================================================== */

/* Add missing fadein animation */
@keyframes fadein {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Improved transitions */
.topnav a,
.dropdown-content a,
.New22 {
  transition: all 0.3s ease;
}

/* Better font loading */
* {
  font-display: swap;
}

/* Improved accessibility */
.topnav a:focus,
.dropdown-content a:focus,
.dropbtn:focus {
  outline: 2px solid var(--text-colors);
  outline-offset: 2px;
}

/* Performance optimization for animations */
.loading::after,
.New22,
.CK {
  will-change: transform, opacity;
}

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

/* Critical CSS optimization for font loading */
.fonts-loading .topnav a,
.fonts-loading .Header,
.fonts-loading .MasterFoot,
.fonts-loading a.Head,
.fonts-loading a.LargeUpdate,
.fonts-loading .ExLarge,
.fonts-loading .BExLarge {
  font-family: var(--font-fallback);
}

/* ==========================================================================
   Responsive improvements
   ========================================================================== */
@media (max-width: 768px) {
  .topnav a {
    font-size: 120%;
    padding: 10px 12px;
  }

  #masterImages {
    width: 95%;
    max-width: 700px;
  }

  #description-wallets {
    width: 95%;
    max-width: 630px;
  }
}

@media (max-width: 480px) {
  .topnav a {
    font-size: 100%;
    padding: 8px 10px;
  }

  .New22 {
    width: 120px;
    height: 120px;
  }

  .CATEGORY {
    width: 150px;
    height: 275px;
  }
}
