body {
  padding-top: 45px;
}

.demo-page {
  padding-top: 80px;
  padding-bottom: 30px;
}

.box {
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
  background: #f8f9fa;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
  color: #111;
}

.yellow {
  background: linear-gradient(180deg, #fff1a8 0%, #ffe06c 100%);
  border: 1px solid #d9b100;
}

.purple {
  background: linear-gradient(180deg, #eedcff 0%, #e1c2ff 100%);
  border: 1px solid #8a4fd6;
}

.cyan {
  background: linear-gradient(180deg, #d9e8ff 0%, #c6dcff 100%);
  border: 1px solid #4d73c9;
}

.green {
  background: #8df5a6;
}

.box-title {
  text-align: center;
  font-weight: 700;
  font-size: 1.3rem;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

.btn {
  border-radius: 12px !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.15s ease;
}

.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.uniform-btn {
  width: 100%;
  height: 60px;
  margin-bottom: 6px;
  font-size: 1.1rem;
  font-weight: 700;
}

.next-btn {
  height: 100px;
  font-size: 1.3rem;
  font-weight: 700;
}

.athlete-grid-7 {
  display: grid;
  align-items: center;
  grid-template-columns: 1fr 60px 1fr 1fr 60px 60px 60px 60px 80px !important;
}

.athlete-box {
  display: grid;
  gap: 10px;
  align-items: center;
}

.athlete-box input {
  height: 45px;
  border-radius: 10px;
  border: 1px solid #ccc;
  padding: 5px 10px;
}

.athlete-select {
  height: 45px;
  border-radius: 10px;
  border: 1px solid #ccc;
  padding: 5px 38px 5px 10px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 16 16'%3E%3Cpath d='M1.5 5.5l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px;
}

.athlete-select:focus {
  border-color: #cd7f32;
  box-shadow: 0 0 5px rgba(205, 127, 50, 0.5);
}

.athlete-autofit {
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.athlete-number {
  text-align: center;
  padding-left: 0;
  padding-right: 0;
}

.athlete-total {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
}

.wd-full {
  grid-row: span 2;
  display: flex;
  align-items: flex-end;
}

.wd-full button {
  height: 90px;
  width: 100%;
}

.jump-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.jump-label,
.spin-label {
  display: flex;
  align-items: center;
  font-weight: 700;
}

.jump-btn {
  height: 56px;
  border-radius: 10px;
}

.small-control {
  flex: 1;
  height: 50px;
  font-size: 0.85rem;
  border-radius: 10px;
  padding: 4px;
}

.demo-table {
  font-size: 0.9rem;
}

.index-col {
  width: 40px;
  font-size: 0.8rem;
  color: gray;
}

.element-col {
  width: 120px;
}

.info-col {
  width: 100px;
}

.score-col {
  width: 70px;
}

.table td,
.table th {
  padding: 4px 6px;
  line-height: 1.1;
}

.goe-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}

.goe-group input,
.pcs-group input {
  display: none;
}

.goe-group label,
.pcs-group label {
  transition: all 0.15s ease;
}

.goe-group label:hover,
.pcs-group label:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.25);
}

.goe-group label {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 30px;
  margin: 1px;
  border-radius: 10px;
  background: #e7e6e6;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.8rem;
}

.goe-neg {
  background: #f8d7da;
}

.goe-zero {
  background: #d6d6d6;
}

.goe-pos {
  background: #d4edda;
}

.goe-group input:checked + .goe-neg {
  background: #dc3545;
  color: #fff;
}

.goe-group input:checked + .goe-zero {
  background: #6c757d;
  color: #fff;
}

.goe-group input:checked + .goe-pos {
  background: #28a745;
  color: #fff;
}

.spin-grid {
  display: grid;
  grid-template-columns: 60px repeat(6, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.spin-grid.cosp {
  grid-template-columns: 60px repeat(7, minmax(0, 1fr));
}

.spin-btn {
  height: 43px;
  width: 100%;
  border-radius: 10px;
  font-size: 0.85rem;
  padding: 0;
}

.nv-grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 5px;
  width: 100%;
}

.nv-btn {
  height: 45px;
  width: 100%;
  border-radius: 10px;
  font-size: 0.85rem;
  padding: 0;
}

.box.purple {
  overflow: hidden;
}

.deduction-row {
  align-items: stretch;
}

.deduction-row button {
  height: 60px;
}

.counter-box {
  min-width: 60px;
  height: 60px;
  padding: 0;
}

.active-row td {
  background-color: rgba(207, 232, 255, 0.5) !important;
}

.pcs-row {
  margin-top: 0;
}

.pcs-table {
  margin-bottom: 0;
}

.pcs-group {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background-color: #9fbfd3;
}

.pcs-group label {
  height: 30px;
  margin: 2px;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pcs-group input:checked + label {
  background: #007bff;
  color: #fff;
}

.components-box {
  margin-top: 0;
  background: linear-gradient(180deg, #bfe6ff 0%, #90d0f8 100%);
  border: 1px solid #4d73c9;
  height: 100%;
}

.regulations-box {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.regulations-content {
  flex-grow: 1;
  font-size: 0.9rem;
}

.components-box .table,
.components-box .table th,
.components-box .table td {
  background-color: transparent !important;
}

.components-box .table thead th {
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.spin-btn:disabled,
.pcs-group input:disabled + label,
.rule-disabled {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(100%);
  cursor: not-allowed !important;
}

.regulation-group + .regulation-group {
  margin-top: 2px;
}

.regulation-list li {
  margin-bottom: 0;
  line-height: 1.35;
}

.regulation-list li:last-child {
  margin-bottom: 0;
}

.reg-list {
  padding-left: 16px;
  margin-bottom: 8px;
}

.demo-modal {
  background: linear-gradient(145deg, #07080d, #111723, #1e2330);
  color: #fff;
  border-radius: 16px;
  border: 1px solid rgba(205, 127, 50, 0.4);
  box-shadow:
    0 0 20px rgba(205, 127, 50, 0.3),
    0 0 40px rgba(0, 0, 0, 0.6);
}

.demo-modal .modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #cd7f32;
}

.demo-modal .modal-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.demo-modal .modal-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 8px;
}

.demo-modal p {
  color: rgba(255, 255, 255, 0.9);
}

.demo-modal ul {
  padding-left: 18px;
}

.demo-modal li {
  margin-bottom: 6px;
}

.modal-backdrop.show {
  background-color: rgba(0, 0, 0, 0.75);
}

.demo-modal .btn-custom {
  background-color: #cd7f32;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  transition: all 0.2s ease;
}

.demo-modal .btn-custom:hover {
  background-color: #e08a3a;
  transform: translateY(-1px);
  box-shadow: 0 0 10px rgba(205, 127, 50, 0.6);
}

.demo-divider {
  height: 2px;
  width: 60px;
  background: #cd7f32;
  margin-top: 6px;
  border-radius: 2px;
}

.demo-modal .form-check {
  font-size: 0.85rem;
  opacity: 0.8;
  margin-top: 18px;
  margin-bottom: 0;
  padding-left: 1.2em;
}

.demo-modal .form-check-input {
  transform: scale(0.85);
  margin-top: 2px;
}

.demo-modal .form-check-input:checked {
  background-color: #cd7f32;
  border-color: #cd7f32;
}

.demo-modal .form-check-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
}

.demo-modal .form-check-label:hover {
  color: rgba(255, 255, 255, 0.9);
}

.lower-row {
  margin-top: 0;
  align-items: stretch !important;
}

@media (max-width: 1200px) {
  .athlete-grid-7 {
    grid-template-columns: repeat(4, 1fr);
  }

  .wd-full {
    grid-column: span 4;
  }
}

@media (max-width: 991px) {
  .demo-page {
    padding-top: 90px;
  }

  .athlete-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .wd-full {
    grid-row: auto;
  }

  .wd-full button {
    height: 56px;
  }

  .demo-actions {
    flex-direction: column;
  }

  .pcs-row {
    margin-top: 0;
  }
}
