/* Wrapper and layout */
.gic-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  width: calc(var(--gic-board-width, 900px) + 400px);
  margin: 0 auto;
  box-sizing: border-box;
  user-select: none;
}

.gic-hud {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 8px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
}

.gic-actions .gic-btn {
  padding: 6px 12px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
}

.gic-stage {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 200px var(--gic-board-width, 900px) 200px;
  gap: 0;
  height: 100%;
  min-height: 500px;
}

.gic-tray {
  background: #f0f0f0;
  border: 1px solid #ddd;
  position: relative;
  overflow: hidden;
}

.gic-board {
  position: relative;
  background: #fff;
  border: 1px solid #ddd;
  width: var(--gic-board-width, 900px);
  height: 100%;
  overflow: hidden;
}

/* Pieces on top */
.gic-piece {
  position: absolute;
  z-index: 20;
  width: var(--piece-w);
  height: var(--piece-h);
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
  border: 1px solid rgba(0,0,0,.1);
  background-size: var(--img-w) var(--img-h);
  background-repeat: no-repeat;
  cursor: grab;
  touch-action: none;
  border-radius: 4px;
}

.gic-cell {
  position: absolute;
  border: 1px dashed rgba(0,0,0,.08);
  box-sizing: border-box;
  z-index: 5;
}

.gic-tray::after {
  content: 'TRAY';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 11px;
  color: #999;
}

.gic-complete-banner {
  position: absolute;
  left: 50%;
  top: 60px;
  transform: translateX(-50%);
  background: #12b886;
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

/* Modal reference image */
.gic-modal[hidden] { display: none; }
.gic-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}
.gic-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
}
.gic-modal-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.gic-ref-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  height: auto;
  border-radius: 8px;
}
.gic-modal-close {
  position: absolute;
  top: 6px;
  right: 10px;
  font-size: 24px;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
}
