* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #1f3a2f;
  margin: 0;
  padding: 12px;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.wrap { max-width: 720px; margin: 0 auto; }
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  margin-bottom: 10px;
  gap: 10px;
  flex-wrap: wrap;
}
#status { flex: 1; min-width: 200px; opacity: 0.85; }
#counter { font-weight: 700; }
#newbtn {
  background: #4f46e5; color: white; border: 0; padding: 6px 12px;
  border-radius: 6px; cursor: pointer; font-size: 13px;
}
#newbtn:hover { background: #4338ca; }
.board {
  position: relative;
  width: 100%;
  margin: 0 auto;
  user-select: none;
  background: #14532d;
  border-radius: 8px;
  padding: 8px;
  overflow-x: auto;
}
.board-inner {
  position: relative;
}
.tile {
  position: absolute;
  background: linear-gradient(180deg, #fef9c3 0%, #fde68a 100%);
  color: #1f2937;
  border: 1px solid #92400e;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 1px 1px 0 #92400e, 2px 2px 0 #92400e;
  transition: transform 0.05s;
}
.tile.blocked { cursor: not-allowed; opacity: 0.7; }
.tile.free { cursor: pointer; }
.tile.selected { outline: 3px solid #2563eb; outline-offset: -1px; z-index: 50; transform: translateY(-2px); }
.tile.removed { display: none; }
.result {
  margin-top: 14px;
  padding: 12px;
  border-radius: 6px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
}
.result.win { background: #d1fae5; color: #065f46; }
.result.lose { background: #fee2e2; color: #991b1b; }
.result.hidden { display: none; }
