body { 
  background: #fff; 
  color: #000; 
  font-family: Arial, sans-serif; 
  margin: 0; 
  padding: 10px; 
  font-size: 14px;
}
h1 { 
  text-align: center; 
  color: #000; 
  margin-bottom: 12px; 
  white-space: nowrap;
  font-size: clamp(20px, 6vw, 36px);
}
.readme-note {
  text-align: center;
  margin-bottom: 15px;
  font-size: 14px;
}
.container { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 15px; 
  max-width: 1200px; /* Increased from 800px to 1200px (1.5x) */
  margin: 0 auto;
}
.panel { 
  background: #f2f2f2; 
  border: 1px solid #888; 
  border-radius: 10px; 
  padding: 15px; 
  box-sizing: border-box; 
  flex: 1 1 calc(50% - 8px);
  min-width: 400px; /* Adjusted from 480px to 400px for better fit */
}
.mode-toggle-container {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-bottom: 10px;
}
.section-title { 
  font-size: 16px; 
  border-bottom: 1px solid #aaa; 
  margin-bottom: 8px;
  padding-bottom: 4px;
}
.mode-section {
  flex: 1;
  min-width: 180px; /* Increased from 120px to 180px (1.5x) */
}

.mode-select {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.mode-select label {
  margin-right: 5px;
  font-size: 14px;
}
.button-grid { 
  display: grid; 
  gap: 6px; 
  margin-bottom: 12px; 
  width: 100%;
}
/* ボタングリッドの調整 */
.grid-3x3 { 
  grid-template-columns: repeat(3, minmax(auto, 1fr)); 
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}
.grid-4x2 { 
  grid-template-columns: repeat(4, minmax(auto, 1fr)); 
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}
.grid-3x2 { 
  grid-template-columns: repeat(3, minmax(auto, 1fr)); 
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}
.grid-3x1 { 
  grid-template-columns: repeat(3, minmax(auto, 1fr)); 
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}
.grid-1x1 { 
  grid-template-columns: 1fr; 
}

.grid-4x4-special { 
  grid-template-columns: repeat(4, minmax(auto, 1fr)); 
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

/* 特殊入力ボタンを4列に変更 */
#specialInputs {
  grid-template-columns: repeat(4, minmax(auto, 1fr)); 
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.row { 
  display: flex; 
  gap: 15px; 
  margin-bottom: 15px; 
}
.column { 
  flex: 1;
  max-width: 50%;
  min-width: 0; /* Allows columns to shrink below their content size if needed */
}

button { 
  font-size: 14px; 
  padding: 8px; 
  background: #fff; 
  color: #000; 
  border: 1px solid #888; 
  border-radius: 5px; 
  cursor: pointer; 
  white-space: nowrap; 
  text-overflow: ellipsis; 
  overflow: hidden; 
  min-width: min-content; 
  width: 100%; 
  box-sizing: border-box; 
}
button:hover { background: #ddd; }

.display-box { 
  background: #fff; 
  padding: 12px; 
  border: 1px solid #ccc; 
  border-radius: 10px; 
  min-height: 60px; 
  white-space: pre-wrap; 
  font-size: 16px; 
  margin-bottom: 8px; 
}
.memo-box { 
  width: 100%; 
  padding: 8px; 
  font-size: 14px; 
  border-radius: 8px; 
  border: 1px solid #aaa; 
  background: #fff; 
  color: #000; 
  margin-bottom: 8px; 
  box-sizing: border-box;
  resize: vertical;
}
.control { 
  display: flex; 
  gap: 6px; 
  flex-wrap: nowrap; 
  margin-bottom: 8px; 
  justify-content: space-between; 
}
.divider { 
  border: none; 
  border-top: 1px solid #888; 
  margin: 10px 0; 
}
.github-icon { 
  position: fixed; 
  top: 10px; 
  right: 10px; 
  z-index: 1000; 
}

.custom-input-container {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.custom-input-field {
  flex: 1;
  padding: 8px;
  border: 1px solid #aaa;
  border-radius: 5px;
  font-size: 14px;
}


.btn-attack {
  color: #fff;
  border: 1px solid #888;
  border-radius: 5px;
  cursor: pointer;
}


.long-text-button {
  font-size: 12px;
  padding: 6px 4px;
}


#modernButtons {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-width: 350px;
  margin: 0 auto;
}

#modernButtons button {
  width: 100%;
  height: 100%;
  min-height: 36px;
}


#modernButtons button:last-child {
  grid-column: 1 / -1;
}
.btn-small { background-color: #4583a8; }
.btn-middle { background-color: #979829; }
.btn-large { background-color: #c36264; }
.btn-pk-essential { background-color: #eb6e00; }

.btn-attack:hover {
  opacity: 0.9;
}


.collapsible {
  cursor: pointer;
  position: relative;
  padding-right: 25px;
}

.collapsible::after {
  content: '▼';
  font-size: 12px;
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  transition: transform 0.3s;
}

.collapsed::after {
  transform: translateY(-50%) rotate(-90deg);
}

.collapsible-content {
  max-height: 1000px;
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
}

.collapsed + .collapsible-content {
  max-height: 0;
}


@media (max-width: 900px) { 
  .row, .mode-toggle-container { flex-direction: column; }
  
  .column {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  
  .column > div {
    width: 100%;
  }
  
  .section-title {
    text-align: center;
  }
}


@media (min-width: 375px) and (max-width: 642px) { 
  .container {
    gap: 10px;
  }
  
  .panel {
    padding: 10px;
    flex: 1 1 100%;
    min-width: auto;
  }
  
  button {
    font-size: 12px;
    padding: 6px 4px;
    min-width: min-content;
    width: 100%;
  }
  
  .button-grid {
    gap: 4px;
  }
  
  .long-text-button {
    font-size: 11px;
    padding: 5px 3px;
    letter-spacing: -0.5px;
  }
}

#overlay {
  display: none;               /* 最初は隠しておく */
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); /* 半透明の黒 */
  z-index: 1000;
}

#infoModal {
  display: none;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  max-width: 90%;
  width: 400px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#infoModal .modal-content {
  padding: 20px;
  position: relative;
}

#infoModal #closeModal {
  position: absolute;
  top: 8px; right: 8px;
  background: transparent;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

/* ヘッダーを中央寄せの横並びに */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

/* 見出しの余白リセット*/
.header h1 {
  margin: 0;
}

/* ボタンを必要なサイズだけに */
.tiny-button {
  width: auto;
  min-width: initial;
  padding: 4px 8px;
  font-size: 0.8em;
  margin-left: 8px;
  white-space: nowrap;
}

/* キャラクター名 */
.character-name {
  font-weight: bold;
  text-align: center;
  margin-bottom: 10px;
  font-size: 16px;
}

/* 必殺技グループ */
.move-group {
  margin-bottom: 15px;
  border-bottom: 1px dotted #ccc;
  padding-bottom: 10px;
}

/* 技名見出し */
.move-title {
  font-weight: bold;
  margin-bottom: 5px;
  padding-left: 5px;
  border-left: 4px solid #4583a8;
}

/* 技カテゴリタイトル */
.move-category-title {
  font-weight: bold;
  margin: 15px 0 8px;
  text-align: center;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
}

/* 必殺技ボタングリッド */
.special-move-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  max-width: 400px;
  margin: 0 auto;
}

/* スーパーアーツボタングリッド */
.super-arts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 400px;
  margin: 0 auto;
}

/* 必殺技ボタン */
.special-move-button {
  background-color: #e8f0f8;
  border: 1px solid #a0c0d8;
  font-size: 13px;
  padding: 6px 4px;
  border-radius: 5px;
  transition: background-color 0.2s;
}

.special-move-button:hover {
  background-color: #d0e0f0;
}

/* スーパーアーツボタン */
.super-art-button {
  background-color: #ffe0e0;
  border: 1px solid #ffa0a0;
  color: #900;
  font-weight: bold;
  font-size: 13px;
  padding: 8px 5px;
  border-radius: 5px;
  transition: background-color 0.2s;
}

.super-art-button:hover {
  background-color: #ffd0d0;
}

/* キャラクターセレクト */
#characterSelectArea {
  margin-bottom: 15px;
  text-align: center;
}

#characterSelect {
  padding: 5px 10px;
  font-size: 14px;
  border-radius: 5px;
  border: 1px solid #aaa;
  background-color: #f8f8f8;
}

/* レスポンシブデザイン対応 */
@media (max-width: 642px) {
  .special-move-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .special-move-button,
  .super-art-button {
    font-size: 12px;
    padding: 5px 3px;
  }
}

/* 新しいレイアウト用のCSS */
.move-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dotted #ccc;
  flex-wrap: nowrap;    /* 折り返しなし */
}

.move-label {
  font-weight: bold;
  margin-right: 10px;
  min-width: 150px;
  flex: 0 0 auto;       /* 幅を固定 */
}

.button-group {
  display: flex;
  flex-direction: row;  /* 横方向に並べる */
  gap: 5px;
  flex-wrap: nowrap;    /* 折り返しなし */
}

/* ボタンのサイズを調整 */
.button-group .special-move-button {
  padding: 5px 10px;
  width: auto;
  min-width: 40px;
  flex: 0 0 auto;       /* 幅を固定 */
}