#omni-game {
  min-height: 100%;
  width: 100%;
  max-width: 1120px;
  margin: 0;
  background: #ffffff;
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  gap: 20px;
}

#omni-game:fullscreen,
#omni-game:-webkit-full-screen,
#omni-game.omni-pseudo-fullscreen,
#omni-game.is-fs {
  --omni-connect-fullscreen-font-size: 22px;
}

.omni-game-toolbar {
  width: 100%;
  max-width: 980px;
  margin: 0 auto 1rem;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}

.omni-game-toolbar__timer {
  justify-self: start;
}

.omni-game-toolbar__stats {
  justify-self: center;
  text-align: center;
}

.omni-game-toolbar__actions {
  justify-self: end;
}

.omni-connect-hint {
  width: 100%;
  max-width: 980px;
  margin: -4px auto 0;
  padding: 10px 14px;
  border: 1px solid #d9e3f0;
  border-radius: 8px;
  background: #f7fbff;
  color: #26324a;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  box-sizing: border-box;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.omni-connect-hint[data-state="active"] {
  background: #fff8e8;
  border-color: #f0c66d;
  color: #5b4310;
}

.omni-connect-hint[data-state="success"] {
  background: #effbf5;
  border-color: #9fd9b8;
  color: #1d5134;
}

.omni-connect-board {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(12px, 2vw, 20px) clamp(10px, 1.8vw, 20px);
  box-sizing: border-box;
}

.omni-connect-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  overflow: visible;
}

.omni-connect-line {
  stroke: var(--omni-line-color, #7aa7ff);
  stroke-width: 6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.18));
  opacity: 0.92;
}

.omni-connect-columns {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: start;
}

.omni-connect-column {
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.2vw, 28px);
}

.omni-connect-row {
  display: flex;
  align-items: center;
  min-height: clamp(62px, 8vw, 86px);
  gap: clamp(12px, 1.8vw, 18px);
  min-width: 0;
}

.omni-connect-row--left {
  justify-content: flex-end;
}

.omni-connect-row--right {
  justify-content: flex-start;
}

.omni-connect-content {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  line-height: 1.2;
  font-size: calc(var(--omni-connect-fullscreen-font-size, var(--omni-connect-font-size, 18px)) + var(--omni-readable-font-adjust, 0px));
  color: #0a1242;
  box-sizing: border-box;
  min-width: 0;
  max-width: 100%;
  min-height: clamp(56px, 7vw, 76px);
  border: 2px solid #d7dee8;
  border-radius: 10px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.08);
  background-clip: padding-box;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.omni-connect-row.is-pending .omni-connect-content {
  border-color: #f0c66d;
  box-shadow: 0 8px 22px rgba(240, 198, 109, 0.22);
  transform: translateY(-1px);
}

.omni-connect-row.is-available-target .omni-connect-content {
  border-color: #9fd9b8;
  box-shadow: 0 8px 20px rgba(79, 136, 61, 0.16);
}

.omni-connect-row.is-connected .omni-connect-content {
  border-color: #b9c7d8;
}

.omni-connect-content--left {
  text-align: right;
  justify-content: flex-end;
  padding: 12px 16px;
}

.omni-connect-content--right {
  text-align: left;
  justify-content: flex-start;
  padding: 12px 16px;
}

.omni-connect-image {
  width: clamp(44px, 7vw, 92px);
  height: clamp(44px, 7vw, 92px);
  max-width: 100%;
  object-fit: contain;
  border-radius: 8px;
  flex-shrink: 0;
  cursor: zoom-in;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.omni-connect-image:hover,
.omni-connect-image:focus-visible {
  transform: scale(1.05);
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.18);
}

.omni-connect-text {
  display: inline-block;
  font-weight: 600;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.omni-connect-text--empty {
  opacity: 0.6;
}

.omni-connect-dot {
  width: clamp(36px, 4.8vw, 52px);
  height: clamp(36px, 4.8vw, 52px);
  border-radius: 999px;
  border: 4px solid #1f2a44;
  background: #fff;
  box-sizing: border-box;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 0 0 0 rgba(31, 51, 255, 0);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}

.omni-connect-dot:hover {
  transform: scale(1.06);
}

.omni-connect-dot:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(31, 51, 255, 0.25);
}

.omni-connect-dot.is-pending {
  border-color: #d99820;
  background: #fff6d8;
  box-shadow: 0 0 0 5px rgba(240, 198, 109, 0.28);
}

.omni-connect-dot.is-connected {
  border-color: #5f7fb8;
  background: #eef4ff;
}

.omni-connect-dot.is-available-target {
  border-color: #4f883d;
  box-shadow: 0 0 0 5px rgba(79, 136, 61, 0.18);
  animation: omni-connect-pulse 1.2s ease-in-out infinite;
}

@keyframes omni-connect-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

.omni-lightbox-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2147483646 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  visibility: hidden;
  padding: 24px;
  box-sizing: border-box;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.omni-lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.omni-lightbox-overlay img {
  width: min(92vw, 1180px);
  max-width: 92vw;
  max-height: 88vh;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
}

.omni-lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  z-index: 2147483647;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.omni-lightbox-close:hover,
.omni-lightbox-close:focus-visible {
  transform: scale(1.16);
  outline: 2px solid #fff;
  outline-offset: 4px;
}

#omni-game #omni-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 9999;
}

#omni-game #omni-popup.show {
  opacity: 1;
  pointer-events: auto;
}

.omni-save-result-section {
  max-width: 400px;
  margin: 18px auto 0;
  padding: 20px;
  background: #fdfdfd;
  border: 1px solid #eee;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  text-align: center;
}

.omni-save-checkbox-label {
  display: block;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: 600;
  color: #4f883d;
}

.omni-save-checkbox-label input {
  margin-right: 8px;
  transform: scale(1.2);
  vertical-align: middle;
}

.omni-learner-name-field {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e0e0e0;
}

.omni-learner-name-field > label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  margin-bottom: 8px;
  text-align: center;
}

.omni-learner-name-input {
  width: 100%;
  padding: 18px 20px;
  font-size: 16px;
  line-height: 1.45;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  min-height: 54px;
}

.omni-learner-name-input:focus {
  outline: none;
  border-color: #4f883d;
  box-shadow: 0 0 0 3px rgba(79, 136, 61, 0.15);
}

.omni-learner-name-input:read-only,
.omni-learner-name-input:disabled {
  background: #f0f0f0;
  cursor: not-allowed;
}

.omni-save-result-btn {
  display: block;
  width: 100%;
  padding: 14px 24px;
  margin: 8px 0 12px;
  background: linear-gradient(135deg, #4f883d 0%, #3e6c31 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.omni-save-result-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 136, 61, 0.3);
}

.omni-save-result-btn.saved {
  background-color: #4f883d !important;
  cursor: default;
}

.omni-save-result-btn:disabled {
  opacity: 0.7;
}

.omni-privacy-note {
  margin: 0 0 10px;
  font-size: 12px;
  color: #1e1e1e;
  font-style: italic;
  text-align: center;
}

.omni-save-result-message {
  margin-top: 15px;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 0.9em;
  font-weight: 500;
  text-align: center;
}

.omni-save-result-message.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.omni-save-result-message.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

@media (max-width: 1100px) {
  .omni-connect-board {
    max-width: 920px;
  }

  .omni-connect-columns {
    gap: clamp(26px, 5vw, 70px);
  }
}

@media (max-width: 768px) {
  #omni-game {
    padding: 14px 10px;
  }

  .omni-connect-board {
    width: 100%;
    padding: 8px 0;
  }

  .omni-connect-columns {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(12px, 4vw, 28px);
  }

  .omni-connect-row {
    min-height: 52px;
  }

  .omni-connect-row--left {
    justify-content: flex-end;
  }

  .omni-connect-row--right {
    justify-content: flex-start;
  }

  .omni-connect-dot {
    width: 38px;
    height: 38px;
    border-width: 3px;
  }

  .omni-connect-line {
    stroke-width: 4;
  }

  .omni-connect-hint {
    font-size: 14px;
    padding: 9px 12px;
  }

  .omni-save-result-section {
    max-width: 100%;
    padding: 15px;
  }
}

.omni-game-compact .omni-connect-column {
  gap: 12px;
}

.omni-game-compact .omni-connect-dot {
  width: 34px;
  height: 34px;
}
