@import url('https://fonts.googleapis.com/css2?family=DotGothic16&family=Itim&family=Klee+One:wght@600&family=Mali:wght@500&family=Nunito:wght@700&display=swap');

::selection {
  background: #d95300;
  color: #ffffff;
}

body.night-theme ::selection {
  background: #3b82f6;
}

::-moz-selection {
  background: #d95300;
  color: #ffffff;
}

body.night-theme ::-moz-selection {
  background: #3b82f6;
}

@font-face {
  font-family: 'MSGothicWeb';
  src: local('MS Gothic'), local('MS PGothic'), url('../fonts/MS Gothic.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

body, button, input, textarea, select {
  font-family: 'MSGothicWeb', "MS Gothic", "MS PGothic", "Osaka", "MS UI Gothic", "Tahoma", "Verdana", sans-serif !important;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: grayscale;
  font-smooth: never;
  text-rendering: optimizeSpeed;
}

html {
  height: 100vh;
  overflow: hidden;
  cursor: url('../assets/hatchet.webp'), default !important;

  @media (max-width: 900px) {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
  }
}

*, *:hover, *:active, *:focus, *:focus-within {
  cursor: url('../assets/hatchet.webp'), default !important;
}

body {
  height: 100vh;
  overflow: hidden;
  background-image: url('../assets/bg-sky.avif');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  margin: 0;
  padding: 0;
  color: #e2e8f0;

  @media (max-width: 900px) {
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100vh;
  }

  &.night-theme {
    color: #e2e8f0;
    background-image: url('../assets/bg-rika.avif');
  }
}

#container {
  width: 850px;
  margin: 0 auto;
  height: 100vh;
  background-color: rgba(42, 20, 8, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(251, 146, 60, 0.22);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  background-image: none;
  display: flex;
  flex-direction: column;

  @media (max-width: 900px) {
    width: 100%;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  body.night-theme & {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background-color: rgba(10, 15, 30, 0.7);
  }
}

#lone-container {
  body.night-theme & {
    background: linear-gradient(135deg, rgba(15, 20, 35, 0.6) 0%, rgba(5, 10, 20, 0.8) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(255, 255, 255, 0.05);
    border-radius: 0;
  }
}

#banner {
  height: 180px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;

  &::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('../banner/header.avif');
    background-size: cover;
    background-position: center;
    opacity: 0.15;
    z-index: 1;
  }

  &::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: url('../banner/rena-header-top.avif');
    background-size: cover;
    background-position: center;
    opacity: 1;
    z-index: 2;
  }

  body.night-theme &::after {
    background-image: url('../banner/rika-header-top.avif');
  }

  @media (max-width: 600px) {
    height: 120px;
  }

  @media (max-height: 850px) {
    height: 140px !important;
  }
}

#banner-text {
  position: relative;
  z-index: 3;
  padding-left: 30px;
  background: linear-gradient(90deg, rgba(42, 20, 8, 0.94) 0%, rgba(42, 20, 8, 0) 100%);
  padding-right: 20px;
  border-radius: 0 10px 10px 0;

  body.night-theme & {
    background: linear-gradient(90deg, rgba(10, 15, 30, 0.9) 0%, rgba(10, 15, 30, 0) 100%);
  }

  & h1 {
    font-family: 'Nunito', sans-serif !important;
    font-size: 34px;
    margin: 0;
    letter-spacing: 2px;
    text-transform: lowercase;
    color: #fb923c;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8);

    body.night-theme & {
      color: #93c5fd;
    }

    @media (max-width: 600px) {
      font-size: 22px;
    }

    @media (max-height: 850px) {
      font-size: 28px !important;
    }
  }
}

#flex-wrapper {
  display: flex;
  padding: 20px;
  gap: 20px;
  flex: 1;
  min-height: 0;

  @media (max-width: 900px) {
    height: auto !important;
    min-height: 0 !important;
  }

  @media (max-width: 600px) {
    flex-direction: column;
    padding: 10px;
    gap: 10px;
  }

  @media (max-height: 850px) {
    padding: 10px 20px !important;
    gap: 12px !important;
  }
}

#sidebar {
  width: 170px;
  flex-shrink: 0;

  @media (max-width: 600px) {
    width: 100%;
  }
}

.nav-title, .box-header {
  background: linear-gradient(180deg, #d97706 0%, #b45309 40%, #7c2d12 100%);
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 -1px 0 rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid #d97706;

  body.night-theme & {
    background: linear-gradient(180deg, #1e3a8a 0%, #172554 40%, #0f172a 100%);
    border-bottom: 1px solid #1e3a8a;
    color: #e2e8f0;
  }
}

.box-header {
  padding: 5px 10px;
  font-size: 14px;
}

.nav-item {
  display: block;
  border: 1px solid rgba(249, 115, 22, 0.45);
  border-top: none;
  padding: 8px;
  text-decoration: none;
  color: #fb923c;
  font-size: 13px;
  background-color: rgba(54, 32, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: 0.1s;

  &:hover {
    background-color: #ea580c;
    color: #ffffff;
    padding-left: 12px;
  }

  body.night-theme & {
    border-color: #3b82f6;
    color: #93c5fd;
    background-color: rgba(30, 41, 59, 0.6);

    &:hover {
      background-color: #3b82f6;
      color: #ffffff;
    }
  }

  @media (max-width: 600px) {
    padding: 10px 8px;
    font-size: 14px;
  }
}

#profile-box {
  margin-top: 20px;
  border: 1px dashed rgba(249, 115, 22, 0.45);
  padding: 10px;
  min-height: 80px;
  background: rgba(54, 32, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;

  & img {
    width: 80px;
    height: 28px;
    display: block;
  }

  body.night-theme & {
    border-color: #3b82f6;
  }

  @media (max-width: 600px) {
    min-height: auto;
  }

  @media (max-height: 850px) {
    margin-top: 10px !important;
  }
}

#main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;

  @media (max-width: 900px) {
    height: auto !important;
  }
}

.welcome-box, .entry {
  border: 1px solid rgba(251, 146, 60, 0.2);
  margin-bottom: 20px;
  background: rgba(54, 32, 18, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);

  body.night-theme & {
    border-color: #3b82f6;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.welcome-box {
  flex-shrink: 0;
  
  body.night-theme & form {
    border-top-color: #3b82f6 !important;
  }

  @media (max-height: 850px) {
    margin-bottom: 10px !important;
  }
}

.entry {
  margin-bottom: 8px;

  @media (max-height: 850px) {
    margin-bottom: 6px !important;
  }
}

.box-body {
  padding: 15px;
  font-size: 13px;
  line-height: 1.6;
  text-align: justify;
  color: #e2e8f0;

  @media (max-width: 600px) {
    font-size: 12px;
    padding: 10px;
  }

  @media (max-height: 850px) {
    padding: 8px 12px !important;
  }
}

.reading-box, .contact-box {
  & .box-body {
    padding: 5px 15px;

    @media (max-height: 850px) {
      padding: 4px 12px !important;
    }
  }

  & p {
    margin: 5px 0;
  }

  & a, & a:visited {
    color: #fb923c;
    text-decoration: underline;

    body.night-theme & {
      color: #60a5fa;
    }
  }
}

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  background: rgba(42, 20, 8, 0.65);
  padding: 4px 12px;
  border-bottom: 1px solid rgba(249, 115, 22, 0.45);

  body.night-theme & {
    background: rgba(15, 23, 42, 0.6);
    border-bottom-color: #3b82f6;
  }

  @media (max-width: 600px) {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

.entry-meta {
  font-size: 11px;
  color: #fb923c;

  body.night-theme & {
    color: #93c5fd;
  }
}

.entry-title {
  font-size: 14px;
  margin: 0;
  font-weight: bold;
  color: #fb923c;

  body.night-theme & {
    color: #93c5fd;
  }

  @media (max-width: 600px) {
    font-size: 14px;
  }
}

.entry-body {
  padding: 6px 12px;
  line-height: 1.4;
  color: #e2e8f0;
  font-size: 13px;
  text-align: justify;

  & p {
    margin: 0 0 4px 0;

    &:last-child {
      margin-bottom: 0;
    }
  }
}

#footer {
  border-top: 1px solid #7c2d12;
  padding: 10px 20px;
  font-size: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'DotGothic16', sans-serif !important;
  flex-shrink: 0;
  color: #a8a29e;

  & a {
    color: #fb923c;
    text-decoration: none;
    font-weight: bold;
    font-family: 'DotGothic16', sans-serif !important;

    body.night-theme & {
      color: #60a5fa;
    }
  }

  body.night-theme & {
    border-top-color: #3b82f6;
    color: #94a3b8;
  }

  @media (max-width: 600px) {
    flex-direction: column;
    text-align: center;
    gap: 4px;
    font-size: 9px;
  }
}

.debian-red {
  color: #ef4444 !important;
}

#scrobble-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 15px;

  @media (max-width: 600px) {
    flex-direction: column;
    align-items: flex-start;
  }
}

#scrobble-text {
  flex: 1;

  & p {
    margin: 0;
  }
}

#scrobble-art {
  width: 64px;
  height: 64px;
  border: 1px solid #ea580c;
  box-shadow: 2px 2px 0px rgba(234, 88, 12, 0.15);

  body.night-theme & {
    border-color: #3b82f6;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
  }

  @media (max-width: 600px) {
    width: 48px;
    height: 48px;
  }
}

#reading-cover {
  width: 54px;
  height: 72px;
  object-fit: cover;
  border: 1px solid #ea580c;
  box-shadow: 2px 2px 0px rgba(234, 88, 12, 0.15);

  body.night-theme & {
    border-color: #3b82f6;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
  }

  @media (max-height: 850px) {
    display: none !important;
  }
}

#scrobble-history {
  border-top: 1px dashed #ea580c;
  padding-top: 8px;
  margin-top: 4px;
  width: 100%;

  body.night-theme & {
    border-top-color: #3b82f6;
  }
}

.scrobble-history-header {
  font-size: 10px;
  font-weight: bold;
  text-transform: lowercase;
  color: #fb923c;
  margin-bottom: 5px;
  letter-spacing: 0.5px;

  body.night-theme & {
    color: #93c5fd;
  }
}

#scrobble-history-list {
  margin: 0;
  padding: 0 0 0 15px;
  font-size: 11px;
  line-height: 1.4;
  color: #e2e8f0;
}

#gb-submit {
  background: linear-gradient(180deg, #f97316 0%, #ea580c 100%) !important;
  color: white !important;
  border: 1px solid #c2410c !important;
  text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.1);
  cursor: pointer;

  &:hover {
    background: linear-gradient(180deg, #ea580c 0%, #c2410c 100%) !important;
  }

  body.night-theme & {
    background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%) !important;
    border-color: #172554 !important;

    &:hover {
      background: linear-gradient(180deg, #172554 0%, #020617 100%) !important;
    }
  }
}

#counter-box {
  margin-top: 20px;
  border: 1px dashed rgba(249, 115, 22, 0.45);
  padding: 10px;
  background: rgba(54, 32, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;

  body.night-theme & {
    border-color: #3b82f6;
    background: rgba(30, 41, 59, 0.6);
  }

  @media (max-width: 600px) {
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
  }

  @media (max-height: 850px) {
    margin-top: 10px !important;
  }
}

#theme-toggle, #dashboard-button {
  border: 1px dashed rgba(249, 115, 22, 0.45);
  padding: 8px;
  background: rgba(54, 32, 18, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  text-align: center;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.1s;
  display: block;
  text-decoration: none;
  color: #fb923c;

  &:hover {
    background: rgba(234, 88, 12, 0.4);
    transform: translateY(-1px);
    color: #ffffff;
  }

  &:active {
    transform: translateY(1px);
  }

  body.night-theme & {
    border-color: #3b82f6;
    background: rgba(30, 41, 59, 0.6);
    color: #93c5fd;

    &:hover {
      background: rgba(59, 130, 246, 0.2);
      color: #93c5fd;
    }
  }
}

#theme-toggle {
  margin-top: 15px;

  @media (max-height: 850px) {
    margin-top: 10px !important;
  }
}

#dashboard-button {
  margin-top: 10px;
}

.counter-title {
  font-size: 10px;
  font-weight: bold;
  color: #fb923c;
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 1px;

  body.night-theme & {
    color: #93c5fd;
  }
}

.counter-sub {
  body.night-theme & {
    color: #93c5fd;
  }
}

#hit-count {
  font-family: 'Itim', cursive !important;
  background: #1b0d04;
  color: #fb923c;
  font-size: 18px;
  font-weight: bold;
  padding: 4px 10px;
  border: 2px solid rgba(249, 115, 22, 0.55);
  border-radius: 8px;
  letter-spacing: 3px;
  display: inline-block;
  box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5);

  body.night-theme & {
    background: #020617;
    color: #60a5fa;
    border-color: #3b82f6;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
  }
}

#button-zone {
  width: 100%;
  text-align: center;
  padding: 15px 0;
  box-sizing: border-box;
  clear: both;

  & a {
    display: inline-block;
    margin: 0 4px;
  }

  & img {
    width: 88px;
    height: 31px;
    image-rendering: pixelated;
    border: 1px solid #ea580c;
    transition: opacity 0.2s;

    &:hover {
      opacity: 0.8;
    }

    body.night-theme & {
      border-color: #3b82f6;
    }

    @media (max-width: 600px) {
      width: 66px;
      height: 23px;
    }
  }
}

#dashboard-link {
  text-align: center;
  padding: 6px;
  font-size: 11px;

  & a {
    color: #d95300;
    text-decoration: none;
    opacity: 0.4;

    &:hover {
      opacity: 1;
    }

    body.night-theme & {
      color: #94a3b8;
    }
  }
}

#entries-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;

  @media (max-width: 900px) {
    overflow: visible !important;
  }
}

.moe-deco {
  color: #d95300;
  text-decoration: none;

  &:hover {
    text-decoration: underline;
  }

  body.night-theme & {
    color: #60a5fa;
  }
}

#gb-name, #gb-message {
  background-color: rgba(54, 32, 18, 0.85) !important;
  color: #e2e8f0 !important;

  body.night-theme & {
    border-color: #3b82f6 !important;
    background-color: rgba(15, 23, 42, 0.85) !important;
    color: #e2e8f0 !important;
  }

  @media (max-width: 600px) {
    font-size: 16px;
  }
}

.passkey-btn {
  body.night-theme & {
    background: rgba(30, 58, 138, 0.6) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;

    &:hover {
      background: #3b82f6 !important;
      color: #ffffff !important;
    }
  }
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin: 6px 0 0 0;
  clear: both;

  & a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-width: 24px;
    height: 24px;
    font-size: 11px;
    font-weight: bold;
    text-decoration: none;
    background: linear-gradient(180deg, #ffffff 0%, #fffdfa 100%);
    color: #ea580c;
    border: 1px solid #ea580c;
    box-shadow: 2px 2px 0px rgba(234, 88, 12, 0.15);
    transition: all 0.1s;

    &:hover, &.active {
      background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
      color: #ffffff;
      text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
    }

    &:active {
      transform: translate(1px, 1px);
      box-shadow: 1px 1px 0px rgba(234, 88, 12, 0.15);
    }

    body.night-theme & {
      background: rgba(30, 41, 59, 0.85);
      color: #93c5fd;
      border-color: #3b82f6;
      box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);

      &:hover, &.active {
        background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%);
        color: #ffffff;
      }

      &:active {
        transform: translate(1px, 1px);
        box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.4);
      }
    }

    @media (max-width: 600px) {
      font-size: 13px;
      padding: 4px 8px;
    }
  }
}

.stats-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  overflow-x: auto;
  padding: 5px;

  & pre {
    font-family: "Courier New", Courier, monospace !important;
    font-size: 12px;
    line-height: 1.2;
    margin: 0;
    white-space: pre;
    cursor: text !important;
  }
}

#debian-ascii {
  font-weight: bold;
}

#neofetch-stats {
  body.night-theme & {
    color: #e2e8f0;
  }
}

.recipe-thumbnail {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #d95300;
  box-shadow: 2px 2px 0px rgba(217, 83, 0, 0.2);
  display: block;
  flex-shrink: 0;

  body.night-theme & {
    border-color: #3b82f6;
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.4);
  }
}

.recipe-thumbnail-placeholder {
  width: 80px;
  height: 80px;
  border: 1px dashed #d95300;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #d95300;
  background-color: rgba(217, 83, 0, 0.05);
  flex-shrink: 0;

  body.night-theme & {
    border-color: #003366;
    color: #003366;
    background-color: rgba(0, 51, 102, 0.05);
  }
}