* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(ellipse at center, #1a6b3c 0%, #0d3d22 60%, #072a17 100%);
  color: #e8f5e9;
  min-height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 2px solid #0a2e1a;
}

header h1 {
  margin: 0;
  font-size: 1.6rem;
  letter-spacing: 1px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lang-btn {
  background: #2e7d32;
  color: #fff;
  border: 1px solid #1b5e20;
  border-radius: 6px;
  padding: 6px 14px;
  cursor: pointer;
  font-weight: bold;
}
.lang-btn:hover { background: #388e3c; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 12px 24px 0;
}

.tab {
  background: #14532d;
  color: #c8e6c9;
  border: 1px solid #0a2e1a;
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  padding: 10px 22px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
}
.tab.active {
  background: #1e7a3c;
  color: #fff;
}
.tab:hover { background: #1b6b34; }

.notice {
  margin: 12px 24px;
  padding: 10px 16px;
  background: rgba(255, 193, 7, 0.15);
  border: 1px solid #b8860b;
  border-radius: 6px;
  color: #ffe082;
  font-size: 0.9rem;
}

main { padding: 0 24px 32px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.card-picker, .pushfold, .icm {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid #0a2e1a;
  border-radius: 10px;
  padding: 20px;
  margin-top: 16px;
}

h2 { font-size: 1.1rem; margin: 12px 0 6px; }

.selected-cards {
  min-height: 40px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.selected-cards .card {
  background: #fff;
  color: #111;
  border-radius: 5px;
  padding: 4px 8px;
  font-weight: bold;
  font-size: 1rem;
  box-shadow: 0 2px 3px rgba(0,0,0,0.4);
}
.selected-cards .card.red { color: #c62828; }

.grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 4px;
  max-width: 700px;
  margin: 10px 0;
}

.grid .cell {
  aspect-ratio: 1;
  background: #fff;
  color: #111;
  border: 1px solid #999;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.grid .cell.red { color: #c62828; }
.grid .cell.selected {
  background: #ffd54f;
  border-color: #f9a825;
  box-shadow: 0 0 0 2px #f9a825;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.controls label, .pushfold label, .icm label {
  font-size: 0.9rem;
}

input[type="text"], input[type="number"], select {
  background: #0d3d22;
  color: #e8f5e9;
  border: 1px solid #1b5e20;
  border-radius: 5px;
  padding: 6px 8px;
}

button {
  background: #2e7d32;
  color: #fff;
  border: 1px solid #1b5e20;
  border-radius: 6px;
  padding: 7px 16px;
  cursor: pointer;
  font-weight: bold;
}
button:hover { background: #388e3c; }

.result {
  margin-top: 14px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  font-size: 1.05rem;
  min-height: 20px;
  white-space: pre-wrap;
}

.icm-table {
  margin-top: 14px;
  border-collapse: collapse;
  width: 100%;
  max-width: 500px;
}
.icm-table th, .icm-table td {
  border: 1px solid #1b5e20;
  padding: 8px 12px;
  text-align: right;
}
.icm-table th {
  background: #14532d;
  text-align: center;
}
.icm-table td:first-child, .icm-table th:first-child { text-align: left; }
