/* ==========================================================================
   Karadakara Training Game Legacy CSS
   ========================================================================== */

#t-base {
  width: 100%;
  text-align: center;
  margin-top: 15px;
  font-family: "MS PGothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: #333333;
}

#t-content {
  width: 800px;
  text-align: left;
  margin: 0 auto;
  position: relative;
}

/* ゲームメイン枠トップ */
.tmt {
  background-image: url(/training/img/tmt-back.jpg);
  background-repeat: no-repeat;
  width: 800px;
  height: 65px;
}

.tmm {
  background-image: url(/training/img/tmm-back.jpg);
  background-repeat: repeat-y;
  width: 750px;
  padding: 15px 25px 25px 25px;
  min-height: 400px;
}

.tmb {
  background-image: url(/training/img/tmb-back.jpg);
  background-repeat: no-repeat;
  width: 800px;
  height: 25px;
}

/* メイン枠内・上部 */
.tmt-ta {
  width: 800px;
}

.tmt-ta td {
  padding: 12px 0 7px 20px;
  vertical-align: middle;
}

.tmt-ta td h1 {
  margin: 0;
  padding: 0 0 4px 0;
  font-size: 16px;
  font-weight: bold;
  color: #333333;
}

.tmt-ta td h2 {
  margin: 0;
  padding: 0;
  font-size: 12px;
  font-weight: normal;
  color: #666666;
}

.tmt-ta th {
  padding: 12px 25px 7px 0;
  color: #335599;
  font-size: 14px;
  text-align: right;
  vertical-align: middle;
}

.tmt-ta th input#count {
  width: 60px;
  height: 25px;
  color: #335599;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  margin-left: 5px;
  vertical-align: middle;
  border: 1px solid #cccccc;
  background-color: #ffffff;
}

/* 問題表示エリア (文字計算) */
.question-moji {
  background-image: url(/training/img/num/q-back.gif);
  background-repeat: no-repeat;
  background-position: center;
  height: 60px;
  width: 750px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 5px auto;
}

.question-moji input#vsiki {
  border: 0;
  background: transparent;
  width: 650px;
  font-size: 26px;
  font-weight: bold;
  text-align: center;
  color: #222222;
  letter-spacing: 2px;
}

/* 問題表示エリア (四則演算) */
.question-num {
  background-image: url(/training/img/num/q-back.gif);
  background-repeat: no-repeat;
  background-position: center;
  height: 60px;
  width: 750px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 5px auto;
  gap: 8px;
}

.question-num input.siki {
  border: 0;
  background: transparent;
  width: 55px;
  font-size: 28px;
  font-weight: bold;
  text-align: center;
  color: #222222;
}

.question-num input#vsiki4 {
  width: 35px;
}

/* 正解・不正解メッセージ表示エリア */
.answer {
  text-align: center;
  height: 35px;
  margin-bottom: 10px;
}

.answer input#print {
  border: 0;
  background: transparent;
  width: 400px;
  font-size: 18px;
  font-weight: bold;
  text-align: center;
}

/* テンキーエリア */
table.num {
  margin: 0 auto;
  border-collapse: collapse;
  background-image: url(/training/img/num/wak-m.jpg);
  background-repeat: repeat-y;
  background-position: center;
  width: 253px;
}

table.num th {
  padding: 0;
  line-height: 0;
}

table.num td {
  padding: 0;
  text-align: center;
  vertical-align: middle;
}

table.num td a img {
  display: block;
  cursor: pointer;
  user-select: none;
}

table.num td.time {
  padding: 5px 0;
  background-image: url(/training/img/num/time-back.gif);
  background-repeat: no-repeat;
  background-position: center;
}

table.num td.time input#timer {
  border: 0;
  background: transparent;
  width: 140px;
  height: 28px;
  font-size: 22px;
  font-weight: bold;
  color: #335599;
  text-align: center;
}

/* ==========================================================================
   記憶追跡ゲーム用スタイル (kid: 101)
   ========================================================================== */
table.kioku {
  margin: 15px auto;
  border-collapse: collapse;
  background-image: url(/training/img/kioku/wak-m.jpg);
  background-repeat: repeat-y;
  background-position: center;
  width: 560px;
}

table.kioku th {
  padding: 0;
  line-height: 0;
}

table.kioku td {
  padding: 10px 8px;
  text-align: center;
  vertical-align: middle;
}

table.kioku td a img {
  display: block;
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
  transition: transform 0.1s;
}

table.kioku td a img:hover {
  transform: scale(1.05);
}

#nextPanel {
  position: absolute;
  top: 120px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  width: 380px;
  padding: 25px 20px;
  text-align: center;
  z-index: 15;
}

#nextPanelMsg {
  font-size: 17px;
  color: #333333;
  margin-bottom: 15px;
  line-height: 1.5;
}

#nextPanelMsg b {
  color: #cc0000;
  font-size: 20px;
}

.kioku-msg-area {
  text-align: center;
  margin: 10px auto;
  height: 32px;
}

.kioku-msg-area input#msg {
  border: none;
  background: transparent;
  font-size: 18px;
  font-weight: bold;
  color: #335599;
  text-align: center;
  width: 100%;
}

/* オーバーレイ共通 */
div.stendback, div#stendback4, div#startback4 {
  position: absolute;
  opacity: 0.75;
  filter: alpha(opacity=75);
  background-color: #000000;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 100;
}

div#stendback2, div#startback3, div#stendback3 {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  z-index: 200;
  text-align: center;
}

div.stend {
  margin: 0 auto;
  background-color: transparent;
}

div#stmsg, div#endMsg, div.rule-container, div.end-container {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  width: 520px;
  margin: 0 auto;
  padding: 25px 30px;
  box-sizing: border-box;
  color: #333333;
  text-align: center;
}

div.stend-com, .rule-container {
  padding: 0;
}

div.stend-com h3, .rule-container h3 {
  font-size: 22px;
  color: #335599;
  margin: 0 0 10px 0;
  font-weight: bold;
}

div.stend-com strong, p.rule-desc {
  font-size: 15px;
  line-height: 1.6;
  color: #444444;
  display: block;
  margin: 12px 0 20px;
}

.btn-start-legacy, .btn-start-custom {
  background: linear-gradient(to bottom, #ff9800, #f57c00);
  color: #ffffff;
  border: none;
  border-radius: 20px;
  padding: 10px 36px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.25);
  transition: all 0.15s ease;
}

.btn-start-legacy:hover, .btn-start-custom:hover {
  background: linear-gradient(to bottom, #ffa726, #ef6c00);
  transform: translateY(-2px);
}

/* ルールオーバーレイ (#rules 互換) */
div#rules {
  position: absolute;
  top: 60px;
  left: 0;
  width: 100%;
  z-index: 200;
  text-align: center;
}

div#rules-box {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  width: 520px;
  margin: 0 auto;
  padding: 25px 30px;
  box-sizing: border-box;
  color: #333333;
  text-align: center;
}

h3#rules-title {
  font-size: 22px;
  color: #335599;
  margin: 0 0 10px 0;
  font-weight: bold;
}

p#rules-text {
  font-size: 15px;
  line-height: 1.6;
  color: #444444;
  margin: 12px 0 20px;
}

div.stend-img {
  margin-top: 20px;
}

div.stend-img input[type="image"] {
  cursor: pointer;
  transition: transform 0.15s;
}

div.stend-img input[type="image"]:hover {
  transform: scale(1.03);
}

/* 終了結果オーバーレイ */
div#stendback3 {
  position: absolute;
  top: 50px;
  left: 0;
  width: 100%;
  z-index: 200;
  text-align: center;
}

div#endMsg {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
  width: 520px;
  margin: 0 auto;
  padding: 25px 30px;
  box-sizing: border-box;
  color: #333333;
  text-align: center;
}

div#endMsg h3#resmsg {
  font-size: 22px;
  color: #335599;
  margin: 0 0 8px 0;
  font-weight: bold;
}

div#endMsg #restimerh3 {
  font-size: 20px;
  color: #333333;
  margin: 6px 0;
  font-weight: bold;
}

div#endMsg #restimer {
  color: #d96d00 !important;
  font-size: 24px !important;
  font-weight: bold !important;
  border: none !important;
  background: transparent !important;
  width: 5em !important;
  text-align: left !important;
}

div#endMsg table {
  margin: 0 auto;
}

div#endMsg p {
  color: #555555;
  font-size: 13px;
  margin: 8px 0 12px 0;
}

table.stend-ta {
  margin: 15px auto 0 auto;
  max-width: 100%;
}

table.stend-ta th {
  padding: 6px 10px;
  text-align: center;
}

#endMsg img#param-imgsubmit,
#endMsg input#param-imgsubmit,
table.stend-ta img#param-imgsubmit,
table.stend-ta input#param-imgsubmit,
img[src*="end.gif"],
input[src*="end.gif"] {
  max-width: 100%;
  height: auto;
  cursor: pointer;
  display: inline-block;
  vertical-align: middle;
}

table.stend-ta #param-next-link img {
  max-width: 100%;
  height: auto;
}

/*--メイン枠内・ABC探索ゲーム用--*/
.abc {
  margin: 10px auto;
  background-image: url(/training/img/abc/wak-back.gif);
  background-repeat: no-repeat;
  width: 568px;
  height: 310px;
}
.abc-time {
  text-align: center;
  margin: 15px auto;
}
.abc-time input {
  background-image: url(/training/img/abc/time-back.jpg);
  background-repeat: no-repeat;
  text-align: right;
  border: none;
  font-size: 22px;
  font-weight: bold;
  color: #555555;
  width: 307px;
  height: 42px;
  padding: 8px 20px;
  box-sizing: border-box;
  vertical-align: middle;
}

/*--メイン枠内・カラー判断ゲーム用--*/
.question-color {
  background-image: url(/training/img/color/color-q-back.gif);
  background-repeat: no-repeat;
  background-position: center;
  height: 60px;
  width: 100%;
  max-width: 660px;
  margin: 10px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.color-q-answer {
  font-size: 16px;
  font-weight: bold;
}

/* ==========================================================================
   Responsive Mobile Optimization (max-width: 768px)
   ========================================================================== */
@media screen and (max-width: 768px) {
  #t-content {
    width: 100% !important;
    padding: 0 5px;
    box-sizing: border-box;
  }

  .tmt {
    width: 100% !important;
    height: auto;
    background-size: cover;
    padding: 10px;
    box-sizing: border-box;
  }

  .tmt-ta {
    width: 100% !important;
  }

  .tmt-ta td, .tmt-ta th {
    display: block;
    width: 100% !important;
    text-align: center !important;
    padding: 5px !important;
  }

  .tmm {
    width: 100% !important;
    box-sizing: border-box;
    padding: 15px 10px;
    background-size: 100% 100%;
  }

  .tmb {
    width: 100% !important;
    background-size: cover;
  }

  .question-moji, .question-num {
    width: 100% !important;
    background-size: 100% 100%;
    height: 50px;
  }

  .question-moji input#vsiki {
    width: 90% !important;
    font-size: 18px !important;
  }

  .question-num input.siki {
    width: 35px !important;
    font-size: 20px !important;
  }

  table.kioku {
    width: 100% !important;
    max-width: 360px !important;
    background-size: 100% 100% !important;
  }

  table.kioku th img {
    width: 100% !important;
    height: auto !important;
  }

  table.kioku td {
    padding: 4px 2px !important;
  }

  table.kioku td a img {
    width: 48px !important;
    height: 48px !important;
    margin: 0 auto !important;
  }

  #nextPanel {
    width: 90% !important;
    max-width: 320px !important;
    top: 100px !important;
  }

  .answer input#print {
    width: 95% !important;
    font-size: 15px !important;
  }

  div.stendback {
    width: 100% !important;
    height: 100% !important;
  }

  div#stendback2 {
    top: 60px !important;
    padding: 0 10px;
    box-sizing: border-box;
  }

  div#stmsg {
    width: 100% !important;
    max-width: 320px !important;
    height: auto !important;
    min-height: 250px !important;
    background-size: 100% 100% !important;
    padding: 28px 15px 20px 15px !important;
    margin: 0 auto !important;
    box-sizing: border-box;
  }

  div.stend-com h3 {
    font-size: 18px !important;
    margin-bottom: 8px !important;
  }

  div.stend-com strong {
    font-size: 13px !important;
    line-height: 1.5 !important;
  }

  div.stend-img {
    margin-top: 15px !important;
  }

  div.stend-img input[type="image"] {
    max-width: 80% !important;
    height: auto !important;
  }

  div#endMsg {
    width: 92% !important;
    max-width: 340px !important;
    height: auto !important;
    min-height: auto !important;
    background-size: 100% 100% !important;
    padding: 20px 12px !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  table.stend-ta {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin: 10px auto 0 auto !important;
  }

  table.stend-ta th {
    padding: 4px 2px !important;
  }

  #endMsg img#param-imgsubmit,
  #endMsg input#param-imgsubmit,
  table.stend-ta img#param-imgsubmit,
  table.stend-ta input#param-imgsubmit,
  img[src*="end.gif"],
  input[src*="end.gif"] {
    width: 100% !important;
    max-width: 280px !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
  }

  #endMsg button#param-imgsubmit,
  .btn-record-custom,
  .btn-start-legacy {
    width: 100% !important;
    max-width: 280px !important;
    box-sizing: border-box !important;
    padding: 10px 15px !important;
    font-size: 15px !important;
  }

  table.stend-ta #param-next-link th {
    padding: 6px 4px !important;
  }

  table.stend-ta #param-next-link img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* ABCゲーム モバイル対応 */
  .abc {
    width: 100% !important;
    max-width: 568px !important;
    background-size: contain !important;
    overflow-x: auto;
  }

  /* カラー判断ゲーム モバイル対応 */
  .question-color {
    background-size: contain !important;
  }
  .color-btn img {
    max-width: 100% !important;
    height: auto !important;
  }
}
