/* Pixel and layout tweaks on top of XP.css. */
* { image-rendering: pixelated; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(#3f7fd0 0%, #6aa5e0 45%, #7fb04a 46%, #587f30 100%);
  padding: 14px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

#desk { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; width: 100%; }
#main { flex: 1 1 720px; max-width: 1000px; }
#chatwin { flex: 0 0 260px; }
#chatlog { height: 300px; overflow-y: auto; padding: 4px; background: #fff; font-size: 11px; }
#chatlog b { color: #0a246a; }
#chatlog .mine b { color: #7a0a0a; }

.warn { color: #a00; min-height: 14px; }
.dim { color: #555; }
.big { font-family: "Perfect DOS VGA 437 Win", monospace; font-size: 22px; margin: 6px 0; }

/* ---- cards ---- */
.card {
  position: relative;
  width: 42px; height: 60px;
  border: 2px solid #000;
  background: #fffdf5;
  box-shadow: inset -2px -2px 0 #d8d2bd, inset 2px 2px 0 #fff;
  display: flex; align-items: center; justify-content: center;
  font-family: "Perfect DOS VGA 437 Win", monospace;
  line-height: 1; user-select: none; flex: none;
}
/* The rank sits in the corner so an overlapping stack stays readable. */
.card b { position: absolute; top: 0; left: 3px; font-size: 15px; font-weight: normal; }
.card i { font-size: 22px; font-style: normal; }
.card.red { color: #c00000; }
.card.back {
  background: #2c4b9b;
  background-image:
    linear-gradient(45deg, #4a6fd0 25%, transparent 25%, transparent 75%, #4a6fd0 75%),
    linear-gradient(45deg, #4a6fd0 25%, transparent 25%, transparent 75%, #4a6fd0 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}
.card.empty { background: transparent; border-style: dashed; border-color: #7a7a6a; box-shadow: none; }

/* clickable states: a playable card sits slightly proud of the table */
.card.pick { cursor: pointer; transform: translateY(-4px); }
.card.pick:hover { outline: 2px solid #ffd000; outline-offset: 1px; }
.card.sel { outline: 3px solid #ff8000; outline-offset: 1px; }
.target { outline: 3px dashed #0b8a0b; outline-offset: 2px; cursor: pointer; }
.target:hover { outline-style: solid; }

/* ---- board furniture ---- */
.board { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.slot { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.slot label { font-size: 10px; color: #333; white-space: nowrap; }
.stack { position: relative; width: 42px; }
.stack .card { position: relative; margin-top: -42px; }
.stack .card.top { box-shadow: inset -2px -2px 0 #d8d2bd, inset 2px 2px 0 #fff, 0 2px 0 rgba(0,0,0,.35); }
.stack .card:first-child { margin-top: 0; }
.stack-wrap { display: flex; flex-direction: column; align-items: center; }

.zone { border: 1px solid #888; padding: 6px; background: #ece9d8; }
.zone > h4 { margin: 0 0 4px; font-size: 11px; }
.centre { background: #0b6b2b; border: 2px inset #0a4a20; padding: 8px; }
.centre .slot label { color: #cfe8cf; }
.hand { display: flex; gap: 6px; }

.pips { font-family: "Perfect DOS VGA 437 Win", monospace; font-size: 13px; }
table.score { border-collapse: collapse; font-size: 12px; }
table.score th, table.score td { border: 1px solid #999; padding: 2px 8px; text-align: center; }
table.score td.g { text-align: left; font-weight: bold; }
table.score td.k { text-align: left; color: #444; }
#log { font-size: 10px; color: #333; max-height: 64px; overflow-y: auto; }

/* ---- Rack-O rack ---- */
.rack { display: flex; flex-direction: column; gap: 2px; width: 128px; }
.rackrow {
  display: flex; align-items: center; gap: 6px;
  border: 2px solid #000; background: #d9d2b6; padding: 2px 4px;
  font-family: "Perfect DOS VGA 437 Win", monospace;
}
.rackrow .n { font-size: 10px; color: #555; width: 16px; text-align: right; }
.rackrow .v { font-size: 18px; flex: 1; text-align: center; background: #fffdf5; border: 1px solid #000; }
.rackrow.good .v { background: #c8f0c8; }
.rackrow.hidden .v { background: #2c4b9b; color: #2c4b9b; }
/* A placeable slot gets a green edge. The full outline waits for hover. */
.rackrow.target { cursor: pointer; border-left: 5px solid #0b8a0b; outline: none; }
.rackrow.target:hover { outline: 3px solid #0b8a0b; outline-offset: 1px; }
.rackrow.target:hover .v { background: #ffe9a8; }
