:root {
  --main-color: #5FC1C7;
  --sub1-color: #1D4763;
  --sub2-color: #fffaee;
  --sub3-color: #ffa500;
  --sub4-color: #70372c;
  --base-width: 750px;
}

button {
  background-color: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  padding: 0;
  appearance: none;
}

.display-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.base-btn {
  background-color: var(--sub1-color);
  color: white;
  font-size: 35px;
  font-weight: bold;
  border-radius: 10px;
}

.base-btn:hover {
  transform: scale(1.1);
}

.main-container {
  background-color: white;
  border: solid 5px var(--main-color);
  border-radius: 20px;
  width: var(--base-width);
}

.main-title-font {
  color: var(--sub1-color);
  font-weight: bold;
}

.sub-title-font {
  color: var(--sub1-color);
  font-weight: 600;
}

.sub2-title-font {
  color: var(--main-color);
  font-weight: 600;
}

.sub4-title-font {
  color: var(--sub4-color);
  font-weight: 600;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

/* header */
header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: white;
  padding: 10px 20px;
  z-index: 1001;
  margin: 0;
}

.logo-area {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo-area img {
  height: 50px;
}

.site-name {
  font-size: 24px;
  font-weight: bold;
  margin-left: 10px;
  color: black;
  text-decoration: none;
}

.paw {
  font-size: 24px;
  margin-left: 5px;
}

.nav-link {
  margin-left: clamp(10px, 2vw, 20px);
  font-size: clamp(14px, 2vw, 20px);
  text-decoration: none;
  color: black;
  font-weight: bold;
}

.sns-links {
  margin-left: clamp(10px, 2vw, 40px);
}

.sns-links img {
  width: 30px;
  height: 30px;
  margin: auto 5px;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.sns-links img:hover {
  transform: scale(1.1);
}

body {
  font-family: Arial, sans-serif;
  text-align: center;
  background: var(--sub2-color);
  margin: 0;
  padding: 0;
}

.header-bar {
  position: relative;
  align-items: center;
  text-align: start;
  z-index: 1001;
  padding-left: 15px;
  padding-top: 10px;
  padding-bottom: 10px;
  background-color: var(--main-color);
}

.besttype-logo-area {
  justify-content: center;
  align-items: center;
  text-decoration: none;
  width: 100%;
}

h1 {
  margin: 0;
  margin-left: clamp(10px, 2vw, 20px);
  font-size: clamp(15px, 6vw, 50px);
  color: white;
}

.sub-header-button {
  width: 75px;
  height: 75px;
}

.sub-header-button img{
  width: 100%;
  height: 100%;
}

.sub-header-button:hover{
  transform: scale(1.1);
}

/* side-bar */
#sidebar {
  position: fixed;
  top: 0px;
  left: -200px;
  width: 200px;
  height: 100%;
  background-color: var(--sub1-color);
  color: white;
  padding-top: 170px;
  transition: left 0.5s ease;
  z-index: 1000;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
}

#sidebar.open {
  left: 0;
}

.sidebar-nav {
  gap: 10px;
  padding: 0 10px;
}

.sidebar-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 10px;
  text-align: left;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar-btn.active {
  font-size: 1.5em;
  font-weight: 600;
  /* background-color: rgba(255, 255, 255, 0.15); */
}

#sidebar-tab {
  position: absolute;
  top: clamp(160px, 22vw, 200px);
  left: 100%;
  width: 20px;
  height: 80px;
  background: var(--sub1-color);
  clip-path: polygon(0 0, 100% 20%, 100% 80%, 0 100%);
  cursor: pointer;
  z-index: 1001;
}

/* main */
.SynTQ-main-content-container {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: flex-start;
  margin: 40px 0;
}

.SynTQ-hori-ads-region1 {
  display: none;
}

.SynTQ-vert-ads-region1 {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 300px;
  height: 900px;
  /* border: solid 1px red; */

}

.SynTQ-title-container {
  height: 600px;
}

.SynTQ-game-container {
  justify-content: center;
  align-items: center;
  text-align: center;
  width: var(--base-width);
  gap: 20px;
}

.SynTQ-title {
  font-size: 52px;
}

.SynTQ-strt-btn {
  width: 450px;
  height: 70px;
  margin: 30px 0;
}

.SynTQ-hint-toggle-container {
  display: flex;
  flex-direction: row;
  justify-content: space-evenly;
  align-items: center;
  /* border: solid 1px blue; */
  width: 50%;
  margin: 0 auto;
  color: var(--sub1-color);
  font-size: 25px;
  font-weight: 600;
}

.SynTQ-typing-outer-container {
  width: var(--base-width);
  justify-content: space-between;
}

.SynTQ-typing-container {
  background-color: white;
  border: solid 5px var(--main-color);
  border-radius: 20px;
  height: 430px;
  width: 100%
}

.ios-toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 28px;
}

.ios-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  background-color: #e5e5e5;
  border-radius: 34px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: background-color 0.3s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.ios-toggle input:checked+.slider {
  background-color: var(--main-color);
}

.ios-toggle input:checked+.slider::before {
  transform: translateX(32px);
}

.question-wrapper {
  position: relative;
  height: 300px;
  overflow: hidden;
}

.question-block {
  position: absolute;
  width: 100%;  
  left: 0;
  transition: all 0.3s ease;
  text-align: center;
}

#current-question {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  top: 30%;
  transform: translateY(-50%);
  opacity: 1;
  height: 150px;
  /* border: solid 1px red; */
  gap: 8px;
}

#current-question p {
  margin: 0;
}

#next-question {
  top: 85%;
  transform: translateY(-50%);
  opacity: 0.3;
  height: 80px;
  /* border: solid 1px red; */
  transition: top 0.3s ease, opacity 0.3s ease, height 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#next-question.promote {
  height: 150px;
  /* border: solid 1px green; */
}

#next-question p {
  display: block;
  margin: 0;
  font-size: 25px;
  transition: font-size 0.3s ease;
  /* border: solid 1px blue; */
}

#next-question.promote #next-jp-word {
  font-size: 45px;
  /* border: solid 1px blue;   */
  transform: translateY(110%);
  box-sizing: border-box;
}

#next-question.promote #next-en-word-display {
  font-size: 45px;
  /* border: solid 1px blue;   */
  transform: translateY(-50%);
  box-sizing: border-box;
}

#next-question .inner {
  height: 80px;
  /* ✅ 固定高さ */
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

#next-question.promote .inner {
  height: 150px;
  /* ✅ アニメーション時も固定 */
}

#next-next-question {
  opacity: 0;
  top: 120%;
  transform: translateY(-50%);
  /* position: absolute;  */
  width: 100%;
}

#next-next-question .inner2 {
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

#next-next-question.promote #next-next-jp-word {
  transform: translateY(14%);
}

#next-next-question.promote #next-next-en-word-display {
  transform: translateY(-15%);
}

.question-block p {
  margin: 5px;
}

#jp-word {
  font-size: 45px;
  font-weight: bold;
  color: var(--sub4-color);
}

#next-jp-word,
#next-next-jp-word {
  font-size: 25px;
  font-weight: bold;
  height: 40px;
  line-height: 40px;
  color: var(--sub4-color);
}

#en-word-display {
  font-size: 45px;
  letter-spacing: 3px;
}

#next-en-word-display,
#next-next-en-word-display {
  font-size: 25px;
  letter-spacing: 3px;
}

#en-word-display span {
  font-size: 45px;
  color: rgba(0, 0, 0, 0.3);
}

#next-en-word-display,
#next-next-en-word-display span {
  font-size: 25px;
  color: rgba(0, 0, 0, 0.3);
}

#en-word-display .typed {
  color: var(--sub1-color);
  font-weight: bold;
}

#en-word-display .error {
  color: var(--main-color);
  font-weight: bold;
}

#progress {
  margin-top: 15px;
  font-weight: bold;
}

.hidden {
  display: none;
}

.typed {
  color: var(--sub1-color);
}

.error {
  color: var(--main-color);
}

.next {
  opacity: 0.3;
  top: 80%;
}

.keyboard-container {
  width: var(--base-width);  
  padding: 10px;
  box-sizing: border-box;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  margin: 5px 0;
}

.key {
  width: 45px;
  height: 45px;
  border: 4px solid var(--main-color);
  border-radius: 8px;
  margin: 2px;
  font-size: 25px;
  font-weight: bold;
  color: var(--main-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

.key.large {
  width: 70px;
}

.key.space {
  width: 200px;
}

.key.shift {
  width: 80px;
}

.key.active {
  background: #f3bbb5;
  color: white;
}

.key.next {
  background-color: var(--sub1-color);
  border: solid 4px var(--sub1-color);
  color: white;
  opacity: 1;
}

.key.hit {
  background-color: var(--sub1-color);
  border: solid 4px var(--sub1-color);
  color: white;
  transform: scale(0.9);
}

.key.miss {
  background-color: rgba(255, 0, 0, 0.5);
  transform: scale(0.9);
}

.result-list {
  padding: 2px 4px;
  font-size: 16px;  
}

.result-list-container {
  background-color: white;
  border: solid 3px var(--main-color);
  width: 90%;
  height: 100%;
  margin: 10px auto;
  overflow-y: auto;  
  padding: 5px;
  text-align: left;
  box-sizing: border-box;
}

@keyframes comboPop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1);
  }
}

.combo-pop {
  animation: comboPop 0.25s ease;
}

.countdown {     
  font-size: 100px;
  font-weight: bold;
  color: var(--main-color);
  z-index: 1000;
  /* background-color: rgba(255, 255, 255, 0.8); */ 
  padding: 40px 60px;  
  transition: opacity 0.3s ease;
  transform: translateY(50%);
}

@media (max-width: 1380px) {
  .SynTQ-main-content-container {
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: 20px;
    margin: 20px 0;
  }
  .SynTQ-vert-ads-region1 {
    display: none;
  }
  .SynTQ-hori-ads-region1 {
    display: block;
    width: 728px;
    height: 90px;
    /* border: solid 1px red; */
  }
}

/* === LINE風 吹き出し === */
.question-wrapper{
  display: flex;
  flex-direction: column;   /* ← これがないと縦方向に効かない */
  justify-content: center;  /* ← 縦方向の中央寄せ */
  align-items: center;       /* ← 横方向の中央寄せ（任意） */              
  position: relative;
  overflow: visible;
}

/* フッター */
.footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  background-color: var(--main-color);
  color: white;
  height: clamp(60px, 10vw, 150px);
  font-size: clamp(12px, 2vw, 22px);
  font-weight: 600;
}

.footer a {
  color: white;
  text-decoration: none;
}

.syn-triple {
  display: inline-flex;
  align-items: baseline;
  gap: 16px;          /* ★ 単語間の少しスペース */
}
.syn-gap { width: 8px; display: inline-block; } /* 任意: さらに微調整したければ */
.syn-word { display: inline-block; }

/* ===== Synonym 一覧 ===== */
#SynTQ-List-container {
  overflow: auto;              /* スクロールはコンテナ内に */
}

#synonym-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;         /* 列幅を安定させる */
  font-size: 18px;
}

#synonym-table col.jp  { width: 34%; }
#synonym-table col.en  { width: 20%; }  /* 英語1/2/3 用に3本 */
#synonym-table col.chk { width: 6%; }   /* チェック列を小さめに */

#synonym-table th,
#synonym-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--sub1-color, #ddd);
  word-break: break-word;
}

#synonym-table thead th {
  position: sticky;   /* ← ヘッダを固定 */
  top: -10px;
  background: #fff;   /* スクロール中の重なり対策 */
  z-index: 2;
  /* box-shadow: 0 1px 0 rgba(0,0,0,0.08); */
  box-shadow: 0 1px 0 var(--sub1-color);  
}

#synonym-table th.chk,
#synonym-table td.chk {
  text-align: center;
}

.learned-checkbox {
  transform: scale(1.2);
  cursor: pointer;
}
