* {
  box-sizing: border-box;
  min-width: 0;
}

html, body {
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  background: #0b3d24;
  color: #f2f2f2;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 8px 16px;
}

.app-header {
  text-align: center;
  margin-bottom: 8px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
}

.app-header h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: 1px;
}

.help-btn {
  position: absolute;
  right: 0;
  border: 1px solid #ffd166;
  background: transparent;
  color: #ffd166;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.subtitle {
  margin: 2px 0 0;
  color: #cfe8d8;
  font-size: 11px;
}

.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.table-area {
  background: #145c34;
  border: 4px solid #6b3f1d;
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.turn-banner {
  text-align: center;
  font-weight: bold;
  font-size: 13px;
  padding: 6px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #cfe8d8;
}

.turn-banner.my-turn {
  background: #2f7ab8;
  color: #fff;
}

.turn-banner.cpu-turn {
  background: rgba(0, 0, 0, 0.3);
  color: #cfe8d8;
}

.turn-banner.hand-over {
  background: #3f8f5c;
  color: #fff;
}

.stage-and-pot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 8px;
  padding: 5px 10px;
}

.stage-banner {
  font-size: 11px;
  line-height: 1.3;
}

.pot-display {
  font-size: 13px;
  font-weight: bold;
  color: #ffd166;
  white-space: nowrap;
}

.section-label {
  font-size: 11px;
  color: #a8e6b0;
  font-weight: bold;
  margin: 0 0 -2px 2px;
}

.opponents {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.opponent {
  flex: 1 1 0;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 4px 6px;
  text-align: center;
}

.opponent.folded {
  opacity: 0.45;
}

.opponent.active-turn {
  outline: 2px solid #ffd166;
}

.opponent-name {
  font-weight: bold;
  font-size: 12px;
}

.opponent-chips {
  font-size: 10px;
  color: #cfe8d8;
  margin-bottom: 3px;
  white-space: nowrap;
}

.opponent-cards {
  display: flex;
  justify-content: center;
  gap: 3px;
}

.opponent-status {
  font-weight: bold;
  margin-top: 4px;
  min-height: 26px;
  padding: 2px 4px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.3);
  color: #cfe8d8;
  line-height: 1.3;
}

.status-main {
  display: block;
  font-size: 11px;
}

.status-sub {
  display: block;
  font-size: 9px;
  font-weight: normal;
  opacity: 0.8;
}

.opponent-status.status-fold {
  background: rgba(178, 59, 59, 0.5);
  color: #ffd6d6;
}

.opponent-status.status-call {
  background: rgba(47, 122, 184, 0.55);
  color: #fff;
}

.opponent-status.status-raise {
  background: rgba(200, 134, 43, 0.6);
  color: #fff;
}

.opponent-status-flash {
  animation: status-pop 0.4s ease-out;
}

@keyframes status-pop {
  0% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.community-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.community-cards {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.hole-cards {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.card {
  width: 40px;
  height: 56px;
  background: #fff;
  color: #111;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.card.red {
  color: #c0392b;
}

.card.back {
  background: repeating-linear-gradient(45deg, #2a4d8f, #2a4d8f 6px, #1c3766 6px, #1c3766 12px);
}

.card.small {
  width: 26px;
  height: 36px;
  font-size: 10px;
}

.card.placeholder {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}

.player-area {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
  padding: 6px;
  text-align: center;
}

.player-header {
  display: flex;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}

.chips {
  color: #ffd166;
  font-weight: bold;
}

.current-hand-label {
  margin-top: 4px;
  font-size: 13px;
  font-weight: bold;
  color: #a8e6b0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.action-btn {
  border: 3px solid transparent;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  white-space: nowrap;
  line-height: 1.3;
}

.btn-main {
  display: block;
  font-size: 14px;
}

.btn-sub {
  display: block;
  font-size: 10px;
  font-weight: normal;
  opacity: 0.85;
}

.action-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.action-btn.recommended {
  border-color: #ffd166;
  box-shadow: 0 0 10px rgba(255, 209, 102, 0.9);
  animation: pulse-glow 1.4s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 209, 102, 0.6); }
  50% { box-shadow: 0 0 16px rgba(255, 209, 102, 1); }
}

.action-btn.fold,
.action-btn.call {
  flex: 1 1 0;
}

.action-btn.fold {
  background: #b23b3b;
}

.action-btn.call {
  background: #2f7ab8;
}

.action-btn.raise {
  background: #c8862b;
  flex-shrink: 0;
}

.action-btn.next {
  background: #3f8f5c;
  width: 100%;
}

.raise-controls {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 10px;
}

#raiseSlider {
  flex: 1 1 auto;
  width: auto;
}

.raise-amount {
  flex-shrink: 0;
  min-width: 36px;
  text-align: center;
  font-weight: bold;
  color: #ffd166;
  font-size: 13px;
}

.action-glossary {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 6px 8px;
}

.glossary-item {
  font-size: 10px;
  line-height: 1.4;
  color: #cfe8d8;
}

.glossary-item strong {
  color: #f2f2f2;
  margin-right: 4px;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.dot.fold {
  background: #b23b3b;
}

.dot.call {
  background: #2f7ab8;
}

.dot.raise {
  background: #c8862b;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.panel {
  background: #103d24;
  border: 1px solid #2a6b45;
  border-radius: 10px;
  padding: 10px 12px;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 14px;
  color: #ffd166;
}

.panel summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  color: #ffd166;
}

.advice-headline {
  font-size: 14px;
  font-weight: bold;
  color: #ffd166;
  margin: 0 0 6px;
  line-height: 1.5;
}

.advice-text {
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
  color: #cfe8d8;
}

.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 150px;
  overflow-y: auto;
  font-size: 11px;
  line-height: 1.6;
  color: #cfe8d8;
}

.log-list li {
  border-bottom: 1px dashed rgba(255, 255, 255, 0.08);
  padding: 3px 0;
}

.hand-rank-list {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 11px;
  line-height: 1.7;
}

.howto-body {
  font-size: 11px;
  line-height: 1.6;
}

.tutorial-body {
  font-size: 13px;
  line-height: 1.7;
  text-align: left;
  margin-bottom: 16px;
}

.tutorial-body p {
  margin: 0 0 10px;
}

.tutorial-actions {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.6;
}

.tutorial-actions li {
  margin-bottom: 4px;
}

.howto-body h3 {
  font-size: 12px;
  color: #a8e6b0;
  margin: 8px 0 4px;
}

.howto-body ol,
.howto-body ul {
  margin: 4px 0;
  padding-left: 16px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 16px;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: #103d24;
  border: 2px solid #2a6b45;
  border-radius: 14px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

.modal h2 {
  margin-top: 0;
  font-size: 17px;
  color: #ffd166;
}

.result-body {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 16px;
  text-align: left;
}

/* タブレット・PCなど広い画面では余裕を持たせた表示にする */
@media (min-width: 700px) {
  .app {
    padding: 16px;
  }

  .app-header h1 {
    font-size: 28px;
    letter-spacing: 2px;
  }

  .subtitle {
    font-size: 14px;
  }

  .main-layout {
    grid-template-columns: 1fr 340px;
    gap: 16px;
  }

  .table-area {
    border-width: 8px;
    border-radius: 24px;
    padding: 20px;
    gap: 16px;
  }

  .stage-banner {
    font-size: 14px;
  }

  .pot-display {
    font-size: 18px;
  }

  .opponent {
    flex: 0 1 auto;
    min-width: 150px;
    padding: 10px 14px;
  }

  .opponent-name {
    font-size: 14px;
  }

  .opponent-chips {
    font-size: 13px;
  }

  .card {
    width: 54px;
    height: 76px;
    font-size: 20px;
  }

  .card.small {
    width: 40px;
    height: 56px;
    font-size: 14px;
  }

  .player-header {
    font-size: 16px;
  }

  .current-hand-label {
    font-size: 15px;
  }

  .action-btn {
    padding: 10px 18px;
    font-size: 14px;
  }

  .action-btn.fold,
  .action-btn.call {
    flex: 0 1 auto;
  }

  .raise-controls {
    flex: 0 1 auto;
  }
}
