/* =============================================================================
   Camelot Wheel Widget — Styles
   Mobile-first. On small screens the layout stacks (wheel on top,
   match panels below). At ≥1024px the original 3-column layout is restored.
   ============================================================================= */

/* ---- Wrapper layout ---- */
#cw-wrap {
  display: flex;
  flex-direction: column;       /* mobile: stack */
  gap: 1rem;
  align-items: stretch;
  padding: 8px 0;
}

#cw-left,
#cw-right {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

#cw-wheel {
  width: 100%;
  max-width: 492px;
  margin: 0 auto;               /* centre wheel on mobile */
}

#cw-svg {
  width: 100%;
  height: auto;
  max-width: 492px;
  display: block;
}

/* On mobile, show the wheel BEFORE the side panels even though
   #cw-left precedes it in the DOM (preserves desktop source order). */
#cw-wheel { order: -1; }

/* ---- Tablet: 2 panels side-by-side under the wheel ---- */
@media (min-width: 768px) {
  #cw-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "wheel wheel"
      "left  right";
    gap: 16px;
  }
  #cw-wheel { grid-area: wheel; order: 0; }
  #cw-left  { grid-area: left;  }
  #cw-right { grid-area: right; }
}

/* ---- Desktop: original 3-column layout (left | wheel | right) ---- */
@media (min-width: 1024px) {
  #cw-wrap {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 16px;
  }
  #cw-left,
  #cw-right {
    flex: 1 1 0;
    width: auto;
  }
  #cw-wheel {
    flex: 0 0 380px;
    max-width: 380px;
    order: 0;
    margin: 0;
  }
  #cw-svg { max-width: 380px; }
}

/* ---- Hint text ---- */
#cw-hint {
  text-align: center;
  font-size: 13px;
  color: #9ca3af;
  padding: 8px 0;
  line-height: 1.4;
}

@media (min-width: 768px) { #cw-hint { padding: 12px 0; } }

/* ---- Section labels ---- */
.cw-sec-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 0 2px;
  margin-bottom: 4px;
}
.cw-sec-label.g { color: #16a34a; }
.cw-sec-label.o { color: #d97706; }
.cw-sec-label.r { color: #dc2626; }

.cw-sec-div {
  height: 1px;
  background: #374151;
  margin: 8px 0;
}

/* ---- Match cards ---- */
.cw-cm {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 0.5px solid #374151;
  background: #111827aa;
  cursor: pointer;
  transition: background .12s;
  min-height: 44px;             /* touch target */
  -webkit-tap-highlight-color: transparent;
}
.cw-cm:hover { background: #1f2937; }

.cw-cm-l    { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.cw-cm-type { font-size: 12px; font-weight: 600; }
.cw-cm-move { font-size: 11px; color: #9ca3af; line-height: 1.3; }
.cw-cm-key  { font-size: 14px; font-weight: 600; color: #f9fafb; margin-top: 2px; }
.cw-cm-e    { font-size: 18px; margin-left: 4px; flex-shrink: 0; }

@media (min-width: 1024px) {
  /* Restore the original tighter density on desktop */
  .cw-cm      { padding: 6px 9px; min-height: 0; }
  .cw-cm-type { font-size: 11px; font-weight: 500; }
  .cw-cm-move { font-size: 10px; }
  .cw-cm-key  { font-size: 13px; font-weight: 500; }
  .cw-cm-e    { font-size: 15px; margin-left: 6px; }
}

/* ---- Legend ---- */
.cw-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid #374151;
}
.cw-li { display: flex; align-items: center; gap: 4px; font-size: 11px; color: #9ca3af; }
.cw-ld { width: 8px; height: 8px; border-radius: 50%; }

@media (min-width: 1024px) {
  .cw-li { font-size: 10px; }
}
