*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: #1a5c2e;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #333333;
  overflow-x: hidden;
  -webkit-user-select: none;
  user-select: none;
}

a {
  color: #333;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.solitr-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1b4a28;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-inner {
  width: 900px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-left .logo {
  font-size: 20px;
  font-weight: 600;
  color: #e8e8e8;
  letter-spacing: -0.5px;
}

.header-left .logo:hover {
  text-decoration: none;
  color: #fff;
}

.header-center {
  display: flex;
  gap: 28px;
}

.header-center a,
.header-right a {
  font-size: 14px;
  color: #c0d0c0;
  transition: color 0.15s;
}

.header-center a:hover,
.header-right a:hover {
  color: #fff;
  text-decoration: none;
}

/* Options dropdown */
.options-dropdown {
  position: relative;
}

.options-toggle {
  font-size: 14px;
  color: #c0d0c0;
  transition: color 0.15s;
  cursor: pointer;
}

.options-toggle:hover {
  color: #fff;
  text-decoration: none;
}

.caret {
  font-size: 10px;
  margin-left: 2px;
}

.options-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 10px;
  background: rgba(240, 238, 232, 0.95);
  border: 1px solid #c0c0b8;
  border-radius: 6px;
  padding: 14px 18px;
  min-width: 200px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 9000;
}

.options-dropdown.open .options-menu {
  display: block;
}

.options-label {
  font-size: 13px;
  color: #555;
  margin-bottom: 10px;
  white-space: nowrap;
}

.turn-options {
  display: flex;
  gap: 8px;
}

.turn-option {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid #c0c0b8;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.turn-option:hover {
  background: #eee;
}

.turn-option.active {
  background: #e8e4dc;
  border-color: #999;
}

.turn-option .radio-dot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid #999;
  border-radius: 50%;
  position: relative;
}

.turn-option.active .radio-dot::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 6px;
  height: 6px;
  background: #555;
  border-radius: 50%;
}

/* Motive grid */
.motive-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.motive-swatch {
  width: 30px;
  height: 38px;
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  padding: 0;
  outline: none;
}

.motive-swatch:hover {
  transform: scale(1.1);
  border-color: rgba(255,255,255,0.6);
}

.motive-swatch.active {
  border-color: #333;
  box-shadow: 0 0 0 1px #fff, 0 0 0 3px #333;
}

.header-right .undo-link {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 15px;
  padding: 6px 14px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.header-right .undo-link:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
  text-decoration: none;
}

.header-right .undo-link svg {
  width: 20px;
  height: 20px;
  vertical-align: middle;
}

.game-container {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

#solitaireCanvas {
  width: 900px;
  height: 880px;
}

#solitaireCanvas canvas {
  display: block;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.modal.visible {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
}

.modal-content {
  position: relative;
  background: #fff;
  border-radius: 8px;
  padding: 32px 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  z-index: 1;
  transform: translateY(10px);
  transition: transform 0.2s ease;
}

.modal.visible .modal-content {
  transform: translateY(0);
}

.modal-content h2 {
  font-size: 20px;
  margin-bottom: 16px;
  color: #222;
}

.modal-content h3 {
  font-size: 15px;
  margin-top: 14px;
  margin-bottom: 6px;
  color: #333;
}

.modal-content p {
  font-size: 14px;
  line-height: 1.5;
  color: #555;
  margin-bottom: 8px;
}

.modal-content ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.modal-content li {
  font-size: 14px;
  line-height: 1.6;
  color: #555;
}

.modal-close {
  margin-top: 16px;
  padding: 8px 24px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.modal-close:hover {
  background: #f5f5f5;
}

.win-content {
  text-align: center;
  padding: 48px 40px;
}

.win-text {
  font-size: 24px;
  font-weight: 600;
  color: #222;
  margin-bottom: 24px;
}

.btn {
  display: inline-block;
  padding: 10px 28px;
  background: #2e7d32;
  color: #fff !important;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.15s;
}

.btn:hover {
  background: #1b5e20;
  text-decoration: none;
}
