html,
body {
  min-height: 100%;
}

body {
  background: #f4f6f8;
  color: #17202a;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.app-shell {
  min-height: 100vh;
}

.app-topbar {
  background: #080b10;
  border-bottom: 1px solid #202735;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-topbar img {
  display: block;
  width: 132px;
  max-width: 100%;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-version {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.app-version-footer {
  display: block;
  margin: 18px auto 0;
  text-align: center;
}

.topbar-language-select {
  height: 34px;
  min-width: 74px;
  border: 1px solid #364152;
  border-radius: 6px;
  background: #111827;
  color: #ffffff;
  font-weight: 700;
  padding: 4px 10px;
}

.page-wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 34px 18px 48px;
}

.page-header {
  margin-bottom: 22px;
}

.page-title {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 6px;
  font-weight: 700;
  color: #111827;
}

.page-subtitle {
  color: #5f6b7a;
  margin: 0;
}

.control-panel {
  background: #ffffff;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  box-shadow: 0 16px 38px rgba(17, 24, 39, 0.08);
  overflow: hidden;
}

.panel-bar {
  background: #111827;
  color: #ffffff;
  padding: 15px 20px;
}

.panel-bar-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0;
}

.panel-body {
  padding: 22px;
}

.step {
  border-bottom: 1px solid #e7ebf0;
  padding: 0 0 22px;
  margin-bottom: 22px;
}

.step:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.step-heading {
  display: table;
  width: 100%;
  margin-bottom: 14px;
}

.step-number,
.step-copy {
  display: table-cell;
  vertical-align: top;
}

.step-number {
  width: 38px;
}

.step-number span {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  border-radius: 50%;
  background: #17202a;
  color: #ffffff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.step-title {
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
  font-weight: 700;
  color: #111827;
}

.step-note {
  margin: 3px 0 0;
  color: #667085;
  font-size: 14px;
}

.form-control {
  min-height: 44px;
  border-radius: 6px;
  border-color: #cfd6df;
}

.team-name-input {
  text-transform: uppercase;
}

.form-control:focus {
  border-color: #275dff;
  box-shadow: 0 0 0 0.16rem rgba(39, 93, 255, 0.16);
}

.form-control.is-invalid-custom {
  border-color: #dc2626;
  background: #fffafa;
}

.form-control.is-invalid-custom:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 0.16rem rgba(220, 38, 38, 0.16);
}

.validation-message {
  display: none;
  margin-top: 6px;
  color: #b42318;
  font-size: 13px;
  font-weight: 600;
}

.validation-message.is-visible {
  display: block;
}

.input-group .form-control {
  min-height: 46px;
}

.btn {
  border-radius: 6px;
  font-weight: 700;
}

.btn-primary {
  background: #1237c8;
  border-color: #1237c8;
}

.btn-primary:hover,
.btn-primary:focus {
  background: #0d2da8;
  border-color: #0d2da8;
}

.btn-success {
  background: #12805c;
  border-color: #12805c;
}

.btn-success:hover,
.btn-success:focus {
  background: #0f6d4f;
  border-color: #0f6d4f;
}

.whatsapp-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  background: #25d366;
  border-color: #25d366;
  color: #ffffff;
}

.whatsapp-button:hover,
.whatsapp-button:focus {
  background: #1ebe5d;
  border-color: #1ebe5d;
  color: #ffffff;
}

.whatsapp-icon {
  position: relative;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-radius: 50%;
  flex: 0 0 auto;
}

.whatsapp-icon::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-35deg);
}

.whatsapp-icon::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 7px;
  height: 7px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-12deg);
}

.btn-outline-secondary {
  border-color: #9aa6b2;
  color: #263241;
}

.status-box {
  min-height: 44px;
  border: 1px solid #dfe4ea;
  background: #f8fafc;
  color: #5f6b7a;
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 10px;
  font-size: 14px;
}

.status-box.text-success {
  border-color: #91d5ad;
  background: #f0fbf5;
  color: #146c43;
}

.status-box.text-danger {
  border-color: #f1a6a6;
  background: #fff5f5;
  color: #b42318;
}

.control-mode-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.control-mode-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid #cfd6df;
  border-radius: 6px;
  background: #ffffff;
  color: #263241;
  font-weight: 700;
  cursor: pointer;
}

.control-mode-option input {
  margin: 0;
}

.choice-grid {
  margin-left: -6px;
  margin-right: -6px;
}

.choice {
  display: block;
  border: 1px solid #cfd6df;
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  background: #ffffff;
  min-height: 74px;
}

.choice input {
  margin-right: 7px;
}

.choice-title {
  font-weight: 700;
  color: #17202a;
}

.choice-note {
  display: block;
  margin-top: 3px;
  color: #667085;
  font-size: 13px;
}

.choice:hover {
  border-color: #8ca0ff;
}

.tournament-toggle {
  background: #f8fafc;
  border: 1px solid #dfe4ea;
  border-radius: 8px;
  padding: 12px 14px;
}

.optional-label {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e9eef5;
  color: #405066;
  font-size: 12px;
  font-weight: 700;
}

.optional-note {
  margin: 5px 0 0;
  color: #667085;
  font-size: 13px;
}

.submit-row {
  border-top: 1px solid #e7ebf0;
  margin-top: 22px;
  padding-top: 22px;
}

.active-game-panel {
  margin-top: 12px;
  background: #fffbeb;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  padding: 14px 16px;
}

.active-game-message {
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  margin: 0 0 12px;
}

.active-game-details {
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 6px;
  margin-bottom: 12px;
  padding: 10px 12px;
}

.active-game-teams {
  color: #111827;
  font-weight: 800;
}

.active-game-meta {
  color: #667085;
  font-size: 13px;
  margin-top: 2px;
}

.active-game-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.existing-game {
  background: #f0fbf5;
  border: 1px solid #91d5ad;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 14px;
}

.ready-panel {
  max-width: 720px;
  margin: 0 auto;
}

.ready-section {
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  text-align: center;
}

.ready-section-title {
  font-size: 17px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  order: 0;
}

.ready-section-note {
  font-size: 14px;
  color: #5f6b7a;
  margin-bottom: 18px;
  order: 2;
}

.ready-action-note {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  color: #334155;
  font-weight: 600;
  order: 1;
}

.ready-qr-note {
  margin-top: 0;
  order: 3;
}

.ready-divider {
  border-top: 1px solid #e7ebf0;
  margin: 0;
}

.ready-link-box {
  margin: 7px auto 16px;
  padding: 12px 14px;
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  background: #f8fafc;
  color: #405066;
  font-size: 14px;
  word-break: break-word;
}

.ready-link-label {
  color: #263241;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.ready-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  order: 2;
  margin-bottom: 18px;
}

.ready-share-actions {
  display: flex;
  justify-content: center;
  order: 5;
  margin: -6px 0 18px;
}

.ready-button {
  min-width: 240px;
}

.qr-code-img {
  display: block;
  order: 4;
  margin: 0 auto 20px;
  border-radius: 8px;
  border: 4px solid #ffffff;
}

.ready-link-label {
  order: 6;
}

.ready-link-box {
  order: 7;
}

@media only screen and (max-width: 767px) {
  .page-wrap {
    padding-top: 22px;
  }

  .page-title {
    font-size: 24px;
  }

  .panel-body {
    padding: 18px;
  }

  .input-group-append {
    width: 100%;
  }

  .input-group-append .btn {
    width: 100%;
    margin-top: 8px;
    border-radius: 6px;
  }

  .choice {
    margin-bottom: 10px;
  }
}
