/* In-game inventory and operation guide */

/* 画面上部HUDではTIMEと体力だけ表示する。
   木の棒・食料は主人公付近のfield-inventoryだけに表示する。 */
.drift-hud {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.7fr);
}

.drift-hud .hud-cell:nth-child(3),
.drift-hud .hud-cell:nth-child(4) {
  display: none !important;
}

.drift-hud .hud-cell:nth-child(2) {
  border-right: 0;
}

#retry-button[hidden] {
  display: none !important;
}

/* 鳥と流木はbutton要素だが、操作領域の矩形は見せない。 */
.bird,
.debris {
  margin: 0;
  padding: 0;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-appearance: none;
  appearance: none;
}

.bird:focus,
.bird:focus-visible,
.debris:focus,
.debris:focus-visible {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}

.field-inventory {
  position: absolute;
  z-index: 25;
  top: auto;
  left: calc(50% + 48px);
  bottom: 17%;
  display: flex;
  flex-direction: column;
  gap: 5px;
  pointer-events: none;
}

.field-inventory-item {
  min-width: 68px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  background: rgba(7, 14, 20, .76);
  color: #f3f3f0;
  backdrop-filter: blur(6px);
}

.field-inventory-item span,
.field-inventory-item strong {
  display: block;
}

.field-inventory-item span {
  color: rgba(243, 243, 240, .68);
  font-size: .58rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.field-inventory-item strong {
  margin-top: 2px;
  font-size: 1.18rem;
  line-height: 1;
}

.drift-instructions {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
}

.drift-instructions h2 {
  margin: 0 0 12px;
  font-size: .78rem;
  letter-spacing: .08em;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.instruction-item {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.instruction-item strong,
.instruction-item span {
  display: block;
}

.instruction-item strong {
  font-size: .78rem;
}

.instruction-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.55;
}

/* 昼は太陽、夜は三日月。 */
.sun-moon {
  -webkit-mask-image: none;
  mask-image: none;
  filter: none;
}

.sky.night .sun-moon {
  background: #e8edf2;
  box-shadow: none;
  -webkit-mask-image: radial-gradient(circle at 70% 38%, transparent 0 43%, #000 44%);
  mask-image: radial-gradient(circle at 70% 38%, transparent 0 43%, #000 44%);
  filter: drop-shadow(0 0 9px rgba(230, 238, 246, .45));
}

/* クリア時の浜に、主人公を待ち望む人たちを表示する。 */
.welcome-group {
  position: absolute;
  z-index: 18;
  left: 10%;
  bottom: 34%;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;
}

.welcome-person {
  position: relative;
  width: 28px;
  height: 74px;
  transform-origin: bottom center;
}

.welcome-person-1 { transform: scale(.96); }
.welcome-person-2 { transform: scale(1.06); }
.welcome-person-3 { transform: scale(.9); }
.welcome-person-4 { transform: scale(1); }

.welcome-head {
  position: absolute;
  top: 0;
  left: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #e6b58c;
}

.welcome-head::before {
  content: "";
  position: absolute;
  top: -2px;
  left: -1px;
  width: 14px;
  height: 6px;
  border-radius: 60% 60% 25% 25%;
  background: #34302d;
}

.welcome-body {
  position: absolute;
  top: 13px;
  left: 6px;
  width: 17px;
  height: 31px;
  border-radius: 6px 6px 4px 4px;
  background: #e7e2d4;
}

.welcome-person-2 .welcome-body { background: #c8d9e8; }
.welcome-person-3 .welcome-body { background: #d8c8aa; }
.welcome-person-4 .welcome-body { background: #d7d0e3; }

.welcome-arm {
  position: absolute;
  top: 20px;
  width: 16px;
  height: 5px;
  border-radius: 999px;
  background: #e6b58c;
  transform-origin: 2px 50%;
}

.welcome-arm-left {
  left: -3px;
  transform: rotate(145deg);
}

.welcome-arm-right {
  left: 20px;
  transform: rotate(35deg);
}

.welcome-leg {
  position: absolute;
  top: 42px;
  width: 5px;
  height: 27px;
  border-radius: 999px;
  background: #3a3a3c;
  transform-origin: top center;
}

.welcome-leg-left {
  left: 8px;
  transform: rotate(6deg);
}

.welcome-leg-right {
  left: 16px;
  transform: rotate(-6deg);
}

.welcome-person.waving .welcome-arm-right {
  transform-origin: 2px 50%;
  animation: shore-wave .65s ease-in-out infinite alternate;
}

.welcome-person.cheering .welcome-arm-left {
  transform: rotate(225deg);
}

.welcome-person.cheering .welcome-arm-right {
  transform: rotate(-45deg);
}

@keyframes shore-wave {
  from { transform: rotate(18deg); }
  to { transform: rotate(72deg); }
}

.shore-palm {
  left: 70%;
  bottom: 43%;
  transform: scale(.82);
  transform-origin: bottom center;
}

.game-version {
  position: fixed;
  z-index: 100;
  right: 12px;
  bottom: 10px;
  padding: 4px 7px;
  border-radius: 6px;
  background: rgba(7, 14, 20, .64);
  color: rgba(243, 243, 240, .58);
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .04em;
  pointer-events: none;
  backdrop-filter: blur(4px);
}

@media (max-width: 620px) {
  .drift-hud {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr);
  }

  .field-inventory {
    left: calc(50% + 38px);
    bottom: 16%;
    gap: 4px;
  }

  .field-inventory-item {
    min-width: 58px;
    padding: 6px 7px;
  }

  .field-inventory-item span {
    font-size: .53rem;
  }

  .field-inventory-item strong {
    font-size: 1rem;
  }

  .instruction-grid {
    grid-template-columns: 1fr;
  }

  .welcome-group {
    left: 5%;
    bottom: 31%;
    gap: 5px;
    transform: scale(.78);
    transform-origin: left bottom;
  }

  .shore-palm {
    left: 71%;
    bottom: 40%;
    transform: scale(.68);
  }

  .game-version {
    right: 8px;
    bottom: 7px;
    font-size: .6rem;
  }
}
