/* 背景 */
body {
  font-family: "Segoe UI", sans-serif;
  margin: 0;
  padding: 0;
  text-align: center;
  background: #f7f9fc no-repeat center center fixed;
  background-size: cover;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* メインコンテナ */
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  padding: 20px;
  padding-bottom: 100px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .container {
    padding: 40px 20px 120px;
  }
}

/* タイトルセクション */
h1 {
  color: #2c3e50;
  margin: 0 0 30px 0;
  font-size: 28px;
  font-weight: 700;
}

@media (max-width: 767px) {
  h1 {
    font-size: 24px;
    margin-bottom: 20px;
  }
}

/* 注意枠 */
.notice {
  background: #fff8e5;
  color: #8a6d3b;
  border: 1px solid #ffe08a;
  border-radius: 10px;
  padding: 15px;
  margin: 0 auto 30px;
  font-size: 14px;
  line-height: 1.6;
  width: 100%;
  max-width: 500px;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .notice {
    font-size: 13px;
    padding: 12px;
    margin-bottom: 20px;
    width: min(100%, 500px);
    max-width: 100%;
  }
}

/* ボタン共通スタイル */
button {
  background: #3498db;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  font-size: 16px;
}

/* ログインボタン */
#loginButton {
  width: 100%;
  max-width: 450px;
  height: 50px;
  border-radius: 25px;
  margin: 0 auto 15px;
  display: block;
  font-size: 18px;
  box-sizing: border-box;
}

#loginButton:hover {
  background: #2980b9;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#loginButton:active {
  transform: scale(0.98);
}

/* 確認ボタン */
#submit {
  width: 80px;
  height: 50px;
  border-radius: 8px;
  font-size: 16px;
  flex-shrink: 0;
}

#submit:hover {
  background: #2980b9;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

#submit:active {
  transform: scale(0.98);
}

#submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

@media (max-width: 767px) {
  #loginButton {
    height: 48px;
    font-size: 16px;
  }
  
  #submit {
    height: 48px;
    width: 70px;
  }
}

/* アカウントIDの入力部分 */
#input {
  width: 100%;
  max-width: 450px;
  margin: 20px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* input + button 横並び */
.input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* input とボタン */
#input input {
  flex: 1;
  min-width: 0;
  height: 50px;
  border: 2px solid #737374;
  border-radius: 8px;
  padding: 0 15px;
  box-sizing: border-box;
  font-size: 16px;
  transition: all 0.3s ease;
}

#input input:focus {
  outline: none;
  border-color: #1979ff;
  box-shadow: 0 0 0 3px rgba(25, 121, 255, 0.1);
}

#input input.error {
  border-color: #f17e7e;
}

#input input.error:focus {
  box-shadow: 0 0 0 3px rgba(241, 126, 126, 0.1);
}

@media (max-width: 767px) {
  .input-row {
    gap: 8px;
  }

  #input input {
    font-size: 16px;
    height: 48px;
  }
}

/* エラー表示 */
.inputerror {
  display: flex;
  align-items: flex-start;
  color: #757575;
  font-size: 12px;
  margin-top: 8px;
  margin-left: 0;
  text-align: left;
  gap: 6px;
}

.inputerror .error_icon {
  display: none;
  margin-top: 2px;
  flex-shrink: 0;
  width: 12px;
  height: 12px;
}

.inputerror .error_text {
  flex: 1;
  line-height: 1.4;
}

@media (max-width: 767px) {
  .inputerror {
    font-size: 12px;
  }
}

/* 結果表示エリア */
#result {
  display: none;
  max-width: 500px;
  margin: 30px auto 0;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  font-size: 16px;
  line-height: 1.8;
  width: 100%;
  box-sizing: border-box;
}

/* 各行を表示 */
.result-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  justify-items: center;
  align-items: center;
  margin: 12px 0;
  gap: 8px;
  text-align: center;
}

/* タイトル */
.result-row .label {
  font-weight: 600;
  color: #2c3e50;
  text-align: right;
  width: 100%;
}

/* コロン */
.result-row .colon {
  color: #2c3e50;
  font-weight: 600;
}

/* 値 */
.result-row .value {
  font-weight: bold;
  color: #2c3e50;
  text-align: left;
  width: 100%;
}

.sub-rank {
  font-size: 0.85em;
  color: #555;
  margin-top: 4px;
  display: block;
}

@media (max-width: 767px) {
  #result {
    font-size: 15px;
    margin-top: 20px;
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 15px 0;
    padding: 12px;
    background: #f9f9f9;
  }

  .result-row .label {
    text-align: center;
    width: 100%;
    font-size: 13px;
    color: #666;
    font-weight: 500;
  }

  .result-row .colon {
    display: none;
  }

  .result-row .value {
    text-align: center;
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
  }

  .sub-rank {
    font-size: 12px;
    color: #888;
    margin-top: 6px;
  }
}

/* infoエリア */
#info {
  margin-top: 30px;
  font-size: 14px;
  color: #555;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

#info a {
  color: #3498db;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

#info a:hover {
  color: #2980b9;
  text-decoration: underline;
}

/* フッター */
#footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 15px 20px;
  font-size: 12px;
  color: #777;
  background: #f7f9fc;
  border-top: 1px solid #e0e0e0;
  text-align: center;
}

#footer a {
  color: #3498db;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

#footer a:hover {
  color: #2980b9;
  text-decoration: underline;
}

@media (max-width: 767px) {
  #footer {
    font-size: 11px;
    padding: 12px 15px;
  }
}

#spacer {
  color: #999;
  font-size: 14px;
}

@media (max-width: 767px) {
  #info {
    font-size: 13px;
    margin-top: 25px;
  }

  #footer {
    font-size: 12px;
    margin-top: 30px;
  }

  #spacer {
    font-size: 13px;
  }
}

/* ローディング表示 */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  gap: 15px;
}

.loading-container p {
  font-size: 16px;
  color: #2c3e50;
  margin: 0;
}

/* スピナー本体 */
.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(52, 152, 219, 0.1);
  border-left-color: #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 回転アニメーション */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}