/* Aim Training Game Styles */

:root {
  --jr-bg: #1f2227;
  --jr-bg-soft: #262a31;
  --jr-border: #3b4049;
  --jr-text: #e9edf3;
  --jr-text-muted: #aeb6c3;
  --jr-accent: #5c8dff;
}

#aim-root {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--jr-text);
}

/* メインゲーム画面エリア */
#aim-game-section {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--jr-bg);
  z-index: 9999;
}

#startGameBtn {
  margin-top: 20px;
}

#other-games-link {  
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  text-align: center;
}

.link-button {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);
  text-decoration: none;
  cursor: default;
}

/* キャンバス部分 */
#aimCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* スコア表示 オーバーレイ設定*/
#aim-overlay-ui {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 10000;
  color: var(--jr-text);
  font-weight: 700;
  line-height: 1.4;
  pointer-events: none;
}

#comboDisplay,
#scoreDisplay,
#specialDisplay {
  margin: 0;
}

/* 名前、メニュー、設定、結果画面 */
#aim-auth-section ,
#aim-menu-section ,
#aim-menu-section ,
#aim-setting-section ,
#aim-result-section{
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--jr-text);
}

/* プライバシー・クッキー説明枠 */
.aim-privacy-notice {
  border: 1px solid var(--jr-border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
  background: var(--jr-bg-soft);
  color: var(--jr-text-muted);
  font-size: 0.85rem;
  line-height: 1.7;
  max-width: 480px;
  text-align: left;
}

.aim-privacy-notice p {
  margin: 0 0 10px;
}

.aim-privacy-notice p:last-child {
  margin-bottom: 0;
}

/* 未登録画面 */
.aim-register {
  display: flex;
  gap: 20px;
  padding: 20px;
  border-radius: 15px;
  max-width: 420px;
  width: 100%;
  color: var(--jr-text);
  align-items: center;
  justify-content: center;
}

.aim-restore {
  display: flex;
  gap: 20px;
  padding: 20px;
  border-radius: 15px;
  max-width: 420px;
  width: 100%;
  color: var(--jr-text);
  align-items: center;
  justify-content: center;
}

#aim-root #aimNewName,
#aim-root #aimRestoreId {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);
  -webkit-text-fill-color: var(--jr-text);
}

#aim-root #aimNewName:focus,
#aim-root #aimRestoreId:focus {
  color: var(--jr-text);
  -webkit-text-fill-color: var(--jr-text);
  border-color: var(--jr-accent);
  box-shadow: 0 0 0 1px var(--jr-accent);
  outline: 2px solid transparent;
}

#aim-root #aimNewName::placeholder,
#aim-root #aimRestoreId::placeholder {
  color: var(--jr-text-muted);
  -webkit-text-fill-color: var(--jr-text-muted);
}

/* Cocoon等のテーマ側スタイルで縦書きになるのを防ぐ */
#aim-root button {
  writing-mode: horizontal-tb !important;
  -webkit-writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#registerBtn, #restoreBtn {
  margin-top: 12px;
  margin-bottom: 12px;
  writing-mode: horizontal-tb;
  padding: 8px 16px;
  border-radius: 6px;
  text-align: center;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);
}

.aim-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

/* スタート画面 */
#openSettingBtn {
  margin-top: 20px;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);
}

#startGameBtn {
  margin-top: 20px;
  margin-bottom: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);
}

/* 設定画面 */
#aim-setting-section {
  border: 2px solid var(--jr-border);
  gap: 20px;
  padding: 20px;
  border-radius: 15px;
  max-width: 420px;
  width: 100%;
  background: var(--jr-bg);
  color: var(--jr-text);
}

.setting-group {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.setting-group label {
  flex: 1;
}

.setting-group .label {
  color: var(--jr-text-muted);
}

.setting-group select {
  flex: 1;
  margin-left: auto;
  text-align: center;      /* 一般的なブラウザ向け */
  text-align-last: center; /* Chrome/Safari/Firefox向け */
}

#set-title-btn {
  align-self: flex-end;
  margin-top: 20px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);  
}

#closeSettingBtn {
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);  
}

/* 月間ランキング */
.ranking-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-evenly;
  width: 100%;
}

.ranking-card {
  max-width: 420px;
  width: 100%;
  margin: 20px;
  padding: 16px;
  background: var(--jr-bg);
  border-radius: 12px;
  color: var(--jr-text);
  border: 1px solid var(--jr-border);
}

.ranking-card h3 {
  text-align: center;
  font-size: 15px;
  margin-bottom: 12px;
}

.ranking-header button {
  background: var(--jr-bg-soft);
  color: var(--jr-text);
  border: 1px solid var(--jr-border);
  border-radius: 6px;
  padding: 4px 10px;
}

#column-headers {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--jr-text-muted);
  margin-bottom: 8px;
}

#ranking-list {
  display: block;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-bottom: 1px solid var(--jr-border);
  font-size: 13px;
}

#ranking-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-bottom: 1px solid var(--jr-border);
  font-size: 13px;
}

#ranking-list li.top1 {
  color: gold;
  font-weight: 700;
  background: rgba(255, 215, 0, 0.12);
}

#ranking-list li.top2 {
  color: silver;
  font-weight: 700;
  background: rgba(192, 192, 192, 0.12);
}

#ranking-list li.top3 {
  color: #cd7f32;
  font-weight: 700;
  background: rgba(205, 127, 50, 0.12);
}

#dailyRanking-list {
  display: block;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-bottom: 1px solid var(--jr-border);
  font-size: 13px;
}

#dailyRanking-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  border-bottom: 1px solid var(--jr-border);
  font-size: 13px;
}

#dailyRanking-list li.top1 {
  color: gold;
  font-weight: 700;
  background: rgba(255, 215, 0, 0.12);
}

#dailyRanking-list li.top2 {
  color: silver;
  font-weight: 700;
  background: rgba(192, 192, 192, 0.12);
}

#dailyRanking-list li.top3 {
  color: #cd7f32;
  font-weight: 700;
  background: rgba(205, 127, 50, 0.12);
}

.my-rank-box {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--jr-border);
  text-align: center;
  font-size: 14px;
}

.my-rank-box .label {
  color: var(--jr-text-muted);
}

#backToMenuBtn {
  margin-top: 20px;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid var(--jr-border);
  background: var(--jr-bg-soft);
  color: var(--jr-text);
}

/* ローディングスピナー */
.loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.spinner {
  display: none;
  width: 50px;
  height: 50px;
  border: 6px solid #ddd;
  border-top: 6px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}