/* ログイン／新規登録専用（シェル無し・全画面） */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #05060a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: pan-x pan-y;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

.auth-viewport {
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  background-color: #05060a;
  background-image: url('../assets/images/title.webp');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  overflow: hidden;
}

.btn-sound-toggle-login {
  position: absolute;
  top: calc(env(safe-area-inset-top, 12px) + 8px);
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(10, 14, 24, 0.65);
  border: 1px solid rgba(255, 215, 0, 0.4);
  color: var(--color-gold);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  backdrop-filter: blur(4px);
}

.title-logo-spacer {
  flex: 1 1 auto;
  min-height: 28dvh;
  pointer-events: none;
}

.auth-card {
  width: 100%;
  max-height: min(68dvh, calc(100dvh - 22dvh));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(12, 16, 28, 0.88) 0%, rgba(6, 8, 14, 0.96) 100%);
  backdrop-filter: blur(14px);
  border-top: 1.5px solid rgba(255, 215, 0, 0.35);
  border-radius: 24px 24px 0 0;
  padding: 16px 18px calc(env(safe-area-inset-bottom, 12px) + 12px) 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.8);
  z-index: 20;
  box-sizing: border-box;
}

.tab-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  background: rgba(26, 34, 52, 0.8);
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 9px 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.tab-btn.active {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  color: #fff;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

.form-group {
  margin-bottom: 10px;
}

.form-group label {
  display: block;
  font-size: 10.5px;
  font-weight: bold;
  color: #cbd5e1;
  margin-bottom: 3px;
}

.form-group input {
  width: 100%;
  height: 38px;
  background: rgba(9, 13, 22, 0.85);
  border: 1px solid #283347;
  border-radius: 6px;
  color: #fff;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}

.char-picker-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.step-indicator {
  font-size: 10px;
  color: #38bdf8;
  font-weight: bold;
  text-align: center;
  margin-bottom: 2px;
}

.char-picker {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  scroll-snap-type: x mandatory;
}

.char-choice {
  width: 72px;
  height: 102px;
  border: 1.5px solid #334155;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  cursor: pointer;
  opacity: 0.55;
  position: relative;
  background: #090d14;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-snap-align: start;
}

.char-choice.active {
  border-color: var(--color-gold);
  opacity: 1;
  transform: scale(1.04);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.char-choice img {
  width: 100%;
  height: 78px;
  object-fit: cover;
  object-position: top center;
}

.char-choice .char-tag {
  font-size: 9px;
  font-weight: 900;
  color: #cbd5e1;
  text-align: center;
  line-height: 20px;
  width: 100%;
  background: rgba(15, 23, 42, 0.95);
  white-space: nowrap;
}

.char-choice.active .char-tag {
  color: var(--color-gold);
}

.selected-char-info {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed #334155;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 10px;
  color: #cbd5e1;
  text-align: center;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-submit {
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid #60a5fa;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.btn-nav-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  margin-top: 8px;
}

.btn-back-step {
  height: 44px;
  background: #334155;
  border: 1px solid #475569;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.error-text {
  color: #f87171;
  font-size: 11px;
  margin-top: 6px;
  text-align: center;
  min-height: 16px;
}

.login-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(2, 6, 14, 0.78);
}
.login-modal-overlay[hidden] {
  display: none;
}

.login-modal-panel {
  width: min(100%, 320px);
  background: #121826;
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 16px 14px 14px;
  text-align: center;
}

.login-modal-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}

.login-modal-title {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 800;
  color: #fbbf24;
}

.login-modal-msg {
  margin: 0 0 14px;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.55;
  text-align: left;
}

.login-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.login-modal-btn {
  width: 100%;
  min-height: 40px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.login-modal-btn.is-cancel {
  background: #334155;
  color: #cbd5e1;
}
.login-modal-btn.is-ok {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: 1px solid #60a5fa;
  color: #fff;
}
