
body {
  margin: 0;
  background: #f0f9f0;
  font-family: "Segoe UI", sans-serif;
  padding: 0;
}

ul {
  padding-left: 0;
}

li {
  list-style: none;
}
div,button,a {
  -webkit-tap-highlight-color: transparent; 
  outline: 0;
  background: transparent;
}

#background {
  position: absolute;
  
  left: 0px;
  right: 0px;
  width: calc(100%);
  height: calc(100%);
  background-size: cover;
  background-repeat: no-repeat;
  background-image: url(../img/page_bg.webp);
  margin: auto;
  background-position: center center;
}
@media screen and (max-width: 1024px) {
#background {
    background-image: url(../img/page_bg_sp.webp);
  }
}


#background.ios-composite {
  will-change: transform;
  transform: translateZ(0.001px);
  backface-visibility: hidden;
}


.title-logo-bg {
  position: absolute;
  right: 25px;
  top: 25px;
  width: 15%;
}

.version-text {
  position: absolute;
  bottom: 10px;
  right: 10px;
  color: #fff;
}


#wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  
  height: calc(var(--vh, 1vh) * 100);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}


@supports (height: 100dvh) {
  #wrapper {
    height: 100dvh;
  }
}

#game-container {
  background: #fff8e6;
  border-radius: 10px;
  box-shadow: 0 0px 24px rgb(255 44 247);
  
  width: 550px;
  height: 850px;
  
  position: absolute;
}
#reselect-gender-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    border: 0;
    cursor: pointer;
    z-index: 999;
}

#reselect-gender-btn img {
  width: auto;
}

.gender-dialog{
  width: 420px;
  max-width: calc(100vw - 32px);
}

.gender-close{
  position:absolute; inset: 8px 8px auto auto;
  width: 28px; height: 28px;
  display:none;          
}

#character {
  position: relative;
  width: 100%;
  
  
  aspect-ratio: 308 / 195;
  border-radius: 10px;
  overflow: hidden;
}


#character img:not([src]),
#character img[src=""] {
  display: none;
}

#character img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.character-copyright {
  margin-left: -5px;
}


#overlay-text-hira1 {
  position: absolute;
  z-index: 5;
  top: 21%;
  right: 21.5%;
}

#overlay-text-hira2 {
  position: absolute;
  z-index: 5;
  top: 34.5%;
  right: 34%;
}


.truck-hira-font {
  font-size: 24px;
}


#text-warning-hira1,
#text-warning-hira2 {
  color: red;
  font-weight: bold;
  min-height: 1em;
  visibility: hidden;
}


#text-hira1,
#text-hira2 {
  width: 70%;
  box-sizing: border-box;
  border: 2px solid #aaa;
  padding: 6px;
  font-size: 26px;
}

#overlay-text-alp,
#overlay-text-kana {
  position: absolute;
  text-align: right;
  font-family: "Noto Sans JP", system-ui, sans-serif;
  z-index: 5;
  pointer-events: none;
  
  letter-spacing: 0.05em;
  line-height: 1;
  white-space: nowrap;
  font-kerning: none;
}

#overlay-text-alp {
  position: absolute;
  z-index: 5;
  top: 50%;
  right: 7%;
}

#overlay-text-kana {
  position: absolute;
  z-index: 5;
  right: 19%;
  bottom: 25%;
}


.glyph-line {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  
  --glyph-size: 36px; 
  --glyph-overlap: -6px; 
  position: relative;
}


.glyph-line .glyph + .glyph {
  margin-left: var(--glyph-overlap);
}

.glyph-line .glyph {
  position: relative; 
  z-index: 0;
}


.glyph-line img.glyph {
  height: var(--glyph-size, 65px);
  width: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
}


#part-lists {
  position: relative;
  height: 60px;
  margin: 10px 30px;
  padding: 5px 0px 0px;
  background-color: #ffd1f9;
  border-radius: 50px;
}


#controls {
  text-align: center;
}

.input-wrapper {
  margin: 10px auto;
}

#text-overlay-alp,
#text-overlay-kana {
  width: 70%;
  box-sizing: border-box;
  border: 2px solid #aaa;
  padding: 6px;
  font-size: 26px;
}
#text-overlay-kana {
  margin-top: 56px;
}

#text-warning-alp,
#text-warning-kana {
  color: red;
  font-weight: bold;
  min-height: 1em;
  visibility: hidden;
}

#text-warning-hira1,
#text-warning-hira2,
#text-warning-alp,
#text-warning-kana {
  flex: 1 1 auto;
  min-height: 1.2em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  visibility: hidden;
  margin: 0;
}

.button-container {
  position: absolute;
  bottom: 0;
}

#generate-image,
#reset-button {
  padding: 6px 12px;
  margin: 5px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
}

#generate-image {
  font-size: 75px;
  background: #ffd30f;
  width: 79%;
  margin: 16px auto;
  border-radius: 50px;
}

#reset-button {
  font-size: 20px;
  background: #ccc;
}

.modal-content {
  background: #fff8e6;
  margin: auto;
  width: 550px;
  height: 850px;
  border-radius: 10px;
  text-align: center;
  position: relative;
}

#char-copyright {
  width: 70%;
  position: absolute;
  top: 16%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
}

.trucc-copyright {
  width: 100%;
  top: 50%;
  z-index: 6;
  position: absolute;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
}

.truck-sample-img,
.on-truck-face-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
}

.truck-sample-img {
  z-index: 1;
  width: 480px;
}

.on-truck-face-image {
  z-index: 3;
  width: 255px;
  top: -18px;
  left: 205px;
}

.truck-content-img-wrapper {
  position: relative;
  width: 95%;
  margin: auto;
  aspect-ratio: 16 / 9;
}

.truckc-truck-image {
  position: relative !important; 
  display: block;
  width: 100% !important; 
  height: auto;
  transform: none !important;
  left: auto !important;
  top: auto !important;
  z-index: 2;
}

.truckc-motto-image {
  position: absolute;
  right: var(--motto-right, 27%);
  top: var(--motto-top, 25%);
  transform: translate(calc(-100% - var(--motto-gap, -68px)), -50%);
  width: clamp(65px, 11%, 140px);
  pointer-events: none;
  z-index: 9999;
}

.truckc-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none !important;
  z-index: 0;
}

.truckc-face-image {
  z-index: 3;
  top: 47%;
  left: 36.8%;
  width: 63%;
}

.truck-text {
  position: absolute; 
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #fff; 
  line-height: 1;
  white-space: nowrap; 
  z-index: 5; 
  
  -webkit-text-stroke: 6px #9e0071; 
  text-stroke: 6px #9e0071;
  paint-order: stroke fill; 
}
.font-transparent {
  color: transparent !important;
  -webkit-text-stroke: 0 transparent !important;
  text-stroke: 0 transparent !important;
  text-shadow: none !important;
}


@supports not (-webkit-text-stroke: 1px black) {
  .truck-text {
    
    text-shadow:
      0 0 1px #9e0071,
      0 0 2px #9e0071,
      0 1px 0 #9e0071,
      0 -1px 0 #9e0071,
      1px 0 0 #9e0071,
      -1px 0 0 #9e0071,
      1px 1px 0 #9e0071,
      -1px 1px 0 #9e0071,
      1px -1px 0 #9e0071,
      -1px -1px 0 #9e0071,
      2px 0 0 #9e0071,
      -2px 0 0 #9e0071,
      0 2px 0 #9e0071,
      0 -2px 0 #9e0071;
  }
}


.truck-alp-font {
  font-size: 48px;
}


.truck-kana-font {
  font-size: 32px;
}


#overlap-modal {
  width: 550px;
  height: 850px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
}

#loading-screen .loading-screen-wrapper{
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

#loading-screen {
  position: fixed !important;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: #fff;
  pointer-events: auto;
}
#loading-screen .lock-message{
  position: static !important;
  inset: auto !important;
  transform: none !important;
  margin: 0 !important;
}
#loading-screen .loading-text{
  max-width: min(80vw, 200px);
  height: auto;
  margin-bottom: 20px;
}
#loading-screen.is-scoped {
  position: absolute;
  inset: 0;
  z-index: 1000;
}


#loading-screen,
#loading-screen.is-scoped {
  pointer-events: auto;
}

#loading-screen[data-lock="1"]{
  display: grid !important;      
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #f362ec;
  border-top-color: #fd98df;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

#loading-progress{
  font-weight: 600;
  color: #fff;
  font-size: 30px;
  line-height: 1.4;
  letter-spacing: .02em;

  
  -webkit-text-stroke: 2px #eb37be;
  text-stroke: 2px #eb37be;
  paint-order: stroke fill;

}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}



#_opshield{
  position: fixed; inset: 0;
  background: rgba(255, 255, 255, 0.35);
  z-index: 999999;            
  display: none;
  pointer-events: auto;       
}
#_opshield.show{ display:block }
#_opshield::after{
  content:"";
  position:absolute; left:50%; top:50%;
  width:48px; height:48px; margin:-24px 0 0 -24px;
  border:4px solid #f362ec;
  border-top-color: #fd98df;
  border-radius:50%;
  animation: _spin 1s linear infinite;
}
@keyframes _spin{ to{ transform: rotate(360deg); } }



#color-buttons.color-rail {
  position: absolute;
  left: 8px;
  bottom: 16px;
  width: 45px; 
  flex-direction: column; 
  align-items: center;
  gap: 6px;
  z-index: 10;
  background-color: #ffffffdb;
  border-radius: 25px;
  padding: 0 4px;
  
  display: none;
}


#color-buttons .vscroll-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  height: 28px;
}

#color-buttons .vscroll-btn img {
  width: 60%;
  height: auto;
  position: static;
  object-fit: contain;
  pointer-events: none;
}


#color-buttons .vscroll-wrapper {
  width: 100%;
  height: 260px; 
  overflow-y: auto; 
  scroll-behavior: smooth; 
  -webkit-overflow-scrolling: touch; 
  scroll-snap-type: y proximity; 
  
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}

#color-buttons .vscroll-wrapper::-webkit-scrollbar {
  display: none; 
}

#color-buttons .color-items {
  display: flex;
  flex-direction: column; 
  gap: 6px;
  padding: 2px 3px;
}


#color-buttons .color-btn {
  all: unset;
  display: grid;
  place-items: center;
  width: 40px; 
  height: 40px;
  border-radius: 50%;
  position: relative; 
  cursor: pointer;
  box-sizing: border-box;
}


#color-buttons .color-btn.selected::after {
  content: "";
  position: absolute;
  inset: 0; 
  border-radius: 50%;
  box-shadow: 0 0 0 3px #ff0000cf; 
  pointer-events: none;
}


#color-buttons .color-btn:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}


#color-buttons .color-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  border-radius: 50%; 
  display: block;
  position: static;
}


#eyebrow-color-buttons.color-rail {
  position: absolute;
  left: 8px;
  bottom: 16px;
  width: 45px; 
  flex-direction: column; 
  align-items: center;
  gap: 6px;
  z-index: 10;
  background-color: #ffffffdb;
  border-radius: 25px;
  padding: 0 4px;
  display: none;
}

#eyebrow-color-buttons .vscroll-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  height: 28px;
}
#eyebrow-color-buttons .vscroll-btn img {
  width: 60%;
  height: auto;
  position: static;
  object-fit: contain;
  pointer-events: none;
}

#eyebrow-color-buttons .vscroll-wrapper {
  width: 100%;
  height: 260px; 
  overflow-y: auto; 
  scroll-behavior: smooth; 
  -webkit-overflow-scrolling: touch; 
  scroll-snap-type: y proximity; 
  
  scrollbar-width: none; 
  -ms-overflow-style: none; 
}
#eyebrow-color-buttons .vscroll-wrapper::-webkit-scrollbar {
  display: none; 
}
#eyebrow-color-buttons .color-items {
  display: flex;
  flex-direction: column; 
  gap: 6px;
  padding: 2px 3px;
}

#eyebrow-color-buttons .color-btn {
  all: unset;
  display: grid;
  place-items: center;
  width: 40px; 
  height: 40px;
  border-radius: 50%;
  position: relative; 
  cursor: pointer;
  box-sizing: border-box;
}

#eyebrow-color-buttons .color-btn.selected::after {
  content: "";
  position: absolute;
  inset: 0; 
  border-radius: 50%;
  box-shadow: 0 0 0 3px #ff0000cf; 
  pointer-events: none;
}

#eyebrow-color-buttons .color-btn:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}

#eyebrow-color-buttons .color-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  border-radius: 50%; 
  display: block;
  position: static;
}


#truck-color-buttons.color-rail {
  position: absolute;
  left: 4px;
  bottom: 16px;
  width: 42px; 
  flex-direction: column; 
  align-items: center;
  gap: 6px;
  z-index: 10;
  background-color: #ffffffdb;
  border-radius: 25px;
  padding: 0 4px;
}

#truck-color-buttons .vscroll-btn {
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  height: 28px;
}
#truck-color-buttons .vscroll-btn img {
  width: 60%;
  height: auto;
  position: static;
  object-fit: contain;
  pointer-events: none;
}

#truck-color-buttons .vscroll-wrapper {
  width: 100%;
  height: 210px; 
  overflow-y: auto; 
  scroll-behavior: smooth; 
  -webkit-overflow-scrolling: touch; 
  scroll-snap-type: y proximity; 
  
  scrollbar-width: none; 
  -ms-overflow-style: none;   
}
#truck-color-buttons .color-items {
  display: flex;
  flex-direction: column; 
  gap: 6px;
  padding: 2px 4px;
}

#truck-color-buttons .color-btn {
  all: unset;
  display: grid;
  place-items: center;
  width: 35px; 
  height: 35px;
  border-radius: 50%;
  position: relative; 
  cursor: pointer;
  box-sizing: border-box;
}
 #truck-color-buttons .color-btn.selected::after {
  content: "";
  position: absolute;
  inset: 0; 
  border-radius: 50%;
  box-shadow: 0 0 0 3px #ff0000cf; 
  pointer-events: none;
}

#truck-color-buttons .color-btn:focus-visible {
  outline: 2px solid #333;
  outline-offset: 2px;
}

#truck-color-buttons .color-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover; 
  border-radius: 50%; 
  display: block;
  position: static;
}


.finish-previews {
  display: flex;
  flex-direction: column;
  gap: 50px;
  padding: 40px 16px;
}

.finish-box {
  width: 400px;
  margin: auto;
  background: #fff;
  border: 4px solid #ffa4e8;
  border-radius: 10px;
  text-align: center;
  position: relative;
  line-height: 0;
}

.finish-box > img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  margin-bottom: -7px;
}

.save-face-btn,
.save-truck-btn {
  background-color: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  appearance: none;
}

.save-face-btn img,
.save-truck-btn img {
  position: absolute;
  width: 20%;
  bottom: -25%;
  right: -17%;
  z-index: 1;
}

.share-cta {
  margin-top: -25px;
}

.share-x-btn img {
  max-width: 375px;
}

.open-rule {
  padding: 6px 12px;
  margin: 5px;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
  background: #ccc;
}



.rule-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.rule-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  max-width: 600px;
  height: 100%;
  max-height: 850px;
  background: white;
  border-radius: 10px;
  overflow: hidden;
  
  z-index: 10000;
}

.rule-modal-content {
  display: flex;
  position: relative;
  flex-direction: column;
  text-align: left;
  overflow-y: auto;
  box-sizing: border-box;
  height: 100%;
  overflow-y: auto;
}

.rule-modal-title {
  background: #d2f261;
  padding: 10px;
  margin: 50px 0 0;
  text-align: center;
  font-weight: bold;
  color: #9b0d0d;
}

.rule-modal-body {
  padding: 15px;
  overflow-y: auto;
  flex-grow: 1;
}

.rule-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 1.2em;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  z-index: 1002;
}

.rule-buttons {
  display: flex;
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #fff;
  filter: drop-shadow(0 -10mm 4mm rgb(255, 255, 255));
  white-space: nowrap;
}



.agree-btn,
.denied-btn {
  display: none;
  margin: 12px auto 50px;
  padding: 10px 16px;
  width: 40%;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: 700;
  font-size: 20px;
  cursor: pointer;
}


.agree-btn {
  background: #4caf50;
}

.agree-btn:active {
  transform: translateY(1px);
}


.denied-btn {
  background: #696969;
}

.denied-btn:active {
  transform: translateY(1px);
}


.rule-modal-overlay.no-close {
  cursor: not-allowed;
}


.title-overlay {
  position: absolute; 
  inset: 0;
  z-index: 1200; 
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.35s ease;
  opacity: 1;
}

.title-overlay.is-fading {
  opacity: 0; 
  pointer-events: none;
}

.title-card {
  width: 550px;
  height: 850px;
  background: #ffffff;
  border-radius: 10px;
  text-align: center;
  transform-origin: center center;
  
  position: absolute;
  overflow: hidden;
}

.title-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.title-logo {
  position: absolute;
  top: 65%;
  left: 50%;
  width: 90%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
}

.text-img {
  width: 90%;
  
}

.top-text {
  margin: 10px 0;
}

.input-alert {
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  width: 70%;
  max-width: 70%;
  margin: 0 auto;
  gap: 8px;
  box-sizing: border-box;
}

.input-alert p {
  margin: 0;
}

.input-alert .required {
  color: red;
  min-height: 1em;
  font-size: 14px;
  flex: 0 0 auto;
  white-space: nowrap;
  margin: 0;
}


.common-btn {
  display: inline-block;
  /* width: 240px;
  max-width: 80%; */
  /* padding: 12px 16px;
  background: #ffd104;
  color: #fff;
  font-weight: 700;
  font-size: 26px; */
  border: none;
  
  cursor: pointer;
  

  position: absolute;
  top: 87%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);  
}
.common-btn img {
  max-width: 375px;
}

.common-btn.is-disabled {
  opacity: 0.3;
  pointer-events: none;
  /* background: #a79d72;
  color: #e1c54e; */
  box-shadow: none;
}
.next-btn.is-disabled,
.next-btn-first.is-disabled,
.finish-btn.is-disabled {
  opacity: .5;
  pointer-events: none;
  cursor: not-allowed;
}


#start-btn.is-busy,
.next-btn.is-busy,
.next-btn-first.is-busy,
.finish-btn.is-busy,
.common-btn.is-busy {
  opacity: .5;
  pointer-events: none; 
  cursor: default;
}


.modal-layer {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2000; 
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-window {
  position: relative;
  width: 550px;
  height: 850px;
  background: #ffffffab;
  border-radius:16px;
  overflow: hidden;
  transform-origin: center center;
  box-shadow: 0 0px 24px rgb(255 44 247);
}

.modal-close {
  position: absolute;
  top: 2px;
  right: -3px;
  border: 0;
  background: none;
  cursor: pointer;
  z-index: 999;
}

.modal-body {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  position: relative;
}


.modal-body.is-locked-info{
  display:block;           
  background:#ffffffab;
  color:#222;           
  line-height:1.8;
  position: relative;
}


.modal-body.is-form {
  display: block;                     
  overflow-y: auto;                   
  -webkit-overflow-scrolling: touch;  
  max-height: 100%;
  padding-bottom: max(16px, env(safe-area-inset-bottom) + 240px);
  
}


.locked-info{
  display:grid;
  grid-template-rows:auto auto 1fr;
  gap:16px;
  align-content:start;
}


.locked-hero{ margin:0; }
.locked-hero.is-hidden{ display:none; }
.locked-hero-img{
  width:100%;
  max-height:220px;
  object-fit:contain;      
  display:block;
}


.locked-title{
  font-family: "Zen Maru Gothic", "Noto Sans JP", system-ui, -apple-system, sans-serif;
  font-weight:700;
  font-size:18px;
  letter-spacing:.02em;
  margin:0;
}

.lock-message{
  font-size: 22px;
  white-space:normal;       
  text-align: center;
  width: max-content;

  
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic Medium",
               "Yu Gothic", "Segoe UI", system-ui, sans-serif;
  font-weight: 900;                 
  line-height: 1.9;
  letter-spacing: .02em;
  color: #ffffff;                      
  text-decoration: none;            
  
  -webkit-text-stroke: 6px #eb37be;  
  text-stroke: 6px #fff;          
  paint-order: stroke fill;         

  text-shadow:
  2px 2px 2px #eb37be, -2px -2px 2px #eb37be,
  -2px 2px 2px #eb37be,  2px -2px 2px #eb37be,
  2px 0 2px #eb37be, -2px  0 2px #eb37be,
  0 2px 2px #eb37be,  0 -2px 2px #eb37be;

}
.lock-message a {
  font-weight: 700;

  text-decoration:underline;
  word-break:break-all;
  color:#1b5fcc;            
  -webkit-text-stroke: 6px #ffffff;  
}
.loading-text {
  top: -70%;
  max-width: 100px;
}

.modal-body{
  background: transparent; 
}

.modal-body .modal-preview-img {
  object-fit: contain;
  border-radius: 6px;
}



/* html.freeze-vh #wrapper {
  height: calc(var(--vh-freeze, var(--vh, 1vh)) * 100);
} */


/* @supports (height: 100lvh) {
  html.freeze-vh #wrapper {
    height: 100lvh;
  }
} */


.modal-layer,
.modal-window {
  overscroll-behavior: contain;
}


html.inputting #game-container,
html.inputting .title-card,
html.inputting .modal-window {
  transform: none !important; 
  transform-origin: center center !important;
}


html.inputting #game-container,
html.inputting .title-card,
html.inputting .modal-window {
  width: 550px !important;
  height: 850px !important;
}


#part-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  width: 480px;
  margin: 10px auto 6px;
  border-radius: 14px;
  padding: 6px 8px;
}

.tab-btn {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  border: none;
  background: #fdb0e3;
  border-radius: 10px;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.tab-btn img {
  width: 120%;
  object-fit: contain;
}

.tab-btn.active {
  outline: 3px solid #eb37be;
  background: #ffc0ea;
}


#part-lists {
  position: relative;
  width: calc(100% - 60px);
  margin: 8px auto 0;
  background: #ffd1f9;
  border: 3px solid #fdb0e3;
  border-radius: 20px;
  padding: 10px 12px 44px; 
  height: 260px; 
  box-sizing: border-box;
}

.part-list {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  
  align-items: center;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.3s ease;

  position: absolute;
  display: none;
  touch-action: pan-y; 
}

.part-list img {
  -webkit-user-drag: none;
  user-select: none;
}


.part-list[data-part="accessory"] .part-items{
  justify-content: start;   
  align-content: start;     
  place-content: start;     
  justify-items: start;
  align-items: start;
}


.part-list[data-part="accessory"] .part-items img{
  margin: 0;        
  align-self: start;
  justify-self: start;
}

.part-list.active {
  visibility: visible;
  opacity: 1;
  z-index: 1;
  display: block;
}



.grid-wrapper {
  width: 100%;
  height: 100%;
}

.part-items {
  --cols: 4; 
  --thumb: 84px; 
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--thumb)); 
  grid-auto-rows: var(--thumb); 
  gap: 12px;
  
  width: max-content;
  margin-inline: auto;
  margin-top: 15px;
  
  justify-items: center;
}

.part-items img[data-src].selected {
  border-color: #ec125b;
}

.part-items img[data-src] {
  width: 95%;
  height: 95%;
  object-fit: contain;
  background: #fdb0e3;
  border-radius: 14px;
  border: 2px solid transparent;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s linear;
}



.part-list[data-part="skin"] .part-items {
  overflow: hidden !important;
  overflow-clip-margin: initial !important;
}

.part-list[data-part="skin"] .part-items {
  will-change: transform;
  transform: translateZ(0);      
  backface-visibility: hidden;
}

.part-list[data-part="skin"] .part-items img {
  transform: none !important;
  -webkit-backface-visibility: visible !important;
  backface-visibility: visible !important;
  mix-blend-mode: normal !important;
  image-rendering: auto !important;
  opacity: 1 !important;
}

@supports (-webkit-touch-callout: none) {
  #game-container[data-ios-fix="1"] {
    transform: none !important;
  }
}


.part-items img[data-src].is-ready {
  opacity: 1;
}


.part-items .thumb{
  position: relative;
}
.part-items li.thumb{
  position: relative;
}


.part-items .lock-badge{
  position: absolute;
  width: 100%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);

  display: none;                 
  opacity: 1 !important;         
  background: transparent !important;
  border: 0 !important;
  pointer-events: none;
  z-index: 2;
}

.part-items img[data-src].locked + .lock-badge{
  display: block;
}
.lock-badge.is-hidden { display: none !important; }


.pager {
  position: absolute;
  left: 50%;
  bottom: 15px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto 1fr auto; 
  align-items: center;
  width: 100%;
}

.page-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.page-btn:disabled {
  opacity: 0.15;
  cursor: not-allowed;
}

.page-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.page-indicator {
  font-weight: 700;
  color: #fff;
  font-size: 30px;

  line-height: 1.9;
  letter-spacing: .02em;
  text-decoration: none;            
  
  -webkit-text-stroke: 3px #eb37be;  
  text-stroke: 3px #fff;          
  paint-order: stroke fill;         

  /* text-shadow:
  2px 2px 2px #eb37be, -2px -2px 2px #eb37be,
  -2px 2px 2px #eb37be,  2px -2px 2px #eb37be,
  2px 0 2px #eb37be, -2px  0 2px #eb37be,
  0 2px 2px #eb37be,  0 -2px 2px #eb37be; */

}

.part-list .pager .page-btn.prev {
  grid-column: 1;
  justify-self: start;
}

.part-list .pager .page-indicator {
  grid-column: 2;
  justify-self: center;
  text-align: center;
}

.part-list .pager .page-btn.next {
  grid-column: 3;
  justify-self: end;
}

.ime-ja {
  ime-mode: active;
}

.ime-en {
  ime-mode: inactive;
}


.mobile-input-proxy {
  
  --bar-width: min(520px, 95vw); 
  --input-h: 40px; 
  --input-fz: 20px; 
  --alert-h: 22px; 
  --vpad: 6px; 

  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 0px);
  left: 50%;
  transform: translateX(-50%);
  width: var(--bar-width);
  z-index: 100000;

  
  height: calc(var(--input-h) + var(--alert-h) * 2 + var(--vpad) * 2 + 1px);
  min-height: calc(var(--input-h) + var(--alert-h) * 2 + var(--vpad) * 2 + 1px);
  padding: var(--vpad) 0 1px;

  
  background: #ccc7bdee;
  border-bottom: 2px solid #fdb0e3;
  backdrop-filter: blur(2px);
  display: none; 
  pointer-events: none; 
}

.mobile-input-proxy.show {
  display: block;
}

.mobile-input-proxy .input-wrapper {
  
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0; 
}

.mobile-input-proxy .mobile-proxy-input {
  width: 88%;
  height: var(--input-h);
  box-sizing: border-box;
  border: 2px solid #aaa;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: var(--input-fz);
  line-height: var(--input-h);
  pointer-events: none; 
  caret-color: transparent; 
}

.mobile-input-proxy .input-alert {
  width: 88%;
  height: var(--alert-h);
  max-width: 88%;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-input-proxy .proxy-warning {
  color: red;
  font-weight: bold;
  font-size: 10px;
  line-height: 1; 
  white-space: nowrap; 
  
  min-width: 0;
  visibility: hidden; 
}

.mobile-input-proxy .proxy-required {
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}


@media (hover: hover) and (pointer: fine) {
  .mobile-input-proxy:not(.show) {
    display: none;
  }
}

@media (min-width: 980px) {
  .mobile-input-proxy:not(.show) {
    display: none;
  }
}


.mobile-input-proxy.show {
  display: block;
}

.mobile-input-proxy .proxy-close{
  position: absolute;
  right: 3px;
  top: 5px;
  width: 15px;           
  height: 15px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.mobile-input-proxy .proxy-close img{
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;  
}



.gender-layer.over-title {
  position: absolute; 
  inset: 0;
  z-index: 999; 
  display: grid;
  place-items: center;
  
  background: rgba(0, 0, 0, 0.35);
}


.gender-layer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
}
.gender-reselect .gender-card {
  scale: 70%;
}
.gender-reselect .gender-close {
  display: block;
  height: unset;
  width: 20%;
}
.gender-reselect .modal-close {
  top: 0;
}


.gender-card {
  width: 70%;
  background: #fff8e6;
  border: 4px solid #fdb0e3;
  border-radius: 16px;
  padding: 14px 16px 18px;
  text-align: center;
  color: #7a4a5d;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}


.gender-card .top-text {
  display: block;
  width: 86%;
  margin: 4px auto 10px;
}


.gender-row {
  display: flex;
  gap: 14px;
  justify-content: center;
}


.gender-btn {
  width: 140px;
  height: 140px;
  border: 0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.05) inset,
    0 8px 20px rgba(0, 0, 0, 0.12);
  padding: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.05s ease, box-shadow 0.2s ease;
}

.gender-btn:active {
  transform: translateY(1px);
}

.gender-btn:focus-visible {
  outline: 3px solid #eb37be;
  outline-offset: 2px;
}


.gender-icon {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none; 
}

/* ===========================
   性別再選択モーダル（ゲーム中）を
   タイトルのモーダルと同じ見た目に寄せる
   =========================== */


.gender-layer.gender-reselect{
  position: fixed;          
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  
  background: rgba(0,0,0,0.35);
}


.gender-layer.gender-reselect .gender-card{
  
  --dlg-max-w: 360px;                 
  width: min(var(--dlg-max-w), calc(100vw - 64px));
  max-width: var(--dlg-max-w);
  margin: 0 16px;                     
  border-radius: 24px;                
  background: rgba(255,255,255,0.9);  
  box-shadow:
    0 10px 20px rgba(0,0,0,0.18),
    0 2px 6px rgba(0,0,0,0.10);
  transform: translateY(-4%);         
}


.gender-layer.gender-reselect .gender-title{
  font-size: clamp(18px, 3.8vw, 26px);
  line-height: 1.2;
  text-shadow: 0 2px 0 rgba(255,255,255,0.7);
}


.gender-layer.gender-reselect .gender-choices{
  display: grid;
  grid-auto-flow: column;
  gap: 16px;
  align-items: center;
  justify-content: center;
}
.gender-layer.gender-reselect .gender-btn{
  min-width: 140px;                   
  min-height: 140px;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}


.gender-layer.gender-reselect .gender-close{
  position: absolute;
  top: -16px;                         
  right: -16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.gender-layer.gender-reselect .gender-close:active{
  transform: translateY(1px);
}






.modal-layer.locked-info {
  
  background: rgba(0,0,0,0.15);
}

.modal-layer.locked-info .modal-window{
  
  background-color: rgba(255,255,255,0.70);
  
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}


.modal-layer.locked-info .lock-message{
  line-height: 1.6;
}
.modal-layer.locked-info .lock-message a{
  text-decoration: underline;
}


.modal-layer.locked-info {
  background: rgba(0,0,0,.25);
}

.modal-layer.locked-info .modal-window{
  background-color: rgba(255,255,255,0.70);  
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
}

.modal-layer.locked-info .modal-body{
  background-color: rgba(255,255,255,0.35); 
}




.part-items img[data-src].locked {
  position: relative;
  cursor: not-allowed;
}


img.just-unlocked {
  outline: 3px solid #ff8;
  box-shadow: 0 0 0 4px rgba(255, 200, 0, .6);
  animation: pulse 0.8s ease-in-out 4;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.04); }
}




html { -webkit-text-size-adjust: 100%; }

#modal-truck-content-first input[type="text"],
#modal-truck-content-first input[type="search"],
#modal-truck-content-first textarea,
#modal-truck-content input[type="text"],
#modal-truck-content input[type="search"],
#modal-truck-content textarea,
.mobile-input-proxy .mobile-proxy-input {
  font-size: 16px;            
  touch-action: manipulation; 
}





.ui-freeze {
  transition: none !important;
  will-change: transform;
}


.sp-dl-text {
  display: none;
}
@media screen and (max-width: 768px) {
  .save-face-btn,
  .save-truck-btn {
    visibility: hidden !important;
  }
  .sp-dl-text {
    display: block;
    position: absolute;
    width: 100%;
    top: 35.5%;
  }
  .sp-dl-text img {
    width: 80%;
  }

}



.finish-truck-box a.dl-img,
.finish-box a.dl-img { display: contents; }


@supports not (display: contents) {
  .finish-truck-box a.dl-img,
  .finish-box a.dl-img {
    display: block;
    line-height: 0;
    
    margin: 0; padding: 0; border: 0; background: none;
  }
}
.finish-face,
.finish-truck {
  width: 100%;
  margin-bottom: -7px;
}


.hide-base #game-container {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}


html.kb-open #background {
  will-change: transform;
  transform: translateZ(0);
}



html.ime-open.has-focus input:not(:focus),
html.ime-open.has-focus textarea:not(:focus) {
  pointer-events: none !important;
}


/* 既存の #background は残しつつ、iOS 時のみ上書きする */
html.ios-safari #background {
  position: fixed;      /* ← absolute → fixed に */
  inset: 0;             /* top/right/bottom/left を 0 に明示 */
  width: 100vw;         /* 端末幅に対して明示 */
  height: 100vh;        /* 端末高に対して明示（※後述JSの--vhと置換可） */

  /* 合成の安定化（既にお持ちならそのままでOK） */
  will-change: transform;
  transform: translateZ(0.001px);
  backface-visibility: hidden;

  /* 念のため：背景だけなのでクリック透過 */
  pointer-events: none;

  /* スタッキングを安定させる（必要なら -1 / 0 を調整） */
  z-index: -1;
}

/* 既存の画像指定はそのままでOK。モバイル向けも引き継がれます */
#background {
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  /* background-image: url(../img/page_bg.webp); ← 既存を活かす */
}
@media screen and (max-width: 1024px) {
  #background { background-image: url(../img/page_bg_sp.webp); }
}



/* --- Firefox だけの上書き --- */
@supports (-moz-appearance: none) {

  /* 1) 箱の中からはみ出さない & 下辺揃え（Firefoxのみ） */
  .finish-box{
    overflow: clip;                  /* 旧版は下のフォールバックへ */
    display: flex;                   /* 下辺揃え用 */
    align-items: flex-end;           /* ★常に下に寄せる */
    justify-content: center;         /* 水平中央 */
  }
  @supports not (overflow: clip) {
    .finish-box{ overflow: hidden; }
  }

  /* 2) 画像側の負の余白を無効化・ブロック要素化 */
  .finish-box > img,
  .finish-box .finish-face,
  .finish-box .finish-truck{
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-bottom: 0;                /* ★Firefoxでは -7px を使わない */
  }

  /* 3) 画像を包むアンカーの基線ギャップを消す（JSが display:contents を設定しているためFirefoxで不安定） */
  .finish-box a.dl-img{
    display: block;                  /* contents → block */
    line-height: 0;
  }
}
