/* Explorer chrome, folder views, context menus and Minesweeper. */
.window[data-explorer-window] {
  width: min(61rem, calc(100vw - 2rem));
  height: min(38rem, calc(100dvh - 5.25rem));
}

.window[data-explorer-window] .window-content {
  padding: 0;
  overflow: hidden;
  background: #ece9d8;
}

.xp-explorer {
  height: 100%;
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  background: #ece9d8;
  color: #101828;
}

.explorer-menubar,
.explorer-toolbar,
.explorer-addressbar,
.explorer-statusbar {
  display: flex;
  align-items: center;
}

.explorer-menubar {
  position: relative;
  gap: 0.15rem;
  min-height: 2rem;
  padding: 0.16rem 0.35rem;
  border-bottom: 1px solid #d5d0bc;
  background: #f3f0df;
}

.explorer-menubar button,
.explorer-toolbar button {
  border: 1px solid transparent;
  background: transparent;
  color: #101828;
  cursor: pointer;
}

.explorer-menubar button {
  padding: 0.16rem 0.55rem;
}

.explorer-menubar button:hover:not(:disabled),
.explorer-menubar button.is-open,
.explorer-toolbar button:hover:not(:disabled) {
  border-color: #aca899;
  background: linear-gradient(180deg, #fffef7, #e9e5d2);
}

.explorer-menu-panel {
  position: absolute;
  z-index: 30025;
  top: calc(100% - 0.08rem);
  min-width: 13rem;
  padding: 0.16rem 0;
  border: 1px solid #8998ae;
  background: #f7f7f7;
  box-shadow: 2px 3px 7px rgba(0, 0, 0, 0.24);
}

.explorer-menu-panel button {
  display: block;
  width: 100%;
  min-height: 1.7rem;
  padding: 0.2rem 1.5rem 0.2rem 1.25rem;
  border: 0;
  background: transparent;
  text-align: left;
  white-space: nowrap;
}

.explorer-menu-panel button:hover:not(:disabled),
.explorer-menu-panel button:focus-visible:not(:disabled) {
  background: #2d74df;
  color: #ffffff;
}

.explorer-menu-panel button:disabled {
  color: #9a9a9a;
}

.explorer-menu-panel__separator {
  display: block;
  height: 1px;
  margin: 0.18rem 0.3rem;
  background: #d2d5da;
}

.explorer-menubar button:disabled,
.explorer-toolbar button:disabled {
  color: #8d8a7c;
  cursor: default;
}

.explorer-toolbar {
  gap: 0.25rem;
  min-height: 3.45rem;
  padding: 0.35rem 0.55rem;
  border-bottom: 1px solid #d7d2bf;
  background:
    linear-gradient(180deg, #f7f4e6, #e4e0cc);
}

.explorer-toolbar button {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.25rem 0.45rem;
}

.explorer-toolbar img {
  width: 1.9rem;
  height: 1.9rem;
  object-fit: contain;
}

.explorer-toolbar__sep {
  width: 1px;
  align-self: stretch;
  margin: 0 0.35rem;
  background: #cbc5ae;
  box-shadow: 1px 0 0 rgba(255, 255, 255, 0.72);
}

.explorer-addressbar {
  gap: 0.45rem;
  min-height: 2.25rem;
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #d7d2bf;
  background: #fbfbf8;
}

.explorer-addressbar > label {
  color: #34415f;
}

.explorer-addressbar__field {
  flex: 1;
  min-width: 0;
  height: 1.7rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.45rem;
  border: 1px solid #d8d6ca;
  background: #ffffff;
}

.explorer-addressbar__field img {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
}

.explorer-addressbar__field input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #101828;
  font: inherit;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.explorer-addressbar button {
  min-width: 2.1rem;
  height: 1.85rem;
  border: 1px solid #6bb960;
  border-radius: 0.24rem;
  background:
    linear-gradient(180deg, #83df73, #35a936);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.explorer-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(12.5rem, 16rem) 1fr;
  background: #f8fbff;
}

.explorer-sidebar {
  min-height: 0;
  overflow: auto;
  padding: 0.8rem;
  background:
    linear-gradient(180deg, #778dff, #5d73d4);
}

.explorer-sidebar.is-collapsed {
  display: none;
}

.explorer-sidebar.is-collapsed + .explorer-main {
  grid-column: 1 / -1;
}

.explorer-task-group {
  margin-bottom: 0.75rem;
  background: #dfe5ff;
}

.explorer-task-group__title {
  width: 100%;
  border: none;
  padding: 0.45rem 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #2e6bf0, #2454d5);
  color: #ffffff;
  font-weight: 700;
  cursor: default;
}

.explorer-task-group__title span:last-child {
  display: inline-grid;
  place-items: center;
  width: 1.2rem;
  height: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 999px;
  font-size: 0.8rem;
}

.explorer-task-group__body {
  display: grid;
  gap: 0.35rem;
  padding: 0.62rem;
}

.explorer-task-group.is-collapsed .explorer-task-group__body {
  display: none;
}

.explorer-task-group.is-collapsed .explorer-task-group__title span:last-child {
  transform: rotate(180deg);
}

.explorer-task {
  border: none;
  background: transparent;
  display: grid;
  grid-template-columns: 1.55rem 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.22rem;
  color: #2259db;
  text-align: left;
  cursor: pointer;
}

.explorer-task:hover:not(:disabled) span {
  text-decoration: underline;
}

.explorer-task img {
  width: 1.5rem;
  height: 1.5rem;
  object-fit: contain;
}

.explorer-task:disabled,
.explorer-task.is-disabled {
  color: #8b92a9;
  cursor: default;
  opacity: 0.72;
}

.explorer-task:disabled span,
.explorer-task.is-disabled span {
  text-decoration: line-through;
}

.explorer-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 1fr auto;
  background: #ffffff;
}

.explorer-items {
  min-height: 0;
  overflow: auto;
  padding: 0.95rem 1rem;
}

.explorer-items--tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  align-content: start;
  gap: 0.8rem 1.15rem;
}

.explorer-items--thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  align-content: start;
  gap: 1.35rem 1.8rem;
}

.explorer-item {
  border: 1px solid transparent;
  background: transparent;
  display: grid;
  align-items: center;
  text-align: left;
  cursor: pointer;
  color: #111827;
}

.explorer-item--tiles {
  grid-template-columns: 3.5rem 1fr;
  gap: 0.55rem;
  min-height: 4rem;
  padding: 0.28rem;
}

.explorer-item--thumbnails {
  grid-template-columns: 4.85rem 1fr;
  gap: 0.6rem;
  min-height: 4.6rem;
  padding: 0.26rem;
}

.explorer-item:hover,
.explorer-item:focus-visible {
  border-color: #b7c9e9;
  background: #eef5ff;
}

.explorer-item.is-selected {
  border-color: #316ac5;
  background: #dbeaff;
}

.explorer-item.is-disabled {
  opacity: 0.58;
}

.explorer-item__icon {
  display: grid;
  place-items: center;
}

.explorer-item__icon img {
  width: 3.2rem;
  height: 3.2rem;
  object-fit: contain;
}

.explorer-item__icon.is-thumbnail img {
  width: 4.5rem;
  height: 3.15rem;
  border: 1px solid #ffffff;
  object-fit: cover;
  box-shadow:
    0 0 0 1px #aebcd4,
    0 2px 4px rgba(28, 54, 98, 0.18);
}

.explorer-item__text {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.explorer-item__text strong {
  font-weight: 400;
  overflow-wrap: anywhere;
}

.explorer-item__text small {
  color: #5f6d86;
  line-height: 1.2;
}

.explorer-details {
  min-height: 3.15rem;
  display: grid;
  gap: 0.2rem;
  padding: 0.55rem 0.8rem;
  border-top: 1px solid #d5ddef;
  background: linear-gradient(180deg, #f7fbff, #edf4ff);
  color: #283b64;
  font-size: 0.88rem;
}

.explorer-details .project-preview__header,
.explorer-details .project-preview__meta,
.explorer-details .project-preview__body {
  display: none;
}

.explorer-details .project-preview__actions {
  margin-top: 0.35rem;
}

.explorer-statusbar {
  justify-content: space-between;
  gap: 1rem;
  min-height: 1.65rem;
  padding: 0.22rem 0.55rem;
  border-top: 1px solid #d7d2bf;
  background: #f7f4e6;
  color: #39496a;
  font-size: 0.86rem;
}

.explorer-empty {
  margin: 0;
  color: #53627c;
}

.context-menu-separator {
  display: block;
  height: 1px;
  margin: 0.22rem 0;
  background: #d6d9df;
}

.explorer-context-menu button {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
}

.minesweeper-window {
  width: 22rem;
  height: auto;
  min-height: auto;
}

.minesweeper-content {
  height: auto;
  padding: 0;
  overflow: hidden;
  background: #c0c0c0;
}

.minesweeper-menu {
  position: relative;
  display: flex;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid #aaa;
  background: #ece9d8;
}

.minesweeper-menu-item {
  position: relative;
}

.minesweeper-menu-item > button,
.minesweeper-dropdown button {
  border: none;
  background: transparent;
  cursor: pointer;
}

.minesweeper-menu-item > button {
  min-height: 1.95rem;
  padding: 0.28rem 0.75rem;
}

.minesweeper-menu-item:hover > button,
.minesweeper-menu-item.is-open > button {
  background: #2d74df;
  color: white;
}

.minesweeper-dropdown {
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 10025;
  display: none;
  min-width: 12.5rem;
  padding: 0.18rem 0;
  border: 1px solid #8d9db5;
  background: #f8f8f8;
  box-shadow: 2px 2px 7px rgba(0, 0, 0, 0.24);
}

.minesweeper-menu-item.is-open .minesweeper-dropdown {
  display: block;
}

.minesweeper-dropdown button {
  width: 100%;
  min-height: 1.8rem;
  display: block;
  padding: 0.24rem 0.75rem 0.24rem 1.25rem;
  text-align: left;
}

.minesweeper-dropdown button:hover,
.minesweeper-dropdown button:focus-visible {
  background: #2d74df;
  color: white;
}

.minesweeper-dropdown button:nth-of-type(5) {
  border-top: 1px solid #d8d8d8;
  margin-top: 0.18rem;
}

.minesweeper-shell {
  padding: 1rem;
  overflow: auto;
  background: #c0c0c0;
}

.minesweeper-display {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.85rem;
  padding: 0.35rem;
  border-top: 3px solid #808080;
  border-left: 3px solid #808080;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
}

.mine-counter {
  display: block;
  min-width: 4.1rem;
  padding: 0.14rem 0.3rem;
  background: #000;
  color: #ff1d10;
  font-family: "VT323", monospace;
  font-size: 2.15rem;
  line-height: 1;
  text-align: right;
}

.mine-face {
  width: 2.45rem;
  height: 2.45rem;
  border-top: 3px solid #ffffff;
  border-left: 3px solid #ffffff;
  border-right: 3px solid #808080;
  border-bottom: 3px solid #808080;
  background: #d6d6d6;
  font-size: 1.35rem;
  cursor: pointer;
}

.mine-board {
  display: grid;
  grid-template-columns: repeat(var(--mine-cols), 1fr);
  width: 100%;
  box-sizing: border-box;
  border-top: 3px solid #808080;
  border-left: 3px solid #808080;
  border-right: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
}

.mine-cell {
  aspect-ratio: 1;
  min-width: 0;
  border-top: 3px solid #ffffff;
  border-left: 3px solid #ffffff;
  border-right: 3px solid #808080;
  border-bottom: 3px solid #808080;
  background: #c0c0c0;
  color: #0019b8;
  font-family: "Trebuchet MS", sans-serif;
  font-weight: 900;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.mine-cell.is-open {
  border: 1px solid #8f8f8f;
  background: #c9c9c9;
  cursor: default;
}

.mine-cell.is-mine {
  background: #ef4a2f;
  color: #1f1f1f;
}

.mine-cell.is-flagged {
  color: #ff2240;
}

.mine-number-1 { color: #0019b8; }
.mine-number-2 { color: #147314; }
.mine-number-3 { color: #c31818; }
.mine-number-4 { color: #071172; }
.mine-number-5 { color: #7a1111; }
.mine-number-6 { color: #0d7378; }
.mine-number-7 { color: #111111; }
.mine-number-8 { color: #777777; }

.mine-help {
  margin: 0.8rem 0 0;
  font-size: 0.86rem;
}

