@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;500;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Raleway', sans-serif; }

body {
  background: #fff;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

#top-bar {
  height: 52px;
  background: #fff;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  z-index: 10;
  flex-shrink: 0;
}

#level-label {
  font-size: 13px;
  color: #999;
  margin-right: 16px;
  font-weight: 500;
}

#sequence {
  display: flex;
  flex-direction: row;
  gap: 6px;
  align-items: center;
}

.seq-tile {
  width: 36px;
  height: 26px;
  border-radius: 4px;
  flex-shrink: 0;
  transition: opacity .1s;
}

.seq-tile.active {
  outline: 2px solid #555;
  outline-offset: 2px;
}

#attempt-row {
  display: flex;
  flex-direction: row;
  gap: 5px;
  padding: 4px 16px;
  min-height: 24px;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,.4);
  flex-shrink: 0;
}

.attempt-tile {
  width: 22px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

#canvas-wrap { flex: 1; position: relative; min-height: 0; }
canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }

#overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.2);
  z-index: 20;
}
#overlay.show { display: flex; }

#overlay-box {
  background: #fff;
  padding: 28px 44px;
  border-radius: 0;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
}

#overlay-title { font-size: 22px; font-weight: 700; margin-bottom: 14px; }
#overlay-sub   { display: none; }

#overlay-btn {
  padding: 9px 26px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
}
#overlay-btn:hover { background: #333; }

#bottom-bar {
  height: 80px;
  background: #f0f0f0;
  display: flex;
  flex-direction: row;
  align-items: center;
  padding: 0 16px;
  gap: 10px;
  box-shadow: 0 -1px 3px rgba(0,0,0,.08);
  z-index: 10;
  flex-shrink: 0;
}

#inventory { display: flex; flex-direction: row; gap: 8px; align-items: center; }

.inv-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.inv-swatch {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  border: 3px solid transparent;
  transition: border-color .15s, transform .1s;
}
.inv-swatch:hover { transform: scale(1.05); }
.inv-swatch.selected { border-color: #444; }
.inv-swatch.exhausted { opacity: .35; cursor: default; }

.inv-count { font-size: 11px; color: #666; font-weight: 500; }

.mode-btns { display: flex; flex-direction: row; gap: 6px; margin-left: 10px; }

.mode-btn {
  font-size: 12px;
  padding: 5px 10px;
  background: none;
  border: 1px solid #bbb;
  border-radius: 4px;
  cursor: pointer;
  color: #666;
  font-weight: 500;
}
.mode-btn.active { background: #444; color: #fff; border-color: #444; }

.spacer { flex: 1; }

.action-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: filter .1s;
  flex-shrink: 0;
}
.action-btn:hover { filter: brightness(.93); }

#btn-drop  { background: #E0DCD4; color: #333; }
#btn-stop  { background: #AAA; color: #fff; }
#btn-reset { background: #888; color: #fff; }
