/* リセットCSS */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 基本スタイル */
body {
  font-family: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ヘッダー */
header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: relative;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo {
  font-size: 1.8rem;
  font-weight: bold;
  text-decoration: none;
  color: white;
}

/* ハンバーガーメニュー */
.hamburger-menu {
  display: flex;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger-line {
  width: 25px;
  height: 3px;
  background: white;
  margin: 3px 0;
  transition: 0.3s;
  border-radius: 2px;
}

.hamburger-menu.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(6.5px, 6px);
}

.hamburger-menu.active .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-menu.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(6.5px, -6px);
}

.nav-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: #667eea;
  min-width: 250px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  border-radius: 5px;
  z-index: 1000;
}

.nav-menu.active {
  display: block;
}

.nav-menu ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  gap: 0;
  margin: 0;
  padding: 1rem 0;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0;
  transition: background-color 0.3s;
  display: block;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-menu a:hover {
  background-color: rgba(255,255,255,0.1);
}

.nav-menu li:last-child a {
  border-bottom: none;
}

/* ドロップダウンメニュー */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: block;
  position: static;
  background: rgba(255,255,255,0.1);
  min-width: auto;
  box-shadow: none;
  border-radius: 0;
  margin: 0;
}

.dropdown-menu li {
  margin: 0;
}

.dropdown-menu a {
  color: rgba(255,255,255,0.9);
  padding: 0.5rem 2rem;
  border-radius: 0;
  white-space: nowrap;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-menu a:hover {
  background-color: rgba(255,255,255,0.1);
  color: white;
}

/* メインコンテンツ */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 200px);
}

.page-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 2rem;
  color: #2c3e50;
}

.subtitle {
  text-align: center;
  font-size: 1.2rem;
  color: #7f8c8d;
  margin-bottom: 3rem;
}

/* カード */
.card {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card ul {
  margin-left: 1em;
}

.card ol {
  margin-left: 1em;
}

.card h2 {
  margin-bottom: 1.5rem;
}

.card h3 {
  margin-bottom: 1.5rem;
}

.card h4 {
  margin-bottom: 1rem;
}

.card p {
  margin-bottom: 1.5rem;
}

.card li {
  margin-bottom: 0.8rem;
}

/* 練習問題メニュー */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.menu-item {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  transition: all 0.3s;
  text-decoration: none;
  color: #333;
}

.menu-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.menu-item h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: #2c3e50;
}

.menu-item p {
  color: #7f8c8d;
  font-size: 0.9rem;
}

/* 問題表示 */
.problem {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.wind-info {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.5rem;
  justify-content: center;
}

.wind {
  background: #3498db;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  font-weight: bold;
}

.melded-sets-display {
  margin: 1rem 0;
  text-align: center;
}

.melded-set {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.5rem;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 5px;
  border: 2px solid #e74c3c;
}

.meld-type {
  display: inline-block;
  background: #e74c3c;
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-right: 0.5rem;
}

.tiles {
  text-align: center;
  margin: 2rem 0;
}

.tile-display {
  margin: 1rem 0;
  text-align: center;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  min-height: 100px;
}

.meld-info {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.meld-label {
  background: #3498db;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
}

.mahjong-tile {
  width: 60px;
  height: 80px;
  margin: 0 4px;
  vertical-align: middle;
  display: inline-block;
  transition: transform 0.2s;
}

/* 明の牌（色で区別） */
.tile-melded {
  transform: rotate(0deg);
  margin: 0 4px;
  opacity: 0.8;
}

/* 暗の牌（縦向き・通常） */
.tile-concealed {
  transform: rotate(0deg);
  margin: 0 4px;
}


.hand-display {
  margin: 2rem 0;
}

/* 牌を横並びに表示するためのコンテナ */
.tile-display {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  min-height: 100px;
  flex-wrap: wrap;
  overflow: visible;
}

/* 鳴きセットを横並びに表示 */
.melded-sets-display {
  margin: 1rem 0;
  padding: 1rem;
  background: rgba(241, 196, 15, 0.1);
  border-radius: 10px;
  border: 2px solid #f1c40f;
}

.melded-sets-display.no-border {
  background: transparent;
  border: none;
  padding: 0;
}

.melded-sets-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1rem;
}

.melded-set {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 8px;
  border: 2px solid #e74c3c;
  min-width: 120px;
}

.meld-type-label {
  background: #e74c3c;
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.meld-tiles {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

.hand, .win-tile {
  text-align: center;
}

.label {
  font-weight: bold;
  color: #2c3e50;
  margin-right: 1rem;
}

.dora-display {
  text-align: center;
  margin: 1.5rem 0;
  font-size: 1.2rem;
}

.win-type {
  text-align: center;
  margin: 1.5rem 0;
  font-size: 1.2rem;
}

.bonus-info {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}

.kyotaku-display,
.honba-display,
.riichi-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.8);
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 2px solid #ddd;
}

.kyotaku-stick {
  width: 140px;
  margin: 0 2px;
}

.honba-stick {
  width: 140px;
  margin: 0 2px;
}

.riichi-stick {
  width: 140px;
  margin: 0 2px;
}

.bonus-count {
  font-weight: bold;
  color: #333;
  margin-left: 0.5rem;
}

/* 計算過程での牌表示 */
.calculation-tiles {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0.5rem 0;
  flex-wrap: wrap;
}

.calculation-tiles .mahjong-tile {
  width: 32px;
  height: 42px;
  margin: 0 1px;
}

.calculation-tiles .tile-label {
  font-weight: bold;
  margin-right: 0.5rem;
  color: #2c3e50;
}

.calculation-tiles .win-tile {
  border: 2px solid #27ae60;
  border-radius: 4px;
}

.calculation-tiles .melded {
  opacity: 0.7;
}

.calculation-tiles .small .mahjong-tile {
  width: 28px;
  height: 37px;
}

/* ボタン */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 5px;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  margin: 0.5rem;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.btn-center {
  text-align: center;
  margin: 0 0 2rem;
}

/* 答え表示 */
.answer {
  background: #ecf0f1;
  border-radius: 10px;
  padding: 2rem;
  margin-top: 2rem;
  border-left: 5px solid #3498db;
}

.answer-value {
  font-size: 2rem;
  font-weight: bold;
  color: #2c3e50;
  text-align: center;
  margin-bottom: 1.5rem;
}

.calculation {
  margin: 1.5rem 0;
}

.calculation h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

.calculation-steps {
  background: white;
  padding: 1.5rem;
  border-radius: 5px;
  border-left: 3px solid #3498db;
}

.calculation-steps strong {
  color: #d32f2f;
  font-weight: bold;
  font-size: 1.1em;
}

/* 計算ステップ内の牌表示 */
.calculation-tiles {
  margin: 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

.calculation-tiles .mahjong-tile {
  width: 32px;
  height: 42px;
  margin: 0 1px;
}

.calculation-tiles .tile-label {
  font-size: 0.9rem;
  color: #666;
  margin-right: 0.5rem;
  font-weight: 500;
}

.calculation-tiles .win-tile {
  border: 2px solid #28a745;
  border-radius: 4px;
}

.calculation-tiles .melded {
  opacity: 0.8;
}

.calculation-tiles .small {
  width: 28px;
  height: 37px;
}

.step {
  margin: 0.5rem 0;
  padding: 0.5rem 0;
  border-bottom: 1px solid #ecf0f1;
}

.step:last-child {
  border-bottom: none;
}

/* 符計算表 */
.fu-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: white;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.fu-table th,
.fu-table td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid #ecf0f1;
}

.fu-table th {
  background: #34495e;
  color: white;
  font-weight: bold;
}

.fu-table tr:last-child td {
  border-bottom: none;
}

.fu-table tr:nth-child(even) {
  background: #f8f9fa;
}

.fu-table .highlight {
  background: #e74c3c !important;
  color: white;
  font-weight: bold;
}

.fu-table-section {
  margin: 2rem 0;
}

.fu-table-section h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
}

/* フッター */
footer {
  background: #2c3e50;
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 3rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: #ecf0f1;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #ecf0f1;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid #34495e;
  color: #bdc3c7;
}

/* レスポンシブデザイン */

/* PC画面縮小時の調整 */
@media (max-width: 1024px) {
  .tile-display {
    gap: 3px;
  }
  
  /* 手牌のみ左寄せ */
  .hand .tile-display {
    justify-content: flex-start;
  }
  
  /* fu-summary, han, points, full-scoring ページでは tile-display 内の牌を調整 */
  body[data-page="fu-summary"] .tile-display .mahjong-tile,
  body[data-page="han"] .tile-display .mahjong-tile,
  body[data-page="points"] .tile-display .mahjong-tile,
  body[data-page="full-scoring"] .tile-display .mahjong-tile {
    width: 48px;
    height: 64px;
    margin: 0 1px;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    left: 0;
    right: 0;
    width: calc(100% - 2rem);
    min-width: auto;
    margin: 0 1rem;
  }
  
  .nav-menu a {
    padding: 1rem 1.5rem;
  }
  
  .dropdown-menu a {
    padding: 0.75rem 2.5rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .page-title {
    font-size: 1.6rem;
  }
  
  .logo {
    font-size: 1.4rem;
  }
  
  .menu-grid {
    grid-template-columns: 1fr;
  }
  
  .wind-info {
    flex-direction: column;
    gap: 1rem;
  }
  
  .bonus-info {
    flex-direction: column;
    gap: 1rem;
    align-items: center;
  }
  
  .kyotaku-display,
  .honba-display,
  .riichi-display {
    max-width: 100%;
    overflow: hidden;
    flex-wrap: wrap;
  }
  
  .mahjong-tile {
    width: 44px;
    height: 58px;
    margin: 0 1px;
  }
  
  /* 鳴きセットのレスポンシブ対応 */
  .melded-sets-container {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .melded-set {
    min-width: auto;
    width: 100%;
  }
  
  .tile-display {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
    max-width: 100%;
  }
  
  /* 手牌のみ左寄せ */
  .hand .tile-display {
    justify-content: flex-start;
  }
  
  .container {
    padding: 0 15px;
  }
  
  .card {
    padding: 1.5rem;
  }
}

/* 中間サイズのデバイス向け */
@media (max-width: 580px) {
  .mahjong-tile {
    width: 38px;
    height: 50px;
    margin: 0;
  }
  
  /* mentsu, atama, machi ページでは牌サイズを大きく保つ */
  body[data-page="mentsu"] .mahjong-tile,
  body[data-page="atama"] .mahjong-tile,
  body[data-page="machi"] .mahjong-tile {
    width: 50px;
    height: 66px;
    margin: 0 2px;
  }
  
  /* fu-summary, han, points, full-scoring ページでは tile-display 内の牌を調整 */
  body[data-page="fu-summary"] .tile-display .mahjong-tile,
  body[data-page="han"] .tile-display .mahjong-tile,
  body[data-page="points"] .tile-display .mahjong-tile,
  body[data-page="full-scoring"] .tile-display .mahjong-tile {
    width: 42px;
    height: 56px;
    margin: 0 1px;
  }
  
  /* 計算ステップ内の牌調整 */
  .calculation-tiles .mahjong-tile {
    width: 28px;
    height: 37px;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .logo {
    font-size: 1.3rem;
  }
  
  .tile-display {
    gap: 1px;
  }
}

@media (max-width: 480px) {
  .mahjong-tile {
    width: 34px;
    height: 45px;
    margin: 0;
  }
  
  /* mentsu, atama, machi ページでは牌サイズを大きく保つ */
  body[data-page="mentsu"] .mahjong-tile,
  body[data-page="atama"] .mahjong-tile,
  body[data-page="machi"] .mahjong-tile {
    width: 45px;
    height: 60px;
    margin: 0 2px;
  }
  
  /* fu-summary, han, points, full-scoring ページでは tile-display 内の牌を調整 */
  body[data-page="fu-summary"] .tile-display .mahjong-tile,
  body[data-page="han"] .tile-display .mahjong-tile,
  body[data-page="points"] .tile-display .mahjong-tile,
  body[data-page="full-scoring"] .tile-display .mahjong-tile {
    width: 38px;
    height: 50px;
    margin: 0 1px;
  }
  
  /* 計算ステップ内の牌調整 */
  .calculation-tiles .mahjong-tile {
    width: 24px;
    height: 32px;
  }
  
  .page-title {
    font-size: 1.4rem;
  }
  
  .logo {
    font-size: 1.2rem;
  }
  
  .tile-display {
    gap: 1px;
  }
}

/* 非常に小さいスマホ向け */
@media (max-width: 360px) {
  .mahjong-tile {
    width: 28px;
    height: 37px;
    margin: 0;
  }
  
  /* mentsu, atama, machi ページでは牌サイズを大きく保つ */
  body[data-page="mentsu"] .mahjong-tile,
  body[data-page="atama"] .mahjong-tile,
  body[data-page="machi"] .mahjong-tile {
    width: 40px;
    height: 53px;
    margin: 0 1px;
  }
  
  /* fu-summary, han, points, full-scoring ページでは tile-display 内の牌を調整 */
  body[data-page="fu-summary"] .tile-display .mahjong-tile,
  body[data-page="han"] .tile-display .mahjong-tile,
  body[data-page="points"] .tile-display .mahjong-tile,
  body[data-page="full-scoring"] .tile-display .mahjong-tile {
    width: 32px;
    height: 42px;
    margin: 0;
  }
  
  /* 計算ステップ内の牌調整 */
  .calculation-tiles .mahjong-tile {
    width: 20px;
    height: 26px;
  }
  
  .page-title {
    font-size: 1.2rem;
  }
  
  .logo {
    font-size: 1.1rem;
  }
  
  .tile-display {
    gap: 1px;
    max-width: 100%;
  }
  
  .kyotaku-stick {
    width: 70px;
  }
  
  .honba-stick {
    width: 70px;
  }
  
  .riichi-stick {
    width: 70px;
  }
  
  .page-title {
    font-size: 1.8rem;
  }
  
  .btn {
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
  }
  
  .card {
    padding: 1rem;
  }
}

/* アニメーション */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

/* 隠し要素 */
.hidden {
  display: none;
}

/* ローディング */
.loading {
  text-align: center;
  padding: 0 0 2rem;
  font-size: 1.2rem;
  color: #7f8c8d;
}

/* 問題表示 */
.problem-display {
  text-align: center;
  margin: 2rem 0;
}

/* 問題コンテナ */
#problem-container {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  border: 2px solid #3498db;
  margin: 2rem 0;
}

/* 場風・自風表示 */
.wind-display {
  display: flex;
  justify-content: center;
  gap: 3rem;
  margin: 0 auto 2rem;
  padding: 1rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 500px;
}

.wind-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.wind-tile {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  min-width: 2.5rem;
  text-align: center;
}

.bakaze .wind-tile {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: white;
}

.jikaze .wind-tile {
  background: linear-gradient(135deg, #4ecdc4, #44bd32);
  color: white;
}

/* 牌表示 */
.tiles-display {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

/* mentsu、atama、machi以外の問題での牌表示（スマホ時の改行対応） */
@media (max-width: 768px) {
  body:not(.page-mentsu):not(.page-atama):not(.page-machi) .tiles-display {
    flex-wrap: wrap;
    max-width: 100%;
    justify-content: flex-start;
  }
  
  body:not(.page-mentsu):not(.page-atama):not(.page-machi) .tiles-display .mahjong-tile {
    max-width: calc(16.666% - 0.3rem);
    min-width: 40px;
  }
}

.mahjong-tile {
  height: 80px;
  width: auto;
  border-radius: 6px;
  transition: transform 0.2s ease;
}

/* tiles-display内の牌はホバー効果を無効化 */
.tiles-display .mahjong-tile:hover {
  transform: none;
}

/* 鳴き表示 */
.meld-display {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.meld-action {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
  display: inline-block;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* 鳴き牌セット表示 */
.melded-sets-display {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
}

.melded-label {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  text-align: center;
}

.melded-set {
  margin-bottom: 1rem;
  padding: 0.8rem;
  background: white;
  border-radius: 6px;
  border: 1px solid #ddd;
  text-align: center;
}

.meld-type-label {
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.melded-tiles {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2px;
}

/* 翻数問題表示 */
.han-problem-display {
  text-align: center;
  padding: 2rem;
}

.han-problem-display h3 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.yaku-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.yaku-item-display {
  background: linear-gradient(135deg, #8e44ad, #9b59b6);
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1.2rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(142, 68, 173, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  min-width: 200px;
}

/* 点数問題表示 */
.points-problem-display {
  text-align: center;
  padding: 2rem;
}

.points-problem-display h3 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

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

.points-item-display {
  background: linear-gradient(135deg, #e67e22, #f39c12);
  color: white;
  padding: 1.5rem 3rem;
  border-radius: 30px;
  font-size: 1.5rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  min-width: 250px;
}

/* 総合点数問題表示 */
.full-scoring-problem-display {
  text-align: center;
  padding: 2rem;
}

.full-scoring-problem-display h3 {
  color: #2c3e50;
  margin-bottom: 1.5rem;
  font-size: 1.3rem;
}

.full-scoring-info {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.full-scoring-item-display {
  color: white;
  padding: 1rem 2rem;
  border-radius: 25px;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  min-width: 200px;
}

.full-scoring-item-display.main {
  background: linear-gradient(135deg, #e67e22, #f39c12);
  box-shadow: 0 4px 12px rgba(230, 126, 34, 0.3);
  font-size: 1.5rem;
  padding: 1.5rem 3rem;
}

.full-scoring-item-display.bonus {
  background: linear-gradient(135deg, #16a085, #1abc9c);
  box-shadow: 0 4px 12px rgba(22, 160, 133, 0.3);
}

/* アガリ牌・アガリ方表示 */
.win-info {
  margin: 1.5rem auto 0;
  padding: 1rem;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3);
  display: flex;
  gap: 2rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 500px;
}

.win-tile-section,
.win-type-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.win-label {
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.win-type-display {
  background: rgba(255, 255, 255, 0.9);
  color: #2c3e50;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 本場・供託表示 */
.bonus-info-display {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

.bonus-item {
  background: linear-gradient(135deg, #f39c12, #e67e22);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 3px 8px rgba(243, 156, 18, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* 待ち牌表示（後方互換用） */
.machi-info {
  margin-top: 1.5rem;
  padding: 1rem;
  background: linear-gradient(135deg, #27ae60, #2ecc71);
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(39, 174, 96, 0.3);
}

.machi-tile-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.machi-label {
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

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

.meld-action {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  font-weight: bold;
  font-size: 1.1rem;
  box-shadow: 0 3px 8px rgba(231, 76, 60, 0.3);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
  .wind-display {
    gap: 2rem;
    margin-bottom: 1.5rem;
  }
  
  .wind-item {
    font-size: 1rem;
  }
  
  .wind-tile {
    font-size: 1.2rem;
    padding: 0.4rem 0.8rem;
  }
  
  .mahjong-tile {
    height: 50px;
  }
  
  .meld-action {
    font-size: 1rem;
    padding: 0.4rem 1.2rem;
  }
}

/* 答え表示スタイル */
.answer-display {
  background: #fff;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin: 2rem 0;
}

.answer-result {
  font-size: 1.4rem;
  font-weight: bold;
  color: #e74c3c;
  text-align: center;
  padding: 0.8rem;
  margin-bottom: 1.5rem;
  border: 2px solid #e74c3c;
  border-radius: 8px;
  background-color: #fff5f5;
}

.calculation-process {
  margin: 1.5rem 0;
}

.calculation-process h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.calculation-steps {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #3498db;
}

.calculation-step {
  font-size: 1.0rem;
  line-height: 1.6;
  margin: 0.5rem 0;
  color: #2c3e50;
}

/* fuSummary用の計算ステップスタイル */
.calculation-step.title {
  font-size: 1.4rem;
  font-weight: bold;
  color: #2c3e50;
  text-align: center;
  margin: 1rem 0;
  padding: 0.5rem;
  border-bottom: 2px solid #3498db;
}

.calculation-step.process {
  font-size: 1rem;
  color: #555;
  margin: 0.3rem 0;
  padding: 0.3rem 1rem;
  background: #f8f9fa;
}

.fu-calculation-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1rem;
}

.fu-calculation-table th,
.fu-calculation-table td {
  border: 1px solid #ddd;
  padding: 0.75rem;
  text-align: left;
}

.fu-calculation-table th {
  background-color: #3498db;
  color: white;
  font-weight: bold;
  text-align: center;
}

.fu-calculation-table tbody tr:nth-child(even) {
  background-color: #f8f9fa;
}

.fu-calculation-table tbody tr:hover {
  background-color: #e3f2fd;
}

.fu-calculation-table td:nth-child(2) {
  text-align: center;
  font-weight: bold;
  color: #e74c3c;
}

.calculation-step.subtotal {
  font-size: 1.2rem;
  font-weight: bold;
  color: #e67e22;
  margin: 0.8rem 0;
  padding: 0.5rem 1rem;
  background: #fef9e7;
  border: 2px solid #f39c12;
  border-radius: 5px;
}

.calculation-step.result {
  font-size: 1.3rem;
  font-weight: bold;
  color: #e74c3c;
  text-align: center;
  margin: 1rem 0;
  padding: 0.8rem;
  background: linear-gradient(135deg, #fff5f5, #ffebee);
  border: 3px solid #e74c3c;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(231, 76, 60, 0.2);
}

.fu-table-section {
  margin-top: 2rem;
}

.fu-table-section h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* ボーナス表示スタイル */
.bonus-info-display {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin: 1rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #fff8e1, #f3e5ab);
  border: 2px solid #f39c12;
  border-radius: 10px;
}

.bonus-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.bonus-label {
  font-weight: bold;
  color: #d68910;
  font-size: 1.1rem;
}

.kyotaku-display, .honba-display {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.kyotaku-stick, .honba-stick {
  width: 80px;
  height: 24px;
  object-fit: contain;
}

.bonus-count {
  font-weight: bold;
  color: #b7950b;
  margin-left: 0.5rem;
}

/* リーチ棒表示スタイル */
.riichi-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 1rem;
  background: linear-gradient(135deg, #fef3cd, #fde68a);
  border: 2px solid #f59e0b;
  border-radius: 10px;
}

.riichi-label {
  font-weight: bold;
  color: #d97706;
  font-size: 1.1rem;
}

.riichi-stick {
  width: 120px;
  height: 24px;
  object-fit: contain;
}

/* 常時表示用点数早見表スタイル */
.points-reference-tables {
  margin: 0;
}

.points-reference-tables .points-table-section {
  margin-bottom: 2rem;
}

.points-reference-tables .points-table-section:last-child {
  margin-bottom: 0;
}

.points-reference-tables h4 {
  color: #2c3e50;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* 計算過程のセクション間マージン */
.calculation-step.section-header:not(:first-child) {
  margin-top: 2rem !important;
}

.calculation-step.section-header {
  font-weight: bold;
  color: #2c3e50;
}

/* スクロールヒントはデフォルトで非表示 */
.mobile-scroll-hint {
  display: none;
}

@media (max-width: 768px) {
  .answer-result {
    font-size: 1.2rem;
    padding: 0.6rem;
  }
  
  .calculation-step {
    font-size: 1rem;
  }
  
  /* 点数表のスマホ対応 */
  .fu-table-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .fu-table {
    min-width: 500px;
    font-size: 0.9rem;
  }
  
  .fu-table th,
  .fu-table td {
    padding: 0.5rem 0.3rem;
    white-space: nowrap;
  }
  
  /* 点数早見表のスマホ対応 */
  .points-reference-tables .points-table-section {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .points-reference-tables .fu-table {
    min-width: 600px;
    font-size: 0.8rem;
  }
  
  .points-reference-tables .fu-table th,
  .points-reference-tables .fu-table td {
    padding: 0.4rem 0.2rem;
  }
  
  /* テーブルラッパーのスクロール対応 */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1rem 0;
  }
  
  .table-wrapper .fu-table {
    min-width: 600px;
  }
  
  /* スマホ時のスクロールヒント */
  .mobile-scroll-hint {
    display: block;
    font-size: 0.8rem;
    color: #666;
    text-align: left;
  }
  
  /* 満貫表はスクロールなしで縮小表示 */
  .mangan-table-wrapper {
    overflow-x: visible;
  }
  
  .mangan-table-wrapper .fu-table {
    min-width: auto;
    width: 100%;
    font-size: 0.8rem;
  }
  
  .mangan-table-wrapper .fu-table th,
  .mangan-table-wrapper .fu-table td {
    padding: 0.4rem 0.2rem;
    font-size: 0.8rem;
  }
  
  /* 基本符計算表はスクロールなしで縮小表示 */
  [data-page="atama"] .table-wrapper,
  [data-page="machi"] .table-wrapper,
  [data-page="han"] .table-wrapper {
    overflow-x: visible;
  }
  
  [data-page="atama"] .table-wrapper .fu-table,
  [data-page="machi"] .table-wrapper .fu-table,
  [data-page="han"] .table-wrapper .fu-table {
    min-width: auto;
    width: 100%;
    font-size: 0.8rem;
  }
  
  [data-page="atama"] .table-wrapper .fu-table th,
  [data-page="atama"] .table-wrapper .fu-table td,
  [data-page="machi"] .table-wrapper .fu-table th,
  [data-page="machi"] .table-wrapper .fu-table td,
  [data-page="han"] .table-wrapper .fu-table th,
  [data-page="han"] .table-wrapper .fu-table td {
    padding: 0.4rem 0.2rem;
    font-size: 0.8rem;
  }
  
  /* 面子表は横スクロール対応（カラム数が多いため） */
  [data-page="mentsu"] .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  [data-page="mentsu"] .table-wrapper .fu-table {
    min-width: 400px;
    font-size: 0.9rem;
  }
}

/* パンくずリスト */
.breadcrumb {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  border: 1px solid #e1e8ed;
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
  content: '>';
  margin: 0 0.5rem;
  color: #6c757d;
  font-weight: bold;
}

.breadcrumb-link {
  color: #667eea;
  text-decoration: none;
  transition: color 0.3s ease;
}

.breadcrumb-link:hover {
  color: #5a67d8;
  text-decoration: underline;
}

.breadcrumb-current {
  color: #495057;
  font-weight: 500;
}

/* 関連記事 */
.related-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.related-item {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.related-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.related-link {
  display: flex;
  align-items: center;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
}

.related-icon {
  font-size: 2rem;
  margin-right: 1rem;
  flex-shrink: 0;
}

.related-content h4 {
  margin: 0 0 0.5rem 0;
  color: #333;
  font-size: 1rem;
  font-weight: 600;
}

.related-content p {
  margin: 0;
  color: #666;
  font-size: 0.875rem;
  line-height: 1.4;
}

@media (max-width: 768px) {
  .related-links {
    grid-template-columns: 1fr;
  }
  
  .related-link {
    padding: 0.75rem;
  }
  
  .related-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
  }
}

/* 初心者ガイド専用スタイル */
.tile-explanation {
  margin: 1.5rem 0;
}

.tile-category {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.tile-category h4 {
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.tiles-display {
  display: flex;
  align-items: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tile-sample {
  font-size: 2rem;
  margin-right: 0.5rem;
  background: white;
  padding: 0.25rem;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.tile-text {
  color: #666;
  font-size: 0.9rem;
  margin-left: 1rem;
}

.combination-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.combination-item {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 2px solid #e1e8ed;
  transition: all 0.3s ease;
}

.combination-item:hover {
  border-color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.combination-item h4 {
  color: #667eea;
  margin-bottom: 0.5rem;
}

.example {
  background: #f8f9fa;
  padding: 0.5rem;
  border-radius: 4px;
  margin-top: 0.5rem;
  font-family: monospace;
  color: #495057;
}

.yaku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.yaku-item {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #28a745;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.yaku-item h4 {
  color: #28a745;
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
}

.fu-elements {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.fu-element {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border-top: 4px solid #fd7e14;
}

.fu-element h4 {
  color: #fd7e14;
  margin-bottom: 1rem;
}

.fu-element ul {
  margin: 0;
  padding-left: 1.5rem;
}

.fu-element li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.learning-steps {
  margin: 2rem 0;
}

.step {
  display: flex;
  align-items: flex-start;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.step-number {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2rem;
  margin-right: 1.5rem;
  flex-shrink: 0;
}

.step-content h3 {
  color: #333;
  margin-bottom: 0.5rem;
}

.step-content p {
  color: #555;
  line-height: 1.6;
  margin: 0;
}

.internal-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
}

.internal-link:hover {
  text-decoration: underline;
}

.advice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.advice-item {
  background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #e53e3e;
}

.advice-item h3 {
  color: #e53e3e;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.advice-item p {
  color: #555;
  line-height: 1.6;
  margin: 0;
}

/* 計算テクニックのスタイル */
.calculation-technique {
  margin: 1.5rem 0;
}

.pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.pattern-item {
  background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #17a2b8;
  text-align: center;
}

.pattern-item h5 {
  color: #17a2b8;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.pattern-calc {
  font-weight: bold;
  color: #333;
  font-size: 0.85rem;
}

.quick-scoring {
  margin: 1.5rem 0;
}

.score-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 1rem 0;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
  border-radius: 6px;
  border-left: 4px solid #ff9800;
}

.fu-han {
  font-weight: bold;
  color: #ff9800;
  min-width: 80px;
}

.scores {
  font-family: monospace;
  color: #333;
  font-size: 0.9rem;
}

.calculation-order {
  margin: 1.5rem 0;
}

.step-by-step {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.calc-step-detail {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.step-num {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  margin-right: 1rem;
  flex-shrink: 0;
}

.step-desc h4 {
  color: #333;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.step-desc p {
  color: #555;
  margin: 0;
  font-size: 0.9rem;
}

/* 問題セクションのスタイル */
.answer {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #e8f5e8 0%, #d4edda 100%);
  border-radius: 8px;
  border-left: 4px solid #28a745;
}

.answer h5 {
  color: #155724;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.answer-content div {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.answer-content div:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .pattern-grid {
    grid-template-columns: 1fr;
  }
  
  .score-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .calc-step-detail {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .step-num {
    margin-right: 0;
    margin-bottom: 0.5rem;
  }
  
  /* advanced-scoring.htmlの牌画像をスマホ時に左寄せ */
  .tiles,
  .hand,
  .tiles-display,
  .hand-example .tiles,
  .hand-state .tiles,
  .problem-hand .tiles,
  .tenpai-example .tiles,
  .comparison-case .hand,
  .compare-item .hand {
    justify-content: flex-start !important;
    text-align: left !important;
    align-items: flex-start !important;
  }
}

/* 牌グループのスタイル */
.tile-group {
  display: inline-block;
  margin-right: 1rem;
}

.tile-group:last-child {
  margin-right: 0;
}

.tile-group .mahjong-tile {
  margin-right: 2px;
}

.tile-group .mahjong-tile:last-child {
  margin-right: 0;
}

/* よくある間違いページのスタイル */
.mistake-section {
  margin: 2rem 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.mistake-section h3 {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  color: white;
  margin: 0;
  padding: 1rem 1.5rem;
  font-size: 1.2rem;
}

.mistake-example {
  padding: 1.5rem;
}

.wrong-calculation, .correct-calculation {
  margin: 1.5rem 0;
  padding: 1rem;
  border-radius: 6px;
}

.wrong-calculation {
  background: #fff5f5;
  border: 1px solid #fed7d7;
}

.wrong-calculation h4 {
  color: #e53e3e;
  margin-bottom: 1rem;
}

.correct-calculation {
  background: #f0fff4;
  border: 1px solid #c6f6d5;
}

.correct-calculation h4 {
  color: #38a169;
  margin-bottom: 1rem;
}

.calc-step.error {
  color: #e53e3e;
  font-weight: bold;
}

.explanation {
  background: #edf2f7;
  padding: 1rem;
  border-radius: 6px;
  border-left: 4px solid #4299e1;
}

.explanation h4 {
  color: #2b6cb0;
  margin-bottom: 0.5rem;
}

.warning-box {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border: 1px solid #f6d55c;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
}

.warning-box h3 {
  color: #d69e2e;
  margin-bottom: 1rem;
}

.prevention-tips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.tip-item {
  background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid #3182ce;
}

.tip-item h3 {
  color: #2c5282;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.tip-item ul, .tip-item ol {
  color: #555;
  line-height: 1.6;
  margin: 0;
  padding-left: 1.5rem;
}

.tip-item li {
  margin-bottom: 0.5rem;
}

.improvement-advice {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.improvement-advice .advice-item {
  background: linear-gradient(135deg, #f7fafc 0%, #e2e8f0 100%);
  border-left-color: #4a5568;
}

.improvement-advice .advice-item h3 {
  color: #4a5568;
}

@media (max-width: 768px) {
  .tile-category {
    padding: 1rem;
  }
  
  .tiles-display {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
  }
  
  .tile-text {
    margin-left: 0;
    margin-top: 0.5rem;
  }
  
  .combination-grid,
  .yaku-grid,
  .fu-elements,
  .advice-grid {
    grid-template-columns: 1fr;
  }
  
  .step {
    flex-direction: column;
    text-align: center;
  }
  
  .step-number {
    margin-right: 0;
    margin-bottom: 1rem;
  }
}

/* ボタンスタイル */
.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .btn-primary {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
  }
}