@media (max-width: 900px) {
  .content-grid {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
  }

  .main-content {
    order: 1;
  }

  .sidebar-right .player {
    order: 2;
  }

  .sidebar-left .field-notes {
    order: 3;
  }

  .sidebar-left .poll-block {
    order: 4;
  }

  .sidebar-left .block:has(#collection) {
    order: 5;
  }

  .sidebar-right .guestbook {
    order: 6;
  }

  .sidebar {
    display: contents;
  }

  .block {
    width: 100%;
  }

  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    text-align: left;
  }

  .logo {
    justify-content: flex-start;
  }

  .nav-divider-large {
    display: none;
  }

  .nav {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .nav-divider,
  .nav-divider-large {
    border-color: transparent;
    background-color: transparent;
  }

  .nav-list {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .theme-switch {
    width: 100%;
    margin-top: 0.4rem;
  }

  .banner-img {
    margin-bottom: 1rem;
    border-width: 4px;
  }

  .page-title {
    font-size: 1.4rem;
  }

  .block {
    padding: 0.8rem;
  }

  p {
    font-size: 0.9rem;
  }

  .footer .max-width {
    flex-direction: column;
    gap: 0.8rem;
    text-align: center;
  }

  #collection {
    height: auto;
    max-height: none;
    padding: 0.6rem;
  }

  .player-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    position: relative;
    margin: 0.8rem auto;
  }

  .tv-wrapper {
    position: relative;
    width: 110px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .tv-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 10;
    pointer-events: none;
  }

  .tv-screen {
    position: relative;
    width: 78%;
    height: 60%;
    background: #111;
    border: 2px inset var(--primary);
    z-index: 5;
    overflow: hidden;
  }

  .tv-screen iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }
}

@media (max-width: 600px) {
  .header {
    padding: 0.6rem 1rem;
  }

  .logo-img {
    width: 36px;
    height: 36px;
  }

  .nav-list a {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .theme-switch select {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
  }

  .main-frame {
    padding: 0.8rem 1rem 1.2rem;
  }

  .block {
    padding: 0.9rem;
  }

  .banner-img {
    margin-bottom: 0.8rem;
  }

  .tv-wrapper {
    width: 100px;
    height: 72px;
  }

  .tv-screen {
    width: 78%;
    height: 60%;
  }

  .controls button {
    padding: 0.4rem 0.6rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 420px) {
  .header {
    align-items: center;
    text-align: center;
  }

  .logo {
    flex-direction: column;
    align-items: center;
  }

  .nav {
    flex-direction: column;
    align-items: center;
  }

  .nav-list {
    justify-content: center;
    text-align: center;
  }

  .nav-list li {
    width: 100%;
    text-align: center;
  }

  .page-title {
    font-size: 1.2rem;
  }

  .theme-switch {
    justify-content: center;
  }

  .block-title {
    font-size: 0.9rem;
    text-align: center;
  }

  p,
  p.highlight {
    font-size: 0.88rem;
  }

  .footer .max-width {
    gap: 0.5rem;
    text-align: center;
  }

  .tv-wrapper {
    width: 90px;
    height: 65px;
  }

  .tv-screen {
    width: 78%;
    height: 60%;
  }

  .controls button {
    padding: 0.3rem 0.5rem;
  }

  #collection {
    padding: 0.4rem;
  }
}
