/* ==========================================================================
   Bet Calculator Betmentor — tool.css
   The calculator widget. Structure unchanged; tuned to the brand palette.
   ========================================================================== */

.calc {
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(35,174,109,.08);
  overflow: hidden;
  color: var(--text);
  scroll-margin-top: 90px;
}
.calc__bar {
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1.1rem; background: var(--deep); border-bottom: 1px solid var(--border-2);
}
.calc__dots { display: inline-flex; gap: .35rem; }
.calc__dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); display: block; }
.calc__dots i:nth-child(1) { background: var(--red-soft); }
.calc__dots i:nth-child(2) { background: var(--gold); }
.calc__dots i:nth-child(3) { background: var(--emerald); }
.calc__bar-title { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); }
.calc__badge {
  margin-left: auto; display: inline-flex; align-items: center; gap: .4rem;
  font-size: .73rem; color: var(--emerald-l); font-weight: 600;
  background: rgba(35,174,109,.14); border: 1px solid rgba(35,174,109,.28);
  padding: .3rem .65rem; border-radius: var(--r-pill); white-space: nowrap;
}
.calc__badge svg { width: 14px; height: 14px; flex: none; }
.calc__body { padding: 1.5rem; }

.calc__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.1rem; }
.calc__field { display: flex; flex-direction: column; gap: .45rem; }
.calc__label {
  font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.calc__control, .calc__input, .calc select {
  width: 100%; padding: .72rem .85rem; border-radius: var(--r-sm);
  background: var(--ink); border: 1.5px solid var(--border-2); color: var(--text);
  font-family: var(--font-body); font-size: .96rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.calc__control:hover, .calc__input:hover, .calc select:hover { border-color: rgba(35,174,109,.45); }
.calc__input:focus, .calc select:focus { outline: none; border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(35,174,109,.25); }
.calc__input::placeholder { color: #7E948A; }
.calc__select-wrap { position: relative; }
.calc__select-wrap svg { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); pointer-events: none; transition: color var(--t-fast); }
.calc__select-wrap:hover svg { color: var(--emerald-l); }
.calc select { appearance: none; -webkit-appearance: none; padding-right: 2.4rem; cursor: pointer; }
.calc select option { background: var(--ink-3); color: var(--text); }

/* conditions toggles */
.calc__toggles { display: flex; flex-wrap: wrap; gap: .55rem; }
.toggle {
  display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
  background: var(--ink); border: 1.5px solid var(--border-2); border-radius: var(--r-pill);
  padding: .5rem .9rem; font-size: .85rem; font-weight: 600; color: var(--text-soft);
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast); user-select: none;
}
.toggle:hover { border-color: rgba(35,174,109,.5); color: var(--emerald-l); }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle__dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-2); transition: all var(--t-fast); flex: none; }
.toggle:has(input:checked) { border-color: var(--emerald); color: var(--emerald-l); background: rgba(35,174,109,.12); }
.toggle:has(input:checked) .toggle__dot { border-color: var(--emerald); background: var(--emerald); box-shadow: inset 0 0 0 3px var(--ink); }
.toggle:focus-within { box-shadow: 0 0 0 3px rgba(35,174,109,.28); }

/* segmented control for odds format */
.seg { display: inline-flex; background: var(--ink); border: 1.5px solid var(--border-2); border-radius: var(--r-pill); padding: 3px; align-self: flex-start; }
.seg button {
  border: none; background: none; cursor: pointer; padding: .45rem 1rem; border-radius: var(--r-pill);
  font-family: var(--font-display); font-weight: 600; font-size: .86rem; color: var(--muted);
  transition: background var(--t-fast), color var(--t-fast);
}
.seg button:hover { color: var(--emerald-l); }
.seg button[aria-pressed="true"] { background: var(--emerald); color: #04140b; }

/* selections table */
.calc__selections { margin-bottom: 1.1rem; }
.sel-head, .sel-row {
  display: grid; grid-template-columns: 30px 1fr 1.1fr 40px; gap: .55rem; align-items: center;
}
.sel-head { padding: 0 .1rem .5rem; }
.sel-head span { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.sel-row { margin-bottom: .55rem; }
.sel-row__num { font-family: var(--font-mono); font-size: .82rem; color: var(--muted); text-align: center; }
.sel-row__result { appearance: none; -webkit-appearance: none; padding: .6rem 1.8rem .6rem .7rem; }
.sel-row__remove {
  width: 34px; height: 34px; border-radius: var(--r-sm); border: 1.5px solid var(--border-2);
  background: var(--ink); color: var(--muted); cursor: pointer; display: grid; place-items: center;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.sel-row__remove:hover { border-color: var(--red-soft); color: var(--red-soft); background: rgba(232,92,92,.1); }
.sel-row__remove svg { width: 16px; height: 16px; }
.sel-cell { position: relative; }
.sel-cell > svg { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }

.calc__addrow {
  display: inline-flex; align-items: center; gap: .5rem; background: none;
  border: 1.5px dashed var(--border-2); color: var(--emerald-l); border-radius: var(--r-sm);
  padding: .65rem 1rem; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: .88rem;
  transition: border-color var(--t-fast), background var(--t-fast); width: 100%; justify-content: center;
}
.calc__addrow:hover { border-color: var(--emerald); background: rgba(35,174,109,.1); }
.calc__addrow svg { width: 16px; height: 16px; }

.calc__actions { display: grid; grid-template-columns: 1fr auto auto; gap: .7rem; margin: 1.2rem 0; }
.calc__btn-alt {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: none; border: 1.5px solid var(--border-2); color: var(--text-soft); border-radius: var(--r-pill);
  padding: .8rem 1.2rem; cursor: pointer; font-family: var(--font-display); font-weight: 600; font-size: .92rem;
  transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast), transform var(--t-fast);
  white-space: nowrap;
}
.calc__btn-alt svg { width: 17px; height: 17px; flex: none; }
.calc__reset:hover { border-color: var(--red-soft); color: var(--red-soft); background: rgba(232,92,92,.08); }
.calc__print:hover:not(:disabled) {
  border-color: var(--gold); color: var(--gold-l); background: rgba(255,168,0,.1); transform: translateY(-2px);
}
/* Disabled until there is a result worth printing. */
.calc__print:disabled { opacity: .4; cursor: not-allowed; }

/* results */
.calc__results { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.result {
  background: var(--ink); border: 1.5px solid var(--border-2); border-radius: var(--r-md);
  padding: 1.15rem; text-align: center; transition: border-color var(--t-med);
}
.result--profit { border-color: rgba(35,174,109,.42); background: rgba(35,174,109,.08); }
.result__label { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.result__value { font-family: var(--font-display); font-weight: 800; font-size: var(--step-3); color: #fff; margin-top: .3rem; letter-spacing: -.02em; }
.result--profit .result__value { color: var(--emerald-l); }
.result__value.is-loss { color: var(--red-soft); }
.result__sub { font-size: .77rem; color: var(--muted); margin-top: .25rem; }

.calc__error {
  display: none; margin-top: 1rem; padding: .8rem 1rem; border-radius: var(--r-sm);
  background: rgba(232,92,92,.12); border: 1px solid rgba(232,92,92,.4); color: #FFB4B4; font-size: .9rem;
}
.calc__error.is-visible { display: flex; gap: .5rem; align-items: center; }
.calc__error svg { width: 18px; height: 18px; flex: none; }

.calc__breakdown { margin-top: 1rem; border-top: 1px solid var(--border-2); padding-top: 1rem; display: none; }
.calc__breakdown.is-visible { display: block; }
.calc__breakdown h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-family: var(--font-mono); margin-bottom: .7rem; }
.bd-line { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; padding: .38rem 0; border-bottom: 1px dashed var(--border-2); color: var(--text-soft); }
.bd-line:last-child { border-bottom: none; }
.bd-line span:last-child { font-family: var(--font-mono); color: #fff; }

/* standalone calculator wrapper */
.tool-page-wrap { background: var(--ink); padding: var(--sp-6) 0; }

/* ==========================================================================
   Calculator responsive rules.
   These live here, not in responsive.css, because tool.css is loaded after it
   — a media query there would lose the cascade to the 2-column defaults above.
   ========================================================================== */
@media (max-width: 760px) {
  .calc__row     { grid-template-columns: 1fr; gap: .9rem; }
  .calc__results { grid-template-columns: 1fr; }
  .calc__actions { grid-template-columns: 1fr 1fr; }
  .calc__actions .btn { grid-column: 1 / -1; }
  .calc__btn-alt { width: 100%; }
  .calc__body    { padding: 1.15rem; }
  .seg           { width: 100%; }
  .seg button    { flex: 1; }
  .calc__toggles { gap: .5rem; }
  .toggle        { flex: 1 1 auto; justify-content: center; }
}

@media (max-width: 560px) {
  .calc__body { padding: 1rem; }
  .sel-head, .sel-row { grid-template-columns: 22px 1fr 1fr 34px; gap: .4rem; }
  .sel-row__result { padding: .6rem 1.5rem .6rem .55rem; }
  .calc__control, .calc__input, .calc select { padding: .65rem .7rem; font-size: .92rem; }
  .calc select { padding-right: 2rem; }
  .calc__select-wrap svg { right: .55rem; }
}

@media (max-width: 400px) {
  .calc__bar { padding: .7rem .8rem; gap: .5rem; }
  .calc__bar-title { display: none; }
  .sel-head span:nth-child(1), .sel-row__num { font-size: .7rem; }
  .result__value { font-size: 1.5rem; }
}
