
/* Vocabulary Matching Game v3.5.5 */

.vg-game {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  position: relative;
  /* Shared colors for effects */
  --vg-surface: #ffffff;
  --vg-lock-border: rgba(22, 163, 74, 0.85);
  --vg-lock-bg: rgba(22, 163, 74, 0.12);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.35;
}

.vg-game * {
  box-sizing: border-box;
}

.vg-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0 6px 0;
}

.vg-date {
  font-size: inherit;
  font-weight: 600;
  color: #111827 !important;
  -webkit-text-fill-color: #111827;
  white-space: nowrap;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}


.vg-instructions {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.vg-instructions-text {
  font-weight: 600;
  color: #111827 !important;
}

.vg-progress {
  color: #6b7280 !important;
  font-weight: 600;
}

.vg-controls {
  display: flex;
  gap: 12px;
  padding: 6px 0 10px 0;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-start;
}

.vg-control {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
}

.vg-control-label {
  font-size: 12px;
  color: #6b7280 !important;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.vg-topic, .vg-level {
  width: 100%;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  background: #ffffff;
  color: #111827 !important;
  -webkit-text-fill-color: #111827;
  font-size: 14px;
  line-height: 1.2;
  height: 40px;
}

.vg-status {
  padding: 0 0 10px 0;
  color: #b91c1c;
  font-size: 13px;
  min-height: 18px;
}

/* Board uses rows (each row has a word + definition). */
.vg-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 0 12px 0;
}

.vg-board-head {
  display: grid;
  /* 3 columns: words | connector gap | definitions
     Using a fixed middle column keeps the layout stable and gives us a
     clean place to draw the “matched” connector without intruding into text.
  */
  grid-template-columns: 0.85fr 10px 1.15fr;
  gap: 0;
}

.vg-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vg-row {
  display: grid;
  grid-template-columns: 0.85fr 10px 1.15fr;
  gap: 0;
  position: relative;
  overflow: visible;
}

.vg-row .vg-card {
  z-index: 1;
}

.vg-col-title {
  font-size: 12px;
  color: #6b7280 !important;
  font-weight: 700;
  margin: 0 0 6px 2px;
}

.vg-card {
  position: relative;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.18);
  background: #ffffff;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  text-transform: none !important;
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.vg-card:focus {
  outline: none;
}

.vg-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(17, 24, 39, 0.10);
}

.vg-card .vg-card-text {
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  text-transform: none !important;
  position: relative;
  z-index: 1;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  word-break: break-word;
}

.vg-card.vg-type-def .vg-card-text {
  font-weight: 500;
}

.vg-card.vg-is-disabled {
  opacity: 0.75;
  cursor: default;
}

/* Disabled/locked cards should not lift on hover, but we still allow animations. */
.vg-card.vg-is-disabled:hover {
  transform: none;
  box-shadow: none;
}

.vg-card.vg-is-selected {
  border-color: rgba(37, 99, 235, 0.9) !important;
  background: rgba(59, 130, 246, 0.10) !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

.vg-card.vg-is-locked {
  border-color: var(--vg-lock-border) !important;
  background: var(--vg-lock-bg) !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12) !important;
  cursor: default;
}

/* Only show the checkmark on the RIGHT (definition) card. */
.vg-card.vg-is-locked.vg-type-def {
  /* Keep text clear of the checkmark */
  padding-right: 38px;
}

.vg-card.vg-is-locked.vg-type-def::after {
  content: "✓";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 24px;
  font-weight: 900;
  color: rgba(22, 163, 74, 0.30);
  pointer-events: none;
  z-index: 0;
}

/* Matched-connector (simple line)
   - A thin line appears ONLY when a row is locked (matched).
   - It sits entirely in the middle gap column, so it never overlaps text.
   - Symmetrical and minimal.
*/

.vg-col-spacer {
  /* Placeholder column for header alignment */
}

.vg-join {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.vg-join::before {
  content: "";
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.55);
  opacity: 0;
  transform: scaleX(0.25);
  transform-origin: center;
}

.vg-row-locked .vg-join::before {
  opacity: 1;
  transform: scaleX(1);
}

.vg-row.vg-row-just-locked .vg-join::before {
  animation: vg-line-draw 420ms ease-out;
}

.vg-card.vg-is-wrong {
  border-color: rgba(220, 38, 38, 0.9) !important;
  background: rgba(220, 38, 38, 0.10) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
  animation: vg-shake 320ms ease-in-out;
}

@keyframes vg-shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-4px); }
  40%  { transform: translateX(4px); }
  60%  { transform: translateX(-3px); }
  80%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

@keyframes vg-line-draw {
  0%   { transform: scaleX(0.10); opacity: 0.15; }
  60%  { transform: scaleX(1.10); opacity: 1; }
  100% { transform: scaleX(1); opacity: 1; }
}

.vg-btn {
  appearance: none;
  border: 0;
  padding: 9px 14px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none !important;
  background-color: #4b64ad !important; /* slightly toned-down blue */
  box-shadow: none !important;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 120ms ease, opacity 120ms ease;
  height: 40px;
  white-space: nowrap;
}

.vg-btn:hover {
  background-color: #3f5698 !important; /* darker blue */
  box-shadow: none !important;
  transform: none !important;
}

.vg-btn:active {
  background-color: #394e89 !important;
  transform: none !important;
}

.vg-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.vg-finish {
  padding: 10px 0;
}

.vg-finish-box {
  border-radius: 14px;
  border: 1px solid rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.08);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

/* Secondary button (Share). */
.vg-btn.vg-btn-secondary {
  background: #ffffff !important;
  color: #4b64ad !important;
  -webkit-text-fill-color: #4b64ad !important;
  border: 1px solid rgba(75, 100, 173, 0.45) !important;
  box-shadow: none;
}

.vg-btn.vg-btn-secondary:hover {
  background: rgba(75, 100, 173, 0.08) !important;
  box-shadow: none !important;
}

/* Share menu */
.vg-share {
  position: relative;
  display: inline-flex;
}

.vg-share-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.16);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

/* Invisible hover bridge so the menu doesn't disappear when moving the mouse from the button to the icons. */
.vg-share-menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 10px;
}


.vg-share:hover .vg-share-menu,
.vg-share.vg-share-open .vg-share-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.vg-share-link {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 24, 39, 0.12);
  background: #ffffff;
  text-decoration: none;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

.vg-share-link:hover {
  background: rgba(75, 100, 173, 0.10);
  border-color: rgba(75, 100, 173, 0.30);
  }


.vg-share-link svg {
  width: 16px;
  height: 16px;
  display: block;
  fill: currentColor;
}

/* Brand colors (icons use Bootstrap Icons SVG shapes; brands are trademarks of their owners). */
.vg-share-fb { color: #1877F2 !important; -webkit-text-fill-color: #1877F2 !important; }
.vg-share-x { color: #111827 !important; -webkit-text-fill-color: #111827 !important; }
.vg-share-reddit { color: #FF4500 !important; -webkit-text-fill-color: #FF4500 !important; }
.vg-share-linkedin { color: #0A66C2 !important; -webkit-text-fill-color: #0A66C2 !important; }
.vg-share-email { color: #4b64ad !important; -webkit-text-fill-color: #4b64ad !important; }

.vg-share-ico {
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
}

.vg-finish-title {
  font-weight: 800;
  color: #065f46 !important;
}

/* Confetti burst (shown when all 10 matches are completed). */
.vg-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 80;
}

.vg-confetti-piece {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0.95;
  animation: vg-confetti-fall var(--vg-dur, 1200ms) ease-out forwards;
  transform: translate3d(0, 0, 0) rotate(0deg);
}

@keyframes vg-confetti-fall {
  0% {
    transform: translate3d(0, 0, 0) rotate(0deg);
    opacity: 0.95;
  }
  100% {
    transform: translate3d(var(--vg-x, 0px), 120vh, 0) rotate(var(--vg-rot, 540deg));
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .vg-card,
  .vg-share-menu,
  .vg-btn,
  .vg-confetti-piece {
    transition: none !important;
    animation: none !important;
  }
}


@media (max-width: 720px) {
  .vg-topbar {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
    padding: 10px 0 8px 0;
  }
  .vg-instructions {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .vg-instructions-text {
    font-size: 15px;
    line-height: 1.35;
  }
  .vg-progress {
    font-size: 13px;
  }
  .vg-date {
  font-size: inherit;
  font-weight: 600;
  color: #111827 !important;
  -webkit-text-fill-color: #111827;
  white-space: nowrap;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
}
  .vg-controls {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 6px 0 10px 0;
  }
  .vg-control {
    min-width: 0;
    width: 100%;
  }
  .vg-topic, .vg-level {
    max-width: none;
  }
  .vg-btn.vg-new-round {
    width: 100%;
  }
  .vg-finish-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

