/* ---------- CSS Variables ---------- */
:root {
   --bg-color: #3c7aaf;
   --desktop-bg: url('https://images.unsplash.com/photo-1542281286-9e0a8c8e2c3b?auto=format&fit=crop&w=1200&q=80') center/cover;
   --taskbar-bg: #1e1e1e;
   --taskbar-text: #ddd;
   --window-bg: #fff;
   --window-border: #444;
   --titlebar-bg: #2b5797;
   --titlebar-text: #fff;
   --start-menu-bg: #fff;
   --start-menu-text: #000;
}
.dark-mode {
   --bg-color: #1a1a1a;
   --desktop-bg: url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?auto=format&fit=crop&w=1200&q=80') center/cover;
   --taskbar-bg: #2a2a2a;
   --taskbar-text: #ccc;
   --window-bg: #333;
   --window-border: #666;
   --titlebar-bg: #444;
   --titlebar-text: #fff;
   --start-menu-bg: #444;
   --start-menu-text: #fff;
}

/* ---------- Layout ---------- */
html,body{
   margin:0; padding:0; height:100%; overflow:hidden;
   font-family:Arial,Helvetica,sans-serif; font-size:14px;
   background:var(--bg-color);
}
#desktop{
   position:absolute; top:0; left:0; right:0; bottom:0;
   background:var(--desktop-bg);
   overflow:hidden;
}
#taskbar{
   position:absolute; left:0; right:0; bottom:0;
   height:40px; background:var(--taskbar-bg); display:flex; align-items:center;
   padding:0 10px; box-sizing:border-box;
}
#start-btn{
   width:60px; height:30px; background:#2b5797; color:#fff;
   border:none; cursor:pointer; margin-right:5px;
}
#clock{
   margin-left:auto; color:var(--taskbar-text); font-family:monospace;
}
#taskbar-buttons{
   display:flex; gap:3px; overflow-x:auto; flex:1;
}
#taskbar-buttons button{
   background:#2b5797; color:#fff; border:none;
   padding:0 8px; height:26px; cursor:pointer;
}
#start-menu{
   position:absolute; bottom:40px; left:10px; width:200px;
   background:var(--start-menu-bg); border:1px solid var(--window-border); box-shadow:2px 2px 10px rgba(0,0,0,.3);
   display:none; z-index:2000;
}
#start-menu .app{
   padding:8px 12px; cursor:pointer; color:var(--start-menu-text);
}
#start-menu .app:hover{ background:#e0e0e0; }

/* ---------- Icons ---------- */
.icon{
   width:70px; text-align:center; color:#fff; cursor:pointer;
   user-select:none; margin:10px; float:left;
}
.icon .label{ font-size:12px; margin-top:4px; }

/* ---------- Windows ---------- */
.window{
   position:absolute; width:400px; height:300px;
   background:var(--window-bg); border:1px solid var(--window-border); box-shadow:2px 2px 10px rgba(0,0,0,.3);
   z-index:1000;
   box-sizing: border-box;
   overflow: hidden;
   resize: none;
   transition: transform 0.3s ease, opacity 0.3s ease;
}
.window.minimizing {
   transform: scale(0.8);
   opacity: 0;
}
.resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
  background: rgba(0,0,0,0.05);
  z-index: 1001;
  border-bottom-right-radius: 4px;
}
.window .titlebar{
   background:var(--titlebar-bg); color:var(--titlebar-text); height:30px; line-height:30px;
   padding:0 8px; cursor:move; display:flex; justify-content:space-between; align-items:center;
}
.window .titlebar .buttons{ display:flex; gap:4px; }
.window .titlebar button{
   width:20px; height:20px; background:#444; color:#fff; border:none; cursor:pointer;
}
.window .titlebar button:hover{ background:#666; }
.window .content-wrapper {
   position: absolute;
   top: 30px;
   left: 0;
   right: 0;
   bottom: 0;
   background: var(--window-bg);
   overflow: hidden;
}
.window .content {
  padding: 10px;
  height: 100%;
  overflow: auto;
  box-sizing: border-box;
}
.window .resize-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  right: 0;
  bottom: 0;
  cursor: nwse-resize;
  background: rgba(0,0,0,0.05);
  z-index: 1001;
  border-bottom-right-radius: 4px;
}

/* ---------- Hearts Card Rects ---------- */
.hearts-hand-rects {
  height: 120px;
  min-width: 400px;
  position: relative;
  display: flex;
  align-items: flex-end;
}
.hearts-card-rect {
  position: absolute;
  width: 64px;
  height: 96px;
  background: #fff;
  border: 2px solid #444;
  border-radius: 8px;
  box-shadow: 1px 2px 6px #0002;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}
.hearts-card-rect .hearts-card-value {
  position: absolute;
  top: 4px;
  left: 6px;
  font-size: 18px;
  font-weight: bold;
  color: #222;
}
.hearts-card-rect.selected {
  transform: translateY(-24px);
  box-shadow: 2px 6px 16px #0004;
  border-color: #d4a017;
  background: #ffe066;
}
.hearts-card-rect.playable {
  border-color: #2a9d8f;
  box-shadow: 0 0 8px #2a9d8f44;
}
.hearts-card-rect.ai {
  background: repeating-linear-gradient(135deg, #bbb 0 8px, #eee 8px 16px);
  border: 2px solid #888;
}
.hearts-card-rect.ai .hearts-card-value {
  display: none;
}

/* ---------- Context Menu ---------- */
#desktop-context-menu .context-item {
   padding: 8px 12px;
   cursor: pointer;
   color: var(--start-menu-text);
}
#desktop-context-menu .context-item:hover {
   background: #e0e0e0;
}

/* ---------- Utility ---------- */
.hidden{ display:none !important; }
