/* Solitär – Oberfläche nach dem Vorbild von Windows 95
   Alle Regeln sind auf .sol gescoped, damit kein Theme-CSS kollidiert. */

.sol {
	--sol-face:   #c0c0c0;  /* Fenstergrau */
	--sol-light:  #ffffff;  /* Lichtkante */
	--sol-soft:   #dfdfdf;  /* zweite Lichtkante */
	--sol-shade:  #808080;  /* erste Schattenkante */
	--sol-dark:   #000000;  /* Schattenkante */
	--sol-title:  #000080;  /* Titelleiste */
	--sol-title2: #1084d0;
	--sol-felt:   #008000;  /* Spieltisch */
	--sol-red:    #c00000;

	--sol-cw: 60px;
	--sol-ch: 81px;
	--sol-gap: 8px;

	font: 11px Tahoma, "MS Sans Serif", Geneva, Verdana, sans-serif;
	color: var(--sol-dark);
	background: var(--sol-face);
	max-width: 640px;
	margin: 0 auto;
	padding: 3px;
	box-shadow:
		inset 1px 1px 0 var(--sol-light), inset -1px -1px 0 var(--sol-dark),
		inset 2px 2px 0 var(--sol-soft), inset -2px -2px 0 var(--sol-shade);
	box-sizing: border-box;
	user-select: none;
	-webkit-user-select: none;
}

.sol *,
.sol *::before,
.sol *::after { box-sizing: border-box; }

/* ---------- Titelleiste ---------- */

.sol__title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 6px;
	background: linear-gradient(90deg, var(--sol-title) 0%, var(--sol-title2) 100%);
	color: #ffffff;
	font-weight: 700;
	padding: 3px 3px 3px 4px;
	margin: 1px 1px 0;
}

/* ---------- Spieltisch ---------- */

.sol__board {
	position: relative;
	background: var(--sol-felt);
	margin: 0 1px;
	padding: var(--sol-gap);
	box-shadow:
		inset 1px 1px 0 var(--sol-shade), inset -1px -1px 0 var(--sol-light),
		inset 2px 2px 0 var(--sol-dark), inset -2px -2px 0 var(--sol-soft);
	overflow: hidden;
}

.sol__top,
.sol__cols {
	display: grid;
	grid-template-columns: repeat(7, var(--sol-cw));
	gap: var(--sol-gap);
}

.sol__cols { margin-top: calc(var(--sol-gap) * 1.6); align-items: stretch; }

.sol__gap { pointer-events: none; }

.sol__slot {
	position: relative;
	width: var(--sol-cw);
	height: var(--sol-ch);
}

.sol__slot--tab { height: auto; min-height: var(--sol-ch); }

/* leere Ablagefelder: eingelassener Rahmen auf dem Filz */
.sol__slot--waste::before,
.sol__slot--found::before,
.sol__slot--tab::before,
.sol__slot--stock.is-recycle::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: var(--sol-cw);
	height: var(--sol-ch);
	border: 1px solid rgba(0, 0, 0, 0.35);
	border-radius: 3px;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.sol__stockCount {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 2px;
	text-align: center;
	color: #ffffff;
	font-size: 10px;
	text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.6);
	z-index: 6;
	pointer-events: none;
}

/* ---------- Karten ---------- */

.sol__card {
	position: absolute;
	left: 0;
	top: 0;
	width: var(--sol-cw);
	height: var(--sol-ch);
	background: #ffffff;
	border: 1px solid var(--sol-dark);
	border-radius: 3px;
	cursor: pointer;
	overflow: hidden;
	color: var(--sol-dark);
	/* Karten sind Knöpfe – Browservorgaben zurücksetzen */
	padding: 0;
	margin: 0;
	font: inherit;
	text-align: left;
	appearance: none;
	-webkit-appearance: none;
	/* Beim Ziehen mit dem Finger nicht die Seite scrollen. */
	touch-action: none;
}

/* Frei schwebendes Abbild der gezogenen Karten. Folgt dem Zeiger und darf
   keine Ereignisse abfangen, sonst findet dropTarget das Feld darunter nicht. */
.sol__drag {
	position: fixed;
	z-index: 9999;
	pointer-events: none;
	opacity: 0.92;
	filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.35));
}

.sol__card:focus-visible {
	outline: 2px solid var(--sp-accent, #b8702e);
	outline-offset: 1px;
	z-index: 25;
}

.sol__card.is-red { color: var(--sol-red); }

.sol__card.is-sel {
	box-shadow: 0 0 0 2px #ffff00, 0 0 0 3px rgba(0, 0, 0, 0.55);
	z-index: 20;
}

/* Rückseite: blaues Karomuster wie im Original */
.sol__card.is-back {
	background:
		repeating-linear-gradient(45deg, #2a2ac0 0 4px, #0000a8 4px 8px),
		repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.22) 0 4px, transparent 4px 8px);
	background-blend-mode: screen;
	box-shadow: inset 0 0 0 2px #ffffff, inset 0 0 0 3px #000080;
	cursor: pointer;
}

.sol__idx {
	position: absolute;
	left: 2px;
	top: 1px;
	white-space: pre-line;
	line-height: 0.95;
	text-align: center;
	font-weight: 700;
	font-size: calc(var(--sol-cw) * 0.27);
}

.sol__idx--br {
	left: auto;
	top: auto;
	right: 2px;
	bottom: 1px;
	transform: rotate(180deg);
}

.sol__mid {
	position: absolute;
	left: 0;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	text-align: center;
	font-size: calc(var(--sol-cw) * 0.46);
	line-height: 1;
}

/* ---------- Gewinnanimation ---------- */

.sol__canvas {
	position: absolute;
	left: 0;
	top: 0;
	display: none;
	z-index: 40;
	cursor: pointer;
}

.sol__canvas.is-on { display: block; }

/* ---------- Statusleiste ---------- */

.sol__status {
	display: flex;
	gap: 3px;
	margin: 3px 1px 1px;
}

@media (prefers-reduced-motion: reduce) {
	.sol__canvas { display: none !important; }
}

/* ===== Gemeinsame Gestaltung der Spiele =====================================
   Dieser Block ist in allen Spiele-Plugins identisch:
   schiffe-versenken, sudoku, vier-gewinnt, superhirn, schnick-schnack,
   mahjong, solitaer. Wird hier etwas geaendert, muss es dort mitgeaendert
   werden. Einzige Ausnahme ist --sp-accent: der ist je Spiel eigen und
   entspricht der Kachelfarbe in der Spiele-Icon-Navigation.

   Solitaer erinnert an das Windows-Original, kopiert es aber nicht mehr:
   Titelleiste, Menueleiste und die eingelassene Statusleiste sind entfallen.
   Geblieben sind gruener Tisch, Kartenbild und Punktezaehlung. Die alten
   Fensterregeln weiter oben werden hier gezielt zurueckgesetzt.
   ========================================================================== */

.sol {
	--sp-paper:  #eef1f3;
	--sp-ink:    #14293b;
	--sp-muted:  #5b6f7f;
	--sp-line:   #c2ccd3;
	--sp-win:    #1f7a4d;
	--sp-lose:   #b3382c;
	--sp-radius: 12px;
	--sp-sans:   system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--sp-mono:   ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
	--sp-accent: #b8702e;

	--sol-felt: #2f7d5e;   /* ruhigeres Gruen als das Original-#008000 */

	container-type: inline-size;

	background: var(--sp-paper);
	color: var(--sp-ink);
	font-family: var(--sp-sans);
	font-size: 12px;
	border: 1px solid var(--sp-line);
	border-radius: var(--sp-radius);
	box-shadow: none;      /* Windows-Fase weg */
	padding: 0;
	max-width: 660px;
}

.sol__inner { padding: clamp(14px, 4cqi, 26px); }

.sol__head {
	padding-bottom: 12px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--sp-line);
}

.sol__eyebrow {
	font-family: var(--sp-mono);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--sp-accent);
	opacity: 1;
	margin: 0 0 4px;
}

/* .sol__title war die Fenster-Titelleiste und ist jetzt die Ueberschrift. */
.sol__title {
	display: block;
	background: none;
	padding: 0;
	font-family: var(--sp-sans);
	font-size: clamp(21px, 6cqi, 30px);
	font-weight: 800;
	letter-spacing: 0.01em;
	line-height: 1.05;
	text-transform: none;
	margin: 0;
	color: var(--sp-ink);
}

.sol__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 18px;
	margin-bottom: 10px;
	font-family: var(--sp-mono);
	font-size: 12px;
	color: var(--sp-muted);
	font-variant-numeric: tabular-nums;
}

/* War die eingelassene Windows-Leiste, ist jetzt die gemeinsame Statuszeile. */
.sol__status {
	display: block;
	background: none;
	box-shadow: none;
	padding: 0;
	font-family: var(--sp-mono);
	font-size: 12.5px;
	line-height: 1.5;
	color: var(--sp-muted);
	opacity: 1;
	margin: 12px 0 0;
	min-height: 1.5em;
	white-space: normal;
}

.sol__status--win  { color: var(--sp-win);  font-weight: 700; opacity: 1; }
.sol__status--lose { color: var(--sp-lose); font-weight: 700; opacity: 1; }

.sol__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
}

.sol__actionsLabel {
	font-family: var(--sp-mono);
	font-size: 10px;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--sp-muted);
	margin-right: 2px;
}

.sol__btn {
	font-family: var(--sp-mono);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	padding: 10px 16px;
	border-radius: 6px;
	background: var(--sp-accent);
	color: #fff;
	border: 1px solid var(--sp-accent);
	cursor: pointer;
}

.sol__btn--ghost,
.sol__btn--chip {
	background: transparent;
	color: var(--sp-ink);
	border-color: var(--sp-line);
	font-weight: 400;
}

.sol__btn--chip { padding: 7px 12px; letter-spacing: 0.1em; }

.sol__btn:hover:not([disabled]) { filter: brightness(1.08); }
.sol__btn[disabled] { opacity: 0.38; cursor: not-allowed; }
.sol__btn:focus-visible { outline: 2px solid var(--sp-accent); outline-offset: 2px; }

.sol__hint {
	font-family: var(--sp-sans);
	font-size: 12px;
	line-height: 1.6;
	color: var(--sp-muted);
	opacity: 1;
	max-width: none;
	margin: 12px 0 0;
}

.sol__hint kbd {
	font-family: var(--sp-mono);
	font-size: 11px;
	background: rgba(0, 0, 0, 0.06);
	border: 1px solid var(--sp-line);
	border-radius: 3px;
	padding: 1px 5px;
	color: var(--sp-ink);
}

/* Der Tisch bleibt gruen, verliert aber die harte Windows-Fase. */
.sol__board {
	border-radius: 8px;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3);
	border: 1px solid #24614a;
}
