html, body{
  height: auto;
  overflow: visible;
  overflow-x: hidden; /* กันการล้นแนวนอนของทั้งหน้า */
}

.shows-canvas{
  aspect-ratio: auto;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  padding-bottom: 4.5vw;
  background-attachment: fixed;
}
.nav__home{ color: var(--ink); }
.nav__home::after{ display: none; }
.nav{
  position: relative;
  height: auto;
  padding: 2.4vw 5.34vw 1.2vw;
}
.nav__home,
.nav__links{ transform: none; }

.shows-ornament{
  position: absolute;
  top: 0.9vw;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Cinzel', serif;
  font-size: 0.85vw;
  letter-spacing: 0.35em;
  color: var(--ink-dim);
  opacity: 0.55;
  z-index: 5;
  white-space: nowrap;
}

.shows-title{
  position: relative;
  z-index: 2;
  margin: 1vw 0 0 5.34vw;
  max-width: 22vw;
}
.shows-title__word{
  margin: 0;
  font-family: 'Pirata One', 'Cinzel', serif;
  font-size: 3.4vw;
  color: var(--ink);
  line-height: 0.9;
  text-shadow: 0 0 2vw rgba(255,255,255,0.15);
}
.shows-title__divider{
  display: flex;
  align-items: center;
  gap: 0.6vw;
  margin-top: 0.5vw;
}
.shows-title__divider span{
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(255,255,255,0.7), rgba(255,255,255,0));
}
.shows-title__divider i{
  font-style: normal;
  font-size: 0.75vw;
  color: var(--ink-dim);
}

.shows-tabs{
  position: relative;
  z-index: 2;
  display: flex;
  gap: 1vw;
  margin: 2vw 5.34vw 0;
}
.shows-tab{
  appearance: none;
  padding: 0.85vw 1.7vw;
  border-radius: 0.7vw;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(4px);
  font-family: 'Cinzel', serif;
  font-size: 0.95vw;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  transition: color .2s ease, border-color .2s ease;
}
.shows-tab:hover{ color: var(--ink); }
.shows-tab.is-active{ color: var(--ink); border-color: var(--accent); }

.shows-notice{
  position: relative;
  z-index: 2;
  margin: 1.2vw 5.34vw 0;
  padding: 0.75vw 1.2vw;
  border-radius: 0.7vw;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(4px);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85vw;
  color: var(--ink-dim);
}
.shows-notice.is-error{
  border-color: rgba(255,120,120,0.4);
  color: #ffd6d6;
  background: rgba(120,20,30,0.25);
}
.shows-notice.is-success{
  border-color: var(--accent);
  color: var(--ink);
  background: rgba(201,155,216,0.15);
}

.shows-grid{
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.4vw;
  margin: 2vw 5.34vw 0;
}
@media (max-width: 1100px){
  .shows-grid{ grid-template-columns: repeat(3, 1fr); }
}
.shows-grid[hidden]{ display: none; }

.shows-card{
  min-width: 0; /* สำคัญ: ให้ grid item หดได้จริง ไม่งั้นเนื้อหาข้างในจะดันกริดให้ล้นจอ */
  border: 1px solid var(--panel-border);
  border-radius: 1vw;
  background: var(--panel);
  backdrop-filter: blur(4px);
  padding: 1vw;
  display: flex;
  align-items: center;
  gap: 1vw;
  transition: border-color .25s ease;
}
.shows-card:hover{ border-color: var(--accent); }

.shows-card__image{
  width: 5.6vw;
  height: 5.6vw;
  min-width: 56px;
  min-height: 56px;
  flex-shrink: 0;
  border-radius: 0.7vw;
  background-color: rgba(255,255,255,0.06);
  background-size: cover;
  background-position: center;
}

.shows-card__body{
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6vw;
}
.shows-card__id{
  font-family: 'Cinzel', serif;
  font-size: 0.95vw;
  font-weight: 600;
  color: var(--accent);
}
.shows-card__name{
  font-family: 'Cinzel', serif;
  font-size: 0.95vw;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  word-break: break-word;
}

.shows-card__vote{
  appearance: none;
  align-self: flex-start;
  padding: 0.5vw 1.3vw;
  border-radius: 0.6vw;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(30, 26, 38, 0.65);
  color: var(--ink);
  font-family: 'Cinzel', serif;
  font-size: 0.85vw;
  letter-spacing: 0.02em;
  transition: background .2s ease, transform .2s ease, border-color .2s ease;
}
.shows-card__vote:hover:not(:disabled){
  background: rgba(50, 42, 62, 0.85);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.shows-card__vote:disabled{
  opacity: 0.45;
  cursor: not-allowed;
}
.shows-card__vote.is-voted{
  opacity: 1;
  color: var(--ink);
  border-color: var(--accent);
  background: rgba(201,155,216,0.2);
  cursor: default;
}
.shows-card__vote.is-excluded{
  opacity: 0.35;
  font-style: italic;
  background: rgba(255,255,255,0.03);
}

.stage-footnote{
  position: relative;
  z-index: 2;
  text-align: right;
  margin: 2vw 5.34vw 0;
  font-family: 'Poppins', sans-serif;
  font-size: 0.75vw;
  color: var(--ink-dim);
  opacity: 0.7;
}

@media (max-width: 760px){
  .shows-ornament{ display: none; }

  .nav{
    position: static;
    height: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 20px 20px 16px;
  }
  .nav__home{ font-size: 22px; }
  .nav__links{
    width: 100%;
    font-size: 14px;
    row-gap: 10px;
    column-gap: 18px;
    flex-wrap: wrap;
  }

  .shows-title{ margin: 8px auto 0; max-width: 480px; padding: 0 20px; }
  .shows-title__word{ font-size: clamp(38px, 13vw, 52px); }

  .shows-tabs{ margin: 20px 20px 0; gap: 10px; }
  .shows-tab{ flex: 1; padding: 12px 10px; font-size: 13px; text-align: center; }

  .shows-notice{ margin: 14px 20px 0; font-size: 13px; }

  .shows-grid{
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 18px 20px 0;
  }
  .shows-card{ padding: 12px; gap: 10px; flex-direction: column; align-items: stretch; text-align: center; }
  .shows-card__image{ width: 100%; height: auto; aspect-ratio: 1/1; min-width: 0; min-height: 0; }
  .shows-card__body{ align-items: center; }
  .shows-card__id{ font-size: 14px; }
  .shows-card__name{ font-size: 14px; }
  .shows-card__vote{ align-self: stretch; font-size: 13px; padding: 10px; }

  .stage-footnote{ text-align: center; margin: 20px 20px 0; font-size: 11px; }
}

@keyframes fadeUp{
  from{ opacity: 0; transform: translateY(2.4vw); }
  to{ opacity: 1; transform: translateY(0); }
}
.nav, .shows-title, .shows-tabs, .shows-grid{
  animation: fadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.shows-title{ animation-delay: 0.15s; }
.shows-tabs{ animation-delay: 0.3s; }
.shows-grid{ animation-delay: 0.4s; }

@media (max-width: 760px){
  @keyframes fadeUp{
    from{ opacity: 0; transform: translateY(24px); }
    to{ opacity: 1; transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce){
  *{ transition: none !important; animation: none !important; }
}