:root {
  color: #1c2720;
  background: #f5f7f2;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f7f2;
}

button,
input {
  font: inherit;
}

.app {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px;
}

.topbar,
.footer-actions,
.actions-grid,
.choice-grid,
.sheet-actions,
.summary-band {
  display: grid;
  gap: 10px;
}

.topbar {
  grid-template-columns: 76px 1fr 76px;
  align-items: center;
}

.round-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.app-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(20, 108, 67, 0.18);
}

.round-info strong {
  font-size: 19px;
}

.round-info span,
.muted {
  color: #67736b;
  font-size: 14px;
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.primary-btn {
  background: #146c43;
  color: #fff;
}

.teal-btn {
  background: #0f766e;
  color: #fff;
}

.danger-btn {
  background: #bd2f2f;
  color: #fff;
}

.plain-btn {
  border: 1px solid #d8dfd8;
  background: #fff;
  color: #1c2720;
}

.topbar button,
.small-btn {
  height: 42px;
  font-size: 15px;
}

.seat-board {
  position: relative;
  height: 410px;
  margin: 14px 0;
}

.player-card {
  position: absolute;
  width: min(150px, 42%);
  min-height: 104px;
  padding: 12px;
  border: 1px solid #d8dfd8;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(30, 52, 38, 0.08);
}

.player-card.dealer {
  border-color: #146c43;
  box-shadow: 0 6px 16px rgba(20, 108, 67, 0.18);
}

.seat-0 {
  left: 50%;
  top: 0;
  transform: translateX(-50%);
}

.seat-1 {
  right: 0;
  top: 145px;
}

.seat-2 {
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
}

.seat-3 {
  left: 0;
  top: 145px;
}

.seat-line {
  display: flex;
  justify-content: space-between;
  color: #67736b;
  font-weight: 700;
}

.dealer-badge {
  min-width: 28px;
  border-radius: 6px;
  background: #e8f4ed;
  color: #146c43;
  font-size: 13px;
  text-align: center;
}

.name {
  margin-top: 8px;
  font-size: 20px;
  font-weight: 800;
  word-break: break-all;
}

.score {
  margin-top: 5px;
  font-size: 27px;
  font-weight: 900;
}

.positive {
  color: #16834f;
}

.negative {
  color: #c93636;
}

.actions-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-btn {
  height: 64px;
  font-size: 22px;
  font-weight: 900;
}

.footer-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.modal-mask {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.42);
  z-index: 10;
}

.sheet {
  width: min(100vw, 430px);
  max-height: 88vh;
  overflow: auto;
  padding: 18px 14px 22px;
  border-radius: 8px 8px 0 0;
  background: #f9fbf7;
}

.sheet-title {
  margin-bottom: 14px;
  font-size: 23px;
  font-weight: 900;
}

.field-title {
  margin: 16px 0 8px;
  color: #465149;
  font-weight: 800;
}

.choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice,
.hand-chip {
  min-height: 42px;
  border: 1px solid #d8dfd8;
  background: #fff;
  color: #1c2720;
  font-size: 15px;
}

.selected {
  border-color: #146c43;
  background: #e8f4ed;
  color: #146c43;
  font-weight: 900;
}

.hand-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hand-chip {
  padding: 0 10px;
}

.sheet-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: sticky;
  bottom: -22px;
  margin: 18px -14px -22px;
  padding: 12px 14px 22px;
  background: #f9fbf7;
  box-shadow: 0 -8px 18px rgba(30, 52, 38, 0.08);
}

.sheet-actions button {
  height: 48px;
  font-weight: 800;
}

.form-row,
.switch-row,
.record-card,
.stat-row,
.summary-card,
.rule-block {
  padding: 13px;
  border: 1px solid #d8dfd8;
  border-radius: 8px;
  background: #fff;
}

.form-row,
.switch-row,
.stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.form-row input {
  width: 160px;
  height: 36px;
  border: 1px solid #d8dfd8;
  border-radius: 8px;
  padding: 0 10px;
  text-align: right;
}

.record-card,
.rule-block {
  margin-bottom: 10px;
  line-height: 1.7;
}

.record-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
}

.tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: #e8f4ed;
  color: #146c43;
  font-size: 13px;
}

.summary-band {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}

.big {
  margin-top: 4px;
  font-size: 26px;
  font-weight: 900;
}
