html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: #fff;
}

#main-container {
  width: 100%;
  max-width: 1280px;
  min-width: 320px;
  min-height: auto;
  margin: 0 auto;
  position: relative;
  background: #fff;
  overflow: hidden;
  z-index: 1;
  padding-bottom: 320px; 
}

#main-container::before,
#main-container::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1280px;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
  z-index: 0;
  display: block;
}

#main-container::before {
  top: 0;
  height: 15vw;
  max-height: 195px;
  min-height: 64px;
  background-image: url("../image/bg_top.png");
}

#main-container::after {
  bottom: 0;
  height: 22vw;
  max-height: 285px;
  min-height: 80px;
  background-image: url("../image/bg_bottom.png");
}

.title-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: min(200px, 16vw);
  margin-bottom: 40px;
}

.title-01 {
  width: 76vw;
  max-width: 968px;
  height: 6vw;
  max-height: 80px;
  min-width: 180px;
  min-height: 30px;
  background: url("../image/title_01.png") no-repeat center center / contain;
  margin-bottom: 20px;
  display: block;
}

.title-02 {
  width: 79vw;
  max-width: 1012px;
  height: 7vw;
  max-height: 94px;
  min-width: 180px;
  min-height: 30px;
  background: url("../image/title_02.png") no-repeat center center / contain;
  display: block;
}

.lead-message {
  width: 1000px;
  margin: 50px auto 0 auto;
  font-family: 'M PLUS 1p', 'Meiryo', 'Yu Gothic', sans-serif;
  font-weight: 800;
  font-size: 23px;
  color: #d70058;
  text-align: left;
  line-height: 1.7;
  text-shadow:
    -2px -2px 0 #fff,
    2px -2px 0 #fff,
    -2px 2px 0 #fff,
    2px 2px 0 #fff,
    0 2px 0 #fff,
    2px 0 0 #fff,
    0 -2px 0 #fff,
    -2px 0 0 #fff,
    0 4px 12px rgba(0,0,0,0.25);
  padding-left: 10px;
}

.character-list-area {
  width: 100%;
  max-width: 1050px;
  aspect-ratio: 1050 / 1150;
  margin: 0 auto;
  margin-top: 50px;
  background: url("../image/list_bg.jpg") center center / cover no-repeat;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.character-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  gap: 16px;
  width: 92%;
  height: 90%;
  align-items: center;
  justify-items: center;
  padding-top: 24px;
  padding-bottom: 24px;
}

.character-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.character-item img:not(.character-name-img) {
  width: 100%;
  max-width: 220px;
  height: auto;
  border-radius: 16px;
  display: block;
  cursor: pointer;
}

.character-item.selected img:not(.character-name-img) {
  outline: 8px solid #d70058;
  box-shadow: 0 0 30px #d70058cc;
  border-radius: 16px;
  z-index: 1;
  transition: box-shadow 0.2s, outline 0.2s;
  position: relative;
}

.character-name-img {
  width: 220px;
  height: 50px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.vote-period-wrap {
  text-align: center;
  margin: 32px 0 0 0;
}

.vote-period-main {
  font-weight: bold;
  font-size: 1.6rem;
  margin-bottom: 8px;
  letter-spacing: 1px;
}

.period-label {
  font-family: 'M PLUS 1p', 'Meiryo', 'Yu Gothic', sans-serif;
  font-size: 2rem;
  color: #d70058;
}

.period-dates {
  font-family: 'M PLUS 1p', 'Meiryo', 'Yu Gothic', sans-serif;
  font-size: 2rem;
  color: #b68c0c;
  margin-left: 8px;
}

.vote-period-note {
  font-size: 1rem;
  color: #666;
  margin-top: 0;
  font-weight: normal;
}

.vote-button-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 40px 0 0 0;
}

.vote-button-img {
  border: none;
  background: none;
  box-shadow: none;
  outline: none;
  padding: 0;
  margin: 0 auto;
  display: block;
  width: 458px;
  max-width: 90vw;
  height: auto;
  cursor: pointer;
  transition: filter 0.2s;
}

.vote-button-img:hover {
  filter: brightness(1.1) drop-shadow(0 0 8px #fcd);
}

.vote-button-img:active,
.vote-button-img:focus {
  outline: none;
  box-shadow: none;
}

#confirm-dialog {
  position: fixed;
  z-index: 9999;
  left: 0; top: 0; width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
}
.confirm-dialog-inner {
  background: #fff;
  border-radius: 18px;
  padding: 30px 24px;
  box-shadow: 0 2px 20px #0002;
  text-align: center;
  min-width: 260px;
}

.confirm-vote-btn,
.cancel-vote-btn {
  padding: 10px 32px;
  border-radius: 8px;
  border: none;
  margin: 0 10px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
}
.confirm-vote-btn { background: #d70058; color: #fff; }
.cancel-vote-btn { background: #aaa; color: #fff; }
.confirm-vote-btn:hover { background: #ee3377; }
.cancel-vote-btn:hover { background: #666; }

/* タブレット用 */
@media (max-width: 1024px) and (min-width: 601px) {
  #main-container {
    padding-bottom: 220px;
  }

  .title-wrap {
    margin-top: min(200px, 16vw);
    margin-bottom: 4vw;
  }

  .title-01 {
    width: 80vw;
    height: 7vw;
    max-width: none;
    max-height: none;
    margin-bottom: 4px;
  }

  .title-02 {
    width: 85vw;
    height: 8vw;
    max-width: none;
    max-height: none;
  }

  .lead-message {
    width: 82vw;
    font-size: 3vw;
    padding-left: 1vw;
  }

  .character-list-area {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
  }

  .character-list {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(6, 1fr);
    gap: 14px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .character-item img:not(.character-name-img) {
    max-width: 22vw;
    margin-bottom: 0px;
  }
  
  .character-name-img {
    width: 22vw;
  }

  .vote-button-img {
    width: 360px;
    max-width: 70vw;
  }

  .vote-button-wrap {
    margin-top: 32px;
  }
}

/* スマホ用 */
@media (max-width: 600px) {
  #main-container {
    padding-bottom: 140px;
  }

  .title-wrap {
    margin-top: min(200px, 16vw);
    margin-bottom: 6vw;
  }

  .title-01 {
    width: 95vw;
    height: 10vw;
    max-width: none;
    max-height: none;
    margin-bottom: 0px;
  }

  .title-02 {
    width: 99vw;
    height: 12vw;
    max-width: none;
    max-height: none;
  }

  .lead-message {
    width: 95vw;
    font-size: 4vw;
    padding-left: 2vw;
  }

  .character-list-area {
    aspect-ratio: auto;
    height: auto;
    min-height: 0;
  }

  .character-list {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 8px;
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .character-item img:not(.character-name-img) {
    max-width: 32vw;
    margin-bottom: 0px;
  }
  
  .character-name-img {
    width: 35vw;
  }

  .vote-period-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 8px;
  }
  .period-label {
    font-size: 1.2rem;
    color: #d70058;
  }
  .period-dates {
    font-size: 1.1rem;
    color: #b68c0c;
    margin-left: 0;
    margin-top: 2px;
  }

  .vote-button-img {
    width: 94vw;
    max-width: 440px;
  }

  .vote-button-wrap {
    margin-top: 20px;
  }
}

.vote-complete {
  text-align: center;
  padding: 48px 0 60px 0;
}

.vote-complete a {
  display: inline-block;
}

.vote-message {
  color: #d70058;
  font-weight: bold;
  font-size: 1.5em;
  text-shadow: 0 2px 8px #fff8, 0 0 2px #fdd;
  margin-bottom: 32px;
}

.vote-thanks-image {
  max-width: 1180px;
  width: 90vw;
  height: auto;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: 0 6px 32px #0002;
  display: block;
  transition: filter 0.22s cubic-bezier(.4,1.3,.7,1), transform 0.22s cubic-bezier(.4,1.3,.7,1);
}

.vote-thanks-image:hover {
  filter: brightness(1.18) drop-shadow(0 0 20px #fff3);
  transform: scale(1.04);
  cursor: pointer;
}
