@media (min-width: 480px) {
  h1 {
    font-size: 2.2rem;
  }
  .button {
    min-width: 260px;
  }
  .board {
    width: min(80vw, 80vh, 500px);
  }
  .info {
    font-size: 1rem;
  }
  .sub-info {
    font-size: 0.88rem;
  }
  #room-code {
    font-size: 2rem;
  }
  .room-code-qr {
    width: 188px;
    height: 188px;
  }
  .room-code-qr img,
  .room-code-qr canvas {
    width: 168px !important;
    height: 168px !important;
  }
}

@media (min-width: 768px) {
  h1 {
    font-size: 3rem;
  }
  .board {
    width: min(75vw, 75vh, 520px);
  }
  .info {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  .button {
    font-size: 0.88rem;
    padding: 0.75rem 1.4rem;
    min-width: 200px;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  h1 {
    font-size: 1.3rem;
    margin-bottom: 8px;
  }
  .page {
    padding: 10px 20px;
  }
  .button {
    padding: 0.7rem 1.2rem;
    margin: 4px;
    font-size: 0.85rem;
    min-width: 0;
    flex: 1 1 auto;
  }
  .button-container {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0.5rem 0 0 0;
    width: 100%;
    max-width: 560px;
  }
  .credits-container {
    bottom: 6px;
    font-size: 0.72rem;
  }
  .board {
    width: min(72vh, 72vw);
  }
  .game-inner {
    padding: 6px 12px;
  }
  .info {
    margin: 4px 0 2px;
    font-size: 0.9rem;
  }
  .room-code-card {
    padding: 12px 20px;
    min-height: auto;
    gap: 8px;
  }
  .room-code-qr {
    width: clamp(100px, 25vh, 150px);
    height: clamp(100px, 25vh, 150px);
    margin: 6px auto;
  }
  .room-code-qr img,
  .room-code-qr canvas {
    width: clamp(80px, calc(25vh - 20px), 130px) !important;
    height: clamp(80px, calc(25vh - 20px), 130px) !important;
  }
  .create-share-row {
    gap: 6px;
  }
  .create-share-row .secondary-button {
    font-size: 0.8rem;
    padding: 0.5rem 0.9rem;
  }
}

@media (min-width: 600px) {
  .qr-scanner-overlay {
    align-items: center;
  }
  .qr-scanner-inner {
    border-radius: 28px;
    max-width: 400px;
    padding: 32px 32px 36px;
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    transition: transform 0.32s cubic-bezier(0.33, 1, 0.68, 1), opacity 0.32s ease;
  }
  .qr-scanner-overlay-visible .qr-scanner-inner {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}