* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #ff6b9d;
  --secondary-color: #c44569;
  --accent-color: #f8b500;
  --success-color: #4CAF50;
  --warning-color: #FFC107;
  --danger-color: #F44336;
  --bg-color: #fff5f8;
  --card-bg: #ffffff;
  --text-color: #333;
  --text-light: #666;
  --border-color: #e0e0e0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
  --border-radius: 20px;
  --border-radius-small: 12px;
}

body {
  font-family: 'Segoe UI', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
  background: linear-gradient(135deg, #fff5f8 0%, #ffeef5 50%, #fff0f7 100%);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

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

/* ヘッダー */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px 20px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

header h1 {
  font-size: 2.5em;
  color: var(--primary-color);
  margin-bottom: 10px;
  font-weight: 700;
  text-shadow: 2px 2px 4px rgba(255, 107, 157, 0.1);
}

.subtitle {
  color: var(--text-light);
  font-size: 1.1em;
}

/* タイプ選択セクション */
.selector-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.type-selector {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.person-card {
  flex: 1;
  min-width: 280px;
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, #fff 0%, #fff5f8 100%);
  border-radius: var(--border-radius);
  border: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.person-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
}

.person-icon {
  font-size: 3em;
  margin-bottom: 15px;
}

.person-card h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.3em;
}

.type-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}

.type-btn {
  padding: 10px 8px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.type-btn:hover {
  border-color: var(--primary-color);
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

.type-btn.selected {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.3);
}

.selected-type {
  padding: 15px;
  background: linear-gradient(135deg, #fff5f8 0%, #ffeef5 100%);
  border-radius: var(--border-radius-small);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border-color);
}

.selected-type .placeholder {
  color: var(--text-light);
  font-style: italic;
}

.selected-type .type-name {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--primary-color);
}

.vs-icon {
  font-size: 3em;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.check-button {
  display: block;
  margin: 30px auto 0;
  padding: 18px 50px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1.2em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.check-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.5);
}

.check-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 結果セクション */
.result-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.result-card h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 30px;
  font-size: 2em;
}

.compatibility-display {
  text-align: center;
  margin-bottom: 30px;
}

.relation-icon {
  font-size: 5em;
  margin-bottom: 15px;
  animation: bounce 1s ease;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

.relation-name {
  font-size: 2.5em;
  font-weight: 700;
  margin-bottom: 10px;
}

.relation-score {
  font-size: 3em;
  font-weight: 700;
  margin-bottom: 15px;
}

.relation-description {
  font-size: 1.1em;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.score-bar-container {
  width: 100%;
  height: 30px;
  background: #f0f0f0;
  border-radius: 15px;
  overflow: hidden;
  margin: 30px 0;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.score-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--success-color) 0%, var(--warning-color) 50%, var(--danger-color) 100%);
  border-radius: 15px;
  transition: width 1s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.relationship-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 30px;
}

.detail-card {
  padding: 20px;
  background: linear-gradient(135deg, #fff5f8 0%, #ffeef5 100%);
  border-radius: var(--border-radius-small);
  border: 1px solid var(--border-color);
  text-align: center;
}

.detail-card h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1.1em;
}

.detail-card p {
  color: var(--text-light);
  font-size: 0.95em;
  line-height: 1.6;
}

/* 相性の良いタイプランキングセクション */
.good-match-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.good-match-section h2 {
  text-align: center;
  color: var(--success-color);
  margin-bottom: 30px;
  font-size: 2em;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ranking-item {
  display: flex;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #fff 0%, #f5f5f5 100%);
  border-radius: var(--border-radius-small);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  gap: 20px;
}

.ranking-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--success-color);
  background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
}

.ranking-rank {
  font-size: 2em;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
  color: var(--primary-color);
}

.ranking-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ranking-type-name {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--text-color);
}

.ranking-relation {
  font-size: 0.95em;
  font-weight: 600;
}

.ranking-score {
  font-size: 1.3em;
  font-weight: 700;
  min-width: 70px;
  text-align: right;
}

/* 相性の悪いタイプセクション */
.bad-match-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.bad-match-section h2 {
  text-align: center;
  color: var(--danger-color);
  margin-bottom: 30px;
  font-size: 2em;
}

.bad-types-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
}

.bad-type-item {
  padding: 15px;
  background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
  border-radius: var(--border-radius-small);
  border: 2px solid var(--danger-color);
  text-align: center;
  font-weight: 600;
  color: var(--danger-color);
  transition: all 0.3s ease;
  cursor: pointer;
}

.bad-type-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(244, 67, 54, 0.2);
}

/* 16タイプの特徴セクション */
.types-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.types-section h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 30px;
  font-size: 2em;
}

.types-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.type-card {
  padding: 25px;
  background: linear-gradient(135deg, #fff 0%, #fff5f8 100%);
  border-radius: var(--border-radius-small);
  border: 2px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.type-card:hover::before {
  transform: scaleX(1);
}

.type-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-color);
}

.type-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.type-card-name {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--primary-color);
}

.type-card-name-en {
  font-size: 0.85em;
  color: var(--text-light);
  font-style: italic;
}

.type-card-description {
  color: var(--text-light);
  font-size: 0.9em;
  line-height: 1.6;
  margin-bottom: 15px;
}

.type-card-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.trait-tag {
  padding: 4px 10px;
  background: var(--bg-color);
  border-radius: 12px;
  font-size: 0.75em;
  color: var(--text-color);
}

/* 相性一覧表セクション */
.table-section {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 40px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.table-section h2 {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 30px;
  font-size: 2em;
}

.table-controls {
  margin-bottom: 20px;
  text-align: center;
}

.table-controls label {
  margin-right: 10px;
  color: var(--text-color);
  font-weight: 600;
}

.table-controls select {
  padding: 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-small);
  background: var(--card-bg);
  color: var(--text-color);
  font-size: 1em;
  cursor: pointer;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--border-radius-small);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card-bg);
  min-width: 800px;
}

table thead th {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 15px 10px;
  text-align: center;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 10;
}

table tbody th {
  background: linear-gradient(135deg, #fff5f8 0%, #ffeef5 100%);
  padding: 12px 10px;
  text-align: center;
  font-weight: 600;
  color: var(--primary-color);
  position: sticky;
  left: 0;
  z-index: 5;
}

table tbody td {
  padding: 12px 10px;
  text-align: center;
  border: 1px solid var(--border-color);
  font-weight: 600;
  transition: all 0.2s ease;
  cursor: pointer;
}

table tbody td:hover {
  transform: scale(1.1);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

table tbody td.relation-dual {
  background: #e8f5e9;
  color: var(--success-color);
}

table tbody td.relation-good {
  background: #f1f8e9;
  color: #8BC34A;
}

table tbody td.relation-normal {
  background: #fffde7;
  color: var(--warning-color);
}

table tbody td.relation-bad {
  background: #ffebee;
  color: var(--danger-color);
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: var(--card-bg);
  margin: 3% auto;
  padding: 40px;
  border-radius: var(--border-radius);
  width: 90%;
  max-width: 750px;
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideDown 0.3s ease;
  box-sizing: border-box;
}

.modal-content::-webkit-scrollbar {
  width: 10px;
}

.modal-content::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

@keyframes slideDown {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.close {
  position: absolute;
  right: 20px;
  top: 20px;
  font-size: 2em;
  font-weight: bold;
  color: var(--text-light);
  cursor: pointer;
  transition: color 0.3s ease;
}

.close:hover {
  color: var(--primary-color);
}

.modal-body {
  padding-right: 20px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* モーダルヘッダーセクション */
.modal-header-section {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 3px solid var(--border-color);
}

.modal-body h2 {
  color: var(--primary-color);
  margin-bottom: 8px;
  font-size: 2.2em;
  padding-right: 40px;
}

.modal-body .type-name-en {
  color: var(--text-light);
  font-style: italic;
  font-size: 1em;
  margin-bottom: 20px;
  display: block;
}

.modal-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 100px;
  padding: 15px;
  border-radius: var(--border-radius-small);
  text-align: center;
  background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
  border: 2px solid var(--border-color);
}

.stat-item.stat-good {
  border-color: var(--success-color);
  background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
}

.stat-item.stat-normal {
  border-color: var(--warning-color);
  background: linear-gradient(135deg, #fffde7 0%, #fff9c4 100%);
}

.stat-item.stat-bad {
  border-color: var(--danger-color);
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.stat-number {
  font-size: 2em;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 5px;
}

.stat-item.stat-good .stat-number {
  color: var(--success-color);
}

.stat-item.stat-normal .stat-number {
  color: var(--warning-color);
}

.stat-item.stat-bad .stat-number {
  color: var(--danger-color);
}

.stat-label {
  font-size: 0.85em;
  color: var(--text-light);
  font-weight: 600;
}

/* 説明カード */
.modal-description-card,
.modal-love-card {
  display: flex;
  gap: 20px;
  padding: 25px;
  background: linear-gradient(135deg, #fff5f8 0%, #ffeef5 100%);
  border-radius: var(--border-radius-small);
  border: 2px solid var(--border-color);
  margin-bottom: 25px;
}

.modal-description-card .card-icon,
.modal-love-card .card-icon {
  font-size: 3em;
  flex-shrink: 0;
}

.modal-description-card .card-content,
.modal-love-card .card-content {
  flex: 1;
}

.modal-description-card h3,
.modal-love-card h3 {
  color: var(--primary-color);
  margin-bottom: 12px;
  font-size: 1.3em;
  font-weight: 700;
}

.modal-description-card p,
.modal-love-card p {
  color: var(--text-color);
  line-height: 1.8;
  font-size: 1em;
  margin: 0;
}

/* テーブルグリッド */
.modal-tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
  width: 100%;
}

.modal-table-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-small);
  border: 2px solid var(--border-color);
  overflow: hidden;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
}

.modal-table-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.modal-table-card .modal-table {
  min-height: 100px;
}

.table-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 20px;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
}

.table-icon {
  font-size: 1.5em;
}

.table-header h3 {
  margin: 0;
  font-size: 1.2em;
  font-weight: 700;
  color: white;
}

.modal-table-content {
  padding: 15px;
}

.table-row {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.table-row:last-child {
  border-bottom: none;
}

.row-number {
  display: inline-block;
  width: 40px;
  min-width: 40px;
  text-align: center;
  font-weight: 700;
  font-size: 1.1em;
  color: var(--primary-color);
  background: linear-gradient(135deg, #fff5f8 0%, #ffeef5 100%);
  padding: 8px;
  border-radius: 8px;
  margin-right: 15px;
}

.row-text {
  flex: 1;
  color: var(--text-color);
  font-size: 1em;
  line-height: 1.6;
}

/* 相性セクション */
.modal-compatibility-section {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.compatibility-card {
  background: var(--card-bg);
  border-radius: var(--border-radius-small);
  border: 2px solid var(--border-color);
  padding: 25px;
}

.compatibility-card.compatibility-good {
  border-color: var(--success-color);
  background: linear-gradient(135deg, #f1f8e9 0%, #e8f5e9 100%);
}

.compatibility-card.compatibility-bad {
  border-color: var(--danger-color);
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
}

.compatibility-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--border-color);
}

.compatibility-icon {
  font-size: 1.8em;
}

.compatibility-header h3 {
  flex: 1;
  margin: 0;
  color: var(--text-color);
  font-size: 1.3em;
  font-weight: 700;
}

.compatibility-count {
  padding: 6px 15px;
  background: var(--card-bg);
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 600;
  color: var(--text-light);
}

.compatibility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.compatibility-item {
  padding: 15px;
  background: var(--card-bg);
  border-radius: var(--border-radius-small);
  border: 2px solid var(--border-color);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.compatibility-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.compatibility-item-good {
  border-color: var(--success-color);
}

.compatibility-item-good:hover {
  background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
  border-color: #4CAF50;
}

.compatibility-item-bad {
  border-color: var(--danger-color);
}

.compatibility-item-bad:hover {
  background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
  border-color: #F44336;
}

.compatibility-type-code {
  font-weight: 700;
  font-size: 1.1em;
  color: var(--text-color);
  margin-bottom: 5px;
}

.compatibility-type-name {
  font-size: 0.85em;
  color: var(--text-light);
  margin-bottom: 8px;
  line-height: 1.4;
}

.compatibility-score {
  font-weight: 700;
  font-size: 1em;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.compatibility-item-good .compatibility-score {
  color: var(--success-color);
}

.compatibility-item-bad .compatibility-score {
  color: var(--danger-color);
}

/* フッター */
footer {
  text-align: center;
  padding: 30px;
  color: var(--text-light);
  font-size: 0.9em;
}

/* ユーティリティクラス */
.hidden {
  display: none !important;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.8em;
  }
  
  .type-selector {
    flex-direction: column;
  }
  
  .vs-icon {
    transform: rotate(90deg);
  }
  
  .type-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .types-grid {
    grid-template-columns: 1fr;
  }
  
  .relationship-details {
    grid-template-columns: 1fr;
  }
  
  .ranking-item {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .ranking-rank {
    min-width: auto;
  }
  
  .ranking-score {
    min-width: auto;
    text-align: center;
  }
  
  .table-wrapper {
    overflow-x: scroll;
  }
  
  .modal-content {
    width: 95%;
    padding: 30px 20px;
    margin: 5% auto;
    max-height: 90vh;
  }
  
  .modal-body h2 {
    font-size: 1.5em;
    padding-right: 30px;
  }
  
  .modal-tables-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .modal-table-card {
    width: 100%;
  }
  
  .row-number {
    width: 30px;
    min-width: 30px;
    font-size: 0.9em;
    padding: 5px;
    margin-right: 10px;
  }
  
  .row-text {
    font-size: 0.85em;
  }
  
  .modal-description-card,
  .modal-love-card {
    flex-direction: column;
    text-align: center;
  }
  
  .modal-description-card .card-icon,
  .modal-love-card .card-icon {
    font-size: 2.5em;
  }
  
  .compatibility-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .modal-stats {
    gap: 10px;
  }
  
  .stat-item {
    min-width: 80px;
    padding: 12px;
  }
  
  .stat-number {
    font-size: 1.5em;
  }
  
  .close {
    right: 15px;
    top: 15px;
    font-size: 1.5em;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }
  
  header {
    padding: 20px 15px;
  }
  
  .selector-section,
  .result-section,
  .bad-match-section,
  .types-section,
  .table-section {
    padding: 20px;
  }
  
  .type-buttons {
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
  }
  
  .type-btn {
    padding: 8px 5px;
    font-size: 0.75em;
  }
  
  .modal-content {
    width: 98%;
    padding: 25px 15px;
    margin: 2% auto;
    max-height: 95vh;
  }
  
  .modal-body h2 {
    font-size: 1.3em;
    padding-right: 25px;
  }
  
  .modal-tables-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .modal-table-card {
    font-size: 0.9em;
    width: 100%;
  }
  
  .row-number {
    width: 35px;
    min-width: 35px;
    font-size: 1em;
    padding: 6px;
    margin-right: 12px;
  }
  
  .row-text {
    font-size: 0.9em;
  }
  
  .modal-description-card,
  .modal-love-card {
    padding: 20px;
    flex-direction: column;
    text-align: center;
  }
  
  .modal-description-card .card-icon,
  .modal-love-card .card-icon {
    font-size: 2em;
  }
  
  .compatibility-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
  }
  
  .compatibility-item {
    padding: 12px;
  }
  
  .compatibility-type-code {
    font-size: 1em;
  }
  
  .compatibility-type-name {
    font-size: 0.75em;
  }
  
  .compatibility-score {
    font-size: 0.9em;
  }
  
  .modal-stats {
    gap: 8px;
  }
  
  .stat-item {
    min-width: 70px;
    padding: 10px;
  }
  
  .stat-number {
    font-size: 1.3em;
  }
  
  .stat-label {
    font-size: 0.75em;
  }
  
  .close {
    right: 10px;
    top: 10px;
    font-size: 1.3em;
  }
}
