:root{
  --xp-font: Tahoma, "Segoe UI", Verdana, Arial, sans-serif;

  /* Window (Luna-ish) */
  --win-border: #0B2F85;
  --win-title1: #3A6EA5;
  --win-title2: #2B73F1;
  --win-titleText: #FFFFFF;

  --face: #ECE9D8;         /* classic window background */
  --panel: #F6F4EA;
  --line: #A6A6A6;

  --btn-hi: #FFFFFF;
  --btn-mid: #D6D3C9;
  --btn-lo: #808080;
  --btn-dark: #404040;

  --field: #FFFFFF;
  --field-line: #7F9DB9;

  --cell: 24px;
  --gap: 2px;

  --mine: #D9534F;
}

*{ box-sizing:border-box; }
html, body{ height:100%; }
body{
  margin:0;
  font-family: var(--xp-font);
  padding-bottom: 60px; /* space for taskbar */
  /* Wallpaper provided by user */
  background: url('./background.png') center/cover fixed no-repeat;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
}

/* Main window */
.window{
  width: min(1080px, 100%);
  border: 1px solid var(--win-border);
  border-radius: 8px;
  background: var(--face);
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  overflow:hidden;
}

.titlebar{
  height: 32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 0 8px 0 10px;
  background: linear-gradient(180deg, var(--win-title2), var(--win-title1));
  color: var(--win-titleText);
  font-weight: 700;
  user-select:none;
}
.titlebar .title{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 13px;
}
.win-controls{
  display:flex;
  gap: 6px;
}
.winbtn{
  width: 22px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}

.menubar{
  background: linear-gradient(180deg, #FFFFFF, #F0EEE6);
  border-bottom: 1px solid rgba(0,0,0,.15);
  padding: 6px 10px;
  font-size: 12px;
  color:#000;
  display:flex;
  gap: 14px;
}
.menubar span{ cursor:default; }
.menubar span u{ text-decoration: underline; }

.content{
  display:grid;
  grid-template-columns: 360px 1fr;
  gap: 10px;
  padding: 10px;
}
@media (max-width: 920px){
  .content{ grid-template-columns: 1fr; }
}

.pane{
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 10px;
  min-width: 0;
}

.group{
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.45);
  padding: 10px;
  margin-bottom: 10px;
}
.group legend{
  padding: 0 6px;
  font-size: 12px;
  color:#000;
}
fieldset.group{ padding: 10px; }
fieldset.group > legend{ font-weight: 700; }

.row{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.stat{
  flex:1;
  min-width: 160px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #FFFFFF;
  padding: 8px 10px;
  color:#000;
}
.stat b{ display:block; font-size: 12px; }
.stat span{ display:block; font-size: 12px; color:#333; margin-top: 2px; }

.form{
  display:grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 10px;
}
.field{
  min-width: 0;
  display:flex;
  flex-direction:column;
  gap: 6px;
}
.field label{
  font-size: 12px;
  color:#000;
}
.field input, .field select{
  width: 100%;
  min-width: 0;
  font: inherit;
  font-size: 12px;
  padding: 7px 8px;
  border-radius: 2px;
  border: 1px solid var(--field-line);
  background: var(--field);
  outline:none;
}
.field input:focus, .field select:focus{
  box-shadow: 0 0 0 2px rgba(43,115,241,.20);
  border-color: #2B73F1;
}

.btnbar{
  display:flex;
  flex-wrap: wrap;
  gap: 8px;
}

button{
  font: inherit;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 3px;
  cursor:pointer;
  color:#000;

  border-top: 1px solid var(--btn-hi);
  border-left: 1px solid var(--btn-hi);
  border-right: 1px solid var(--btn-lo);
  border-bottom: 1px solid var(--btn-lo);

  background: linear-gradient(180deg, #FFFFFF, var(--btn-mid));
}
button:active{
  border-top: 1px solid var(--btn-lo);
  border-left: 1px solid var(--btn-lo);
  border-right: 1px solid var(--btn-hi);
  border-bottom: 1px solid var(--btn-hi);
  background: linear-gradient(180deg, var(--btn-mid), #FFFFFF);
}
button.primary{
  background: linear-gradient(180deg, #FFFFFF, #D9ECFF);
}
button.danger{
  background: linear-gradient(180deg, #FFF0F0, #FFD4D4);
}
button.toggle.on{
  background: linear-gradient(180deg, #E9FFF4, #C9F5DF);
}

.help{
  font-size: 12px;
  color:#000;
  padding-top: 4px;
}
.kbd{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  padding: 1px 6px;
  border: 1px solid #999;
  border-radius: 3px;
  background: #fff;
  font-size: 11px;
}

/* Right pane */
.boardHeader{
  display:flex;
  justify-content: space-between;
  align-items:center;
  gap: 10px;
  margin-bottom: 8px;
  color:#000;
  font-size: 12px;
}
.status{
  display:flex;
  align-items:center;
  gap: 8px;
}
.dot{
  width: 10px; height:10px;
  border-radius: 2px;
  background: #BDBDBD;
  border: 1px solid #7A7A7A;
}
.dot.live{ background: #2B73F1; }
.dot.win{ background: #2E8B57; }
.dot.lose{ background: #D9534F; }

.board{
  display:grid;
  gap: var(--gap);
  justify-content:center;
  align-content:start;
  padding: 10px;
  background: #C0C0C0;
  border-radius: 6px;

  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;

  overflow:auto;
  max-height: 70vh;
}

.cell{
  width: var(--cell);
  height: var(--cell);
  display:flex;
  align-items:center;
  justify-content:center;
  user-select:none;
  font-weight: 700;
  font-size: 13px;
  color:#000;

  border-top: 1px solid #FFFFFF;
  border-left: 1px solid #FFFFFF;
  border-right: 1px solid #808080;
  border-bottom: 1px solid #808080;
  background: #C0C0C0;
}

.cell.revealed{
  border: 1px solid #808080;
  background: #E6E6E6;
}
.cell.flagged{
  background: #CFE3FF;
}
.cell.mine{
  background: #F7C6C4;
}

/* Classic minesweeper number colors */
.n1{ color:#0000FF; }
.n2{ color:#008000; }
.n3{ color:#FF0000; }
.n4{ color:#000080; }
.n5{ color:#800000; }
.n6{ color:#008080; }
.n7{ color:#000000; }
.n8{ color:#808080; }

.toast{
  margin-top: 8px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  border-radius: 4px;
  font-size: 12px;
  color:#000;

  /* Reserve space so messages don't shift the UI */
  display:block;
  min-height: 34px;
  visibility: hidden;
  opacity: 0;
}
.toast.show{
  visibility: visible;
  opacity: 1;
}


body::before{
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  /* Subtle vignette for readability */
  background: radial-gradient(1200px 700px at 20% 20%, rgba(255,255,255,.08), transparent 55%),
              radial-gradient(1200px 800px at 70% 60%, rgba(0,0,0,.18), transparent 60%),
              rgba(0,0,0,.10);
}


/* Window controls (XP-ish) */
.win-controls{ display:flex; gap:6px; }
.winbtn{
  width: 24px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.16);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  color:#fff;
  font-weight: 800;
  line-height: 16px;
  padding: 0;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}
.winbtn:hover{ background: rgba(255,255,255,.24); }
.winbtn:active{ transform: translateY(1px); }
.winbtn.close{
  background: rgba(210, 70, 70, .45);
  border-color: rgba(255,255,255,.38);
}
.winbtn.close:hover{ background: rgba(230, 90, 90, .55); }

/* Generic XP taskbar */
.xp-taskbar{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: 44px;
  z-index: 50;
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 6px 10px;

  background: linear-gradient(180deg, #245EDB, #1F4FAE);
  border-top: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 -10px 28px rgba(0,0,0,.28);
}

.xp-start{
  height: 32px;
  min-width: 88px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,.24);
  background: linear-gradient(180deg, #2E8B57, #1D6F43);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 3px 10px rgba(0,0,0,.18);
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 0 12px;
  font-weight: 700;
  color:#fff;
  user-select:none;
}
.xp-start .orb{
  width: 18px; height:18px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.85), rgba(255,255,255,.10) 55%),
              radial-gradient(circle at 70% 70%, rgba(0,0,0,.20), transparent 55%),
              linear-gradient(180deg, #7CFF9C, #1C7C3F);
  border: 1px solid rgba(0,0,0,.25);
}
.xp-taskspacer{ flex: 1; }

.xp-clock{
  height: 32px;
  border-radius: 6px;
  padding: 0 10px;
  display:flex;
  align-items:center;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(0,0,0,.22);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
  font-size: 12px;
  color:#fff;
}



/* --- Planet OS Taskbar (shared look with hub) --- */
:root{
  --taskbar-h: 40px;
}
body{
  padding-bottom: var(--taskbar-h);
}

.taskbar{
  position:fixed; left:0; right:0; bottom:0;
  height:var(--taskbar-h);
  background: linear-gradient(#3d63d8, #244fc7);
  box-shadow: 0 -1px 0 rgba(255,255,255,.25), 0 -10px 30px rgba(0,0,0,.25);
  display:flex; align-items:center;
  padding:0 8px;
  z-index: 1000;
}

.start-button{
  height:32px;
  padding:0 14px 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.28);
  background: linear-gradient(#53d46a, #2f9f41);
  color:#fff;
  display:flex; align-items:center; gap:8px;
  font-weight:700;
  text-shadow: 0 1px 0 rgba(0,0,0,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), 0 2px 6px rgba(0,0,0,.25);
  cursor: default;
}
.start-button:active{ transform: translateY(1px); }
.start-orb{
  width:16px; height:16px; border-radius:999px;
  background: url("assets/planet.png") center/cover no-repeat;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  border: 1px solid rgba(0,0,0,.18);
}

.taskbar-apps{
  flex:1;
  display:flex;
  gap:6px;
  padding: 0 8px;
  overflow:auto;
  scrollbar-width: thin;
}
.taskbtn{
  height:30px;
  min-width: 140px;
  max-width: 240px;
  padding: 0 10px;
  border-radius: 8px;
  border:1px solid rgba(0,0,0,.26);
  background: linear-gradient(#fefefe, #dcdcdc);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 2px 6px rgba(0,0,0,.18);
  display:flex; align-items:center; gap:8px;
  color:#123;
  white-space:nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
  cursor: default;
}
.taskbtn.active{
  background: linear-gradient(#fff6d6, #ffd27b);
}

.tray{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 0 8px 0 12px;
  height: 30px;
  border-radius: 10px;
  border:1px solid rgba(0,0,0,.25);
  background: linear-gradient(#3d63d8, #2f59d3);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.2);
}
.tray-time{
  font-family: Tahoma, Arial, sans-serif;
  font-size: 12px;
  color:#fff;
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}
