
/* Sorting Game – light outdoor theme */

/* Overlay over the board */
.sg-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  z-index: 9999;
  font-family: "Quicksand", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

/* Main card */
.sg-container {
  width: min(980px, 96vw);
  max-height: 90vh;
  background: #f5fce8;  
  border-radius: 24px;
  border: 3px solid #8abf6b; 
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

/* Header */
.sg-header {
  padding: 18px 24px;
  background: #e9f8d7;
  border-bottom: 2px solid #9eca7e;
  display: flex;
  align-items: center;
  gap: 16px;
}

.sg-title {
  margin: 0;
  flex: 1;
  font-size: 24px;
  font-weight: 700;
  color: #355e26;
}

.sg-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: #4c7e34;
}

.sg-timer {
  padding: 6px 12px;
  border-radius: 16px;
  background: #d3f2b5;
  border: 1px solid #a4d480;
}

/* Progress bar + text */
.sg-progress {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.sg-progress-text {
  font-size: 13px;
  color: #8a6220;
}

.sg-progress-bar {
  width: 160px;
  height: 8px;
  border-radius: 999px;
  background: #d7efbf;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px #b7d79e;
}

.sg-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5ca743, #8bd46b);
  transition: width 0.2s ease-out;
}

/* Close button */
.sg-close {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 26px;
  color: #a07225;
  margin-left: 8px;
}
.sg-close:hover {
  color: #c4841f;
}

/* Main content */
.sg-main {
  padding: 22px 26px 18px;
  overflow: auto;
}

.sg-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 32px;
}

.sg-subtitle {
  font-size: 18px;
  font-weight: 600;
  color: #355e26;
  margin-bottom: 8px;
}

/* Current item card */
.sg-current {
  display: grid;
  gap: 10px;
}

.sg-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: #f2fbe2;
  border-radius: 18px;
  border: 2px solid #b4d99e;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  font-size: 16px;
  text-align: left;
  cursor: default;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    background 0.12s ease, border-color 0.12s ease, opacity 0.2s ease;
}
.sg-item:focus {
  outline: 2px solid #4c9fff;
  outline-offset: 3px;
}
.sg-emoji {
  font-size: 34px;
}
.sg-name {
  font-size: 17px;
  color: #3f3413;
}

/* Feedback states on the item */
.sg-item--correct {
  background: #dbf8ce;
  border-color: #59a34a;
  box-shadow: 0 0 0 2px rgba(87, 177, 75, 0.35);
}
.sg-item--wrong {
  background: #ffeaea;
  border-color: #e7786e;
  box-shadow: 0 0 0 2px rgba(231, 120, 110, 0.35);
}

/* little "pop then fade" animation */
.sg-item--animate-out {
  animation: sg-pop-fade 280ms ease-out forwards;
}

@keyframes sg-pop-fade {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  40% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(0.9) translateY(-6px);
    opacity: 0;
  }
}

/* Bins */
.sg-bins-wrap {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.sg-bin {
  background: #eef7e1;
  border-radius: 20px;
  border: 3px dashed #b6d9a1;
  min-height: 140px;
  padding: 18px 14px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease,
    border-color 0.12s ease, background 0.12s ease;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.06);
}

.sg-bin-label-main {
  font-size: 18px;
  font-weight: 700;
  color: #2e5d24;
}
.sg-bin-label-sub {
  font-size: 13px;
  margin-top: 4px;
  color: #557a3d;
}

/* Hover + selected feedback */
.sg-bin:hover {
  transform: translateY(-3px);
  background: #e6f5d5;
  border-color: #94c47b;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.08);
}

.sg-bin--selected {
  transform: translateY(-4px) scale(1.02);
  background: #e4f5ff;
  border-color: #4a9fff;
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.16);
}

/* hover style when dragging (if you still keep drag support) */
.sg-bin--hover {
  transform: translateY(-2px);
  border-color: #9eb5ff;
  background: #eef3ff;
}

/* Footer */
.sg-footer {
  padding: 14px 22px;
  background: #e9f8d7;
  border-top: 2px solid #9eca7e;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sg-hint {
  font-size: 13px;
  color: #355e26;
}

/* Buttons */
.sg-btn,
.sg-end {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 11px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.12s ease;
}

.sg-btn-primary {
  background: #5ba847;
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(91, 168, 71, 0.3);
}
.sg-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow: 0 6px 16px rgba(57, 165, 75, 0.35);
}

.sg-btn-secondary {
  background: #e5eee0;
  color: #355e26;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.sg-btn-secondary:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

/* RESULTS VIEW ------------------------------------ */

.sg-results {
  padding: 22px 26px 18px;
}

.sg-results-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.1fr);
  gap: 32px;
}

.sg-results-heading {
  font-size: 18px;
  font-weight: 600;
  color: #355e26;
  margin-bottom: 8px;
}

/* Left: metrics */
.sg-results-metrics {
  display: grid;
  align-content: start;
  gap: 10px;
}

.sg-results-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 16px;
  font-size: 15px;
  color: #41351a;
}
.sg-results-dl dt {
  font-weight: 600;
}
.sg-results-dl dd {
  margin: 0;
}

.sg-stars {
  font-size: 22px;
  color: #e0c342;
  letter-spacing: 4px;
}

.sg-grade {
  font-size: 16px;
  font-weight: 600;
  color: #2e7a38;
}

/* Right: bins summary */
.sg-results-bins {
  display: grid;
  align-content: start;
  gap: 10px;
}

.sg-bins-wrap--results .sg-bin {
  cursor: default;
  box-shadow: none;
}
.sg-bins-wrap--results .sg-bin:hover {
  transform: none;
  box-shadow: none;
}

/* Buttons row in results */
.sg-results-actions {
  margin-top: 12px;
  display: flex;
  gap: 10px;
}

/* Small screen tweaks */
@media (max-width: 720px) {
  .sg-columns,
  .sg-results-grid {
    grid-template-columns: 1fr;
  }
  .sg-container {
    border-radius: 18px;
  }
}
