body {
  background: #0f3b2f;
  color: #fff;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  background: #181c1f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo img {
  height: 40px;
  object-fit: contain;
  display: block;
}

@media (min-width: 768px) {
  .logo img {
    height: 48px;
  }
}

.logo-title {
  font-size: 24px;
  font-weight: 700;
  color: #FFD166;
}

.calc-screen {
  padding-top: 56px;
  padding-bottom: 88px; /* чтобы нижний бар не перекрывал контент */
  max-width: 480px;
  margin: 0 auto;
}

.section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 18px 16px 12px;
  color: #FFD166;
}

.params {
  margin: 18px 16px 10px;
  background: rgba(255,255,255,0.04);
  border-radius: 14px;
  padding: 18px 14px 10px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.params label {
  font-size: 14px;
  font-weight: 500;
  margin-top: 10px;
  display: block;
  color: #FFD166;
}

.params input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: none;
  margin: 6px 0 12px 0;
  font-size: 16px;
  background: #17382d;
  color: #fff;
  outline: none;
  box-sizing: border-box;
}

/* Убрать стрелки у числовых инпутов */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

.params input:focus {
  box-shadow: 0 0 0 2px #FFD166;
}

.players-list {
  margin: 0 16px 12px;
}

.player-card {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 10px 10px 0;
  margin-bottom: 10px;
  gap: 10px;
}

.player-avatar {
  background: #bfa040;
  color: #181c1f;
  font-weight: 700;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
   margin-left: 4px;
}

.player-name {
  flex: 1;
  font-size: 16px;
  color: #fff;
  background: #17382d;
  border: 2px solid transparent;
  outline: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 8px;
  min-width: 0;
}

.player-name:focus {
  border-color: #FFD166;
  box-shadow: 0 0 0 2px rgba(255, 209, 102, 0.15);
}

.player-name::placeholder {
  color: rgba(255,255,255,0.6);
}

.player-chips {
  width: 60px;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: #17382d;
  color: #fff;
  font-size: 15px;
  text-align: right;
  margin-left: 6px;
}

.player-rebuy {
  display: flex;
  align-items: center;
  gap: 4px;
}

.player-rebuy-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255,209,102,0.5);
  background: rgba(255,209,102,0.15);
  color: #FFD166;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.player-rebuy-btn:hover {
  background: rgba(255,209,102,0.25);
}

.player-rebuy-custom {
  display: flex;
  align-items: center;
  gap: 2px;
}

.player-rebuy-input {
  width: 36px;
  padding: 4px 4px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #17382d;
  color: #fff;
  font-size: 12px;
  text-align: center;
}

.player-rebuy-input::placeholder {
  color: rgba(255,255,255,0.4);
}

.player-rebuy-add {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 4px;
  border: 1px solid rgba(255,209,102,0.4);
  background: rgba(255,209,102,0.2);
  color: #FFD166;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.player-rebuy-add:hover {
  background: rgba(255,209,102,0.35);
}

.player-remove {
  background: none;
  border: none;
  color: #d94343;
  font-size: 22px;
  cursor: pointer;
  margin-left: 4px;
  padding: 0 8px;
}

.add-player-btn {
  width: calc(100% - 32px);
  margin: 0 16px 10px;
  padding: 12px;
  border-radius: 10px;
  background: #FFD166;
  color: #181c1f;
  font-weight: 700;
  font-size: 16px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.add-player-btn:hover {
  background: #bfa040;
}

.reset-btn {
  width: calc(100% - 32px);
  margin: 0 16px 4px;
  padding: 10px;
  border-radius: 10px;
  background: #17382d;
  color: rgba(255,255,255,0.9);
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(255,209,102,0.4);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.reset-btn:hover {
  background: rgba(255,209,102,0.18);
  color: #FFD166;
  border-color: rgba(255,209,102,0.7);
}

#computeBtn {
  background: linear-gradient(135deg, #FFD166 0%, #d4af37 100%);
  border: 2px solid #d4af37;
  box-shadow: 0 6px 16px rgba(212, 175, 55, 0.35), 0 2px 0 rgba(0,0,0,0.12);
  color: #181c1f;
}

#computeBtn:hover {
  background: linear-gradient(135deg, #ffe08a 0%, #b8860b 100%);
}

#computeBtn:focus {
  outline: 2px solid #FFD166;
  outline-offset: 2px;
}

#computeBtn:active {
  filter: brightness(0.98);
  transform: translateY(0.5px);
}

.results {
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  padding: 12px;
  display: none;
  margin: 0 16px;
}

/* Всплывающие уведомления */
.chip-alert {
  position: fixed;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  max-width: 420px;
  width: calc(100% - 32px);
  background: #b3261e;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  font-size: 14px;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  z-index: 500;
  animation: chip-alert-in 0.18s ease-out;
}

.chip-alert.chip-alert--success {
  background: #1a4d3e !important;
  border: 1px solid rgba(80,200,120,0.5);
  box-shadow: 0 8px 20px rgba(26,77,62,0.4);
}

.chip-alert.chip-alert--success .chip-alert__icon {
  color: #50c878;
  font-weight: 700;
}

.chip-alert__icon {
  font-size: 18px;
  line-height: 1;
}

.chip-alert__text {
  flex: 1;
}

.chip-alert__close {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.9);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
}

@keyframes chip-alert-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
}

.result-row span {
  font-weight: 600;
}

.result-row strong {
  font-size: 16px;
}

.delta {
  margin-left: 10px;
  font-size: 13px;
  font-weight: 700;
}

.delta.profit {
  color: #50c878;
}

.delta.loss {
  color: #ff6b6b;
}

.delta.neutral {
  color: #cccccc;
}

.result-total {
  margin-top: 8px;
  font-weight: 700;
}

.result-meta {
  margin-top: 4px;
  font-size: 13px;
  opacity: 0.8;
}

.share-btn {
  margin-top: 10px;
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,209,102,0.6);
  background: linear-gradient(135deg, rgba(255,209,102,0.15), rgba(212,175,55,0.3));
  color: #FFD166;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.share-btn:hover {
  background: linear-gradient(135deg, rgba(255,209,102,0.25), rgba(212,175,55,0.45));
  color: #fff;
  border-color: rgba(255,209,102,0.9);
}

@media (min-width: 600px) {
  .calc-screen {
    max-width: 420px;
  }
}

/* Нижняя навигация, как в мобильных приложениях */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  background: #181c1f;
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 300;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.08);
}

.bottom-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  text-decoration: none;
  padding: 0 2px;
  height: 100%;
  transition: color 0.2s;
}

.bottom-nav-btn svg {
  display: block;
  margin-bottom: 2px;
  height: 22px;
  width: 22px;
  fill: currentColor;
}

.bottom-nav-btn.active,
.bottom-nav-btn:hover {
  color: #FFD166;
}

/* Блоки комбинаций покера и легенда мастей */
.hands-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 8px 20px;
  max-width: 780px;
  margin: 12px auto 0;
}

.poker-hand {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 170px 1fr;
  align-items: center;
  gap: 10px;
}

.poker-hand .hand-name {
  font-weight: 800;
  font-size: 16px;
}

.hand-desc {
  opacity: .8;
  font-size: 13px;
}

.cards-row {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
}

.card-mini {
  width: clamp(28px, 8vw, 36px);
  height: clamp(38px, 11vw, 48px);
  background: #fff;
  color: #000;
  border: 2px solid #000;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.card-mini .s {
  color: #111;
}

.card-mini .h,
.card-mini .d {
  color: #d94343;
}

.card-mini .c {
  color: #111;
}

.card-mini.dim {
  opacity: .45;
}

.suits-legend {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 8px 16px;
  opacity: .9;
  flex-wrap: wrap;
}

.suit {
  display: flex;
  align-items: center;
  gap: 8px;
}

.suit .icon {
  font-size: 18px;
  line-height: 1;
}

.suit .black {
  color: #111;
}

.suit .red {
  color: #d94343;
}

@media (max-width: 420px) {
  .cards-row {
    flex-wrap: wrap;
    gap: 6px 6px;
  }

  .poker-hand {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .poker-hand .hand-name {
    font-size: 15px;
  }

  .hand-desc {
    font-size: 12px;
  }
}

@media (max-width: 768px) and (min-width: 421px) {
  .poker-hand {
    grid-template-columns: 140px 1fr;
  }
}
