:root {
  --background: #f4f7f5;
  --surface: #ffffff;
  --surface-muted: #eef3f0;
  --ink: #17211f;
  --muted: #61706c;
  --border: #d9e2de;
  --primary: #0f6b4f;
  --primary-dark: #0b4f3c;
  --win: #12805c;
  --tie: #b7791f;
  --lose: #b23b3b;
  --info: #2f628f;
  --shadow: 0 18px 42px rgba(23, 33, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input,
textarea {
  font: inherit;
}

.app-header {
  background: #123f38;
  color: #ffffff;
  padding: 28px 20px;
}

.header-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.eyebrow {
  margin: 0 0 6px;
  color: #cfe8dd;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 2rem;
  line-height: 1.15;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 4px;
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: 0;
}

.header-copy {
  max-width: 440px;
  margin-bottom: 0;
  color: #e7f3ef;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(300px, 430px) minmax(0, 1fr);
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 24px auto 32px;
}

.panel {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel,
.results-panel {
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.field {
  min-width: 0;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfdfc;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 107, 79, 0.15);
}

.hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

button {
  min-height: 44px;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 700;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 120ms ease;
}

button:active {
  transform: translateY(1px);
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.primary-button {
  color: #ffffff;
  background: var(--primary);
}

.primary-button:hover {
  background: var(--primary-dark);
}

.secondary-button {
  color: var(--primary-dark);
  background: #ffffff;
  border-color: var(--border);
}

.secondary-button:hover {
  border-color: var(--primary);
  background: var(--surface-muted);
}

.message {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #efc7c7;
  background: #fff4f4;
  color: #7c2525;
  font-weight: 700;
}

.message.info {
  border-color: #b9d2e6;
  background: #f0f7fc;
  color: #214f75;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfc;
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

.metric-card strong {
  display: block;
  margin-bottom: 10px;
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.metric-win strong {
  color: var(--win);
}

.metric-tie strong {
  color: var(--tie);
}

.metric-lose strong {
  color: var(--lose);
}

.metric-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.meter {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ece8;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 240ms ease;
}

.metric-win .meter span {
  background: var(--win);
}

.metric-tie .meter span {
  background: var(--tie);
}

.metric-lose .meter span {
  background: var(--lose);
}

.player-section {
  margin-top: 22px;
}

.subheading {
  margin-bottom: 12px;
}

.subheading p {
  margin-bottom: 0;
  color: var(--muted);
}

.player-results-list {
  display: grid;
  gap: 10px;
}

.empty-state {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fbfdfc;
}

.player-row {
  display: grid;
  grid-template-columns: minmax(145px, 1.1fr) minmax(90px, 0.7fr) minmax(140px, 1fr) minmax(155px, 1.2fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfc;
}

.player-name {
  display: block;
  font-weight: 800;
}

.player-type,
.player-cards,
.player-breakdown {
  color: var(--muted);
  font-size: 0.9rem;
}

.player-cards {
  font-weight: 700;
}

.player-equity {
  color: var(--primary-dark);
  font-size: 1.35rem;
  font-weight: 800;
}

.equity-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4ece8;
}

.equity-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.notice {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #bed3cc;
  border-left: 5px solid var(--info);
  border-radius: 8px;
  background: #f8fbfa;
}

.notice h2 {
  font-size: 1rem;
}

.notice p {
  margin-bottom: 0;
  color: #3c4c48;
}

@media (max-width: 960px) {
  .header-inner,
  .app-shell {
    display: block;
  }

  .header-copy {
    margin-top: 12px;
  }

  .input-panel {
    margin-bottom: 18px;
  }
}

@media (max-width: 700px) {
  .app-header {
    padding: 22px 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  .app-shell {
    width: calc(100% - 24px);
    margin-top: 14px;
  }

  .input-panel,
  .results-panel {
    padding: 16px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .player-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .actions {
    flex-direction: column;
  }

  button {
    width: 100%;
  }
}
