.wortknacker-wrapper {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	max-width: 500px;
	margin: 0 auto;
	padding: clamp(10px, 3vw, 20px);
}

.wortknacker-header {
	text-align: center;
	margin-bottom: 20px;
}

.wortknacker-title {
	margin: 0 0 10px;
	font-size: 24px;
	font-weight: 700;
}

.wortknacker-subtitle {
	margin: 0;
	font-size: 14px;
	color: #666;
}

.wortknacker-game-area {
	min-height: 400px;
	position: relative;
}

.wortknacker-ads {
	margin-top: 20px;
	padding: 10px;
	text-align: center;
	background: #f5f5f5;
	border-radius: 4px;
}

.wortknacker-ads-desktop-top {
	margin-bottom: 20px;
	margin-top: 0;
	width: 100%;
	padding: 15px;
}

.wortknacker-ads-desktop-bottom {
	width: 100%;
	padding: 15px;
	margin-top: 20px;
	margin-bottom: 0;
}

.wortknacker-ads-desktop-left,
.wortknacker-ads-desktop-right {
	display: none;
}

.wortknacker-ads-mobile-top {
	display: none;
}

@media (min-width: 1100px) {
	.wortknacker-ads-desktop-left {
		display: block;
		position: fixed;
		left: 20px;
		top: 100px;
		width: 160px;
		z-index: 999;
		padding: 10px;
		background: #f5f5f5;
		border-radius: 4px;
	}

	.wortknacker-ads-desktop-right {
		display: block;
		position: fixed;
		right: 20px;
		top: 100px;
		width: 160px;
		z-index: 999;
		padding: 10px;
		background: #f5f5f5;
		border-radius: 4px;
	}
}

@media (max-width: 768px) {
	.wortknacker-ads-desktop-top,
	.wortknacker-ads-desktop-bottom,
	.wortknacker-ads-desktop-left,
	.wortknacker-ads-desktop-right {
		display: none;
	}
	
	.wortknacker-ads-mobile-top {
		display: block;
		position: sticky;
		top: 0;
		z-index: 1000;
		margin: 0;
		padding: 8px;
		background: #fff;
		border-bottom: 1px solid #ddd;
	}
	
	.wortknacker-game-area {
		min-height: 350px;
	}
}

.wortknacker-warning {
	padding: 15px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
}

.wk-length-select {
	text-align: center;
	padding: 20px;
}

.wk-length-select label {
	display: block;
	margin-bottom: 10px;
	font-weight: 600;
}

.wk-length-select select {
	padding: 8px 16px;
	font-size: 16px;
	margin-right: 10px;
	border: 1px solid #ccc;
	border-radius: 4px;
}

.wk-btn {
	padding: 10px 24px;
	font-size: 16px;
	font-weight: 600;
	background: #1a1a1a;
	color: #fff;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s;
}

.wk-btn:hover {
	background: #333;
	transform: scale(1.05);
}

.wk-grid {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: clamp(3px, 0.6vw, 5px);
	margin: 20px auto;
	max-width: 330px;
	width: 100%;
	box-sizing: border-box;
}

.wk-tile {
	width: 100%;
	aspect-ratio: 1;
	height: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: clamp(16px, 4.5vw, 24px);
	font-weight: 700;
	text-transform: uppercase;
	background: #fff;
	transition: transform 0.1s, border-color 0.1s;
	border: 2px solid #d3d6da;
	border-radius: 4px;
	box-sizing: border-box;
	overflow: hidden;
}

.wk-tile.filled {
	border-color: #878a8c;
}

.wk-tile.revealed {
	transition: background 0.5s, border-color 0.5s;
}

.wk-tile.state-correct {
	background: #6aaa64;
	border-color: #6aaa64;
	color: #fff;
}

.wk-tile.state-present {
	background: #c9b458;
	border-color: #c9b458;
	color: #fff;
}

.wk-tile.state-absent {
	background: #787c7e;
	border-color: #787c7e;
	color: #fff;
}

.wk-tile.shake {
	animation: shake 0.5s;
}

@keyframes shake {
	0%, 100% { transform: translateX(0); }
	10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
	20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.wk-keyboard {
	margin-top: 20px;
	max-width: 500px;
	margin-left: auto;
	margin-right: auto;
}

.wk-keyboard-row {
	display: flex;
	justify-content: center;
	margin-bottom: 6px;
	gap: 3px;
}

.wk-key {
	flex: 1;
	max-width: 44px;
	min-width: 24px;
	height: 50px;
	font-size: clamp(11px, 3vw, 14px);
	font-weight: 700;
	background: #d3d6da;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	text-transform: uppercase;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.wk-key-wide {
	flex: 1.6;
	max-width: 64px;
	font-size: clamp(10px, 2.5vw, 12px);
}

#wortknacker-game .wk-key[data-state="correct"] {
	background: #6aaa64 !important;
	color: #fff !important;
}

#wortknacker-game .wk-key[data-state="present"] {
	background: #c9b458 !important;
	color: #fff !important;
}

#wortknacker-game .wk-key[data-state="absent"] {
	background: #787c7e !important;
	color: #fff !important;
}

.wk-message {
	position: absolute;
	top: 200px;
	left: 50%;
	transform: translate(-50%, -20px);
	text-align: center;
	font-weight: 600;
	color: #333;
	background: #fff;
	border: 2px solid #6aaa64;
	border-radius: 8px;
	padding: 12px 24px;
	box-shadow: 0 4px 12px rgba(0,0,0,0.15);
	opacity: 0;
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
	z-index: 100;
}

.wk-message.show {
	opacity: 1;
	transform: translate(-50%, 0);
}

.wk-offline-banner {
	background: #fff3cd;
	border: 1px solid #ffc107;
	color: #856404;
	padding: 10px;
	text-align: center;
	margin-bottom: 15px;
	font-weight: 600;
	border-radius: 4px;
}

.wk-btn-secondary {
	background: #6c757d !important;
	color: #fff !important;
}

.wk-btn-small {
	padding: 6px 16px;
	font-size: 14px;
}

.wk-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1000;
}

.wk-modal-content {
	background: #fff;
	padding: 30px 40px;
	border-radius: 8px;
	text-align: center;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.wk-modal-content h2 {
	margin: 0 0 15px;
	font-size: 28px;
}

.wk-modal-content p {
	margin: 0 0 20px;
	font-size: 18px;
	color: #666;
}

.wk-badges {
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #eee;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.wk-badge {
	padding: 10px;
	background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
	border-radius: 8px;
	color: #fff;
	min-width: 60px;
}

.wk-badge-icon {
	font-size: 28px;
	margin-bottom: 5px;
}

.wk-badge-name {
	font-size: 11px;
	font-weight: 600;
}

.wk-badge-wrapper {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.wk-badge-desc {
	background: #f6c246;
	color: #fff;
	padding: 8px 12px;
	border-radius: 6px;
	font-size: 20px;
	text-align: center;
	margin-top: 5px;
	width: 100%;
	box-sizing: border-box;
}

.wk-badge-progress {
	margin-top: 15px;
	padding-top: 10px;
	border-top: 1px solid #eee;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px;
}

.wk-badge-progress-icon {
	font-size: 22px;
	opacity: 0.25;
	transition: opacity 0.2s;
	cursor: default;
}

.wk-badge-progress-icon.earned {
	opacity: 1;
}

.wk-next-badge {
	margin-top: 12px;
	padding: 10px;
	background: #f5f5f5;
	border-radius: 8px;
	text-align: center;
}

.wk-next-badge-label {
	font-size: 13px;
	color: #555;
	margin-bottom: 6px;
}

.wk-next-badge-bar {
	height: 10px;
	background: #ddd;
	border-radius: 5px;
	overflow: hidden;
}

.wk-next-badge-fill {
	height: 100%;
	background: linear-gradient(90deg, #667eea, #764ba2);
	border-radius: 5px;
	transition: width 0.5s ease;
}

.wk-all-collected {
	font-size: 14px;
	color: #6aaa64;
	font-weight: 600;
}

@media (max-width: 600px) {
	.wk-badge-wrapper {
		width: 100%;
	}
}

.wk-controls {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-bottom: 10px;
	gap: 10px;
}

.wk-controls select {
	padding: 5px 10px;
	font-size: 14px;
	border: 1px solid #d3d6da;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
}

.wk-sound-toggle {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	padding: 5px 10px;
	border-radius: 4px;
	transition: background 0.2s;
}

.wk-sound-toggle:hover {
	background: #f0f0f0;
}

.wk-length-label {
	font-size: 14px;
	margin: 0 8px;
	white-space: nowrap;
}

.wk-mascot {
	font-size: 48px;
	display: block;
	margin-bottom: 10px;
	animation: wk-bounce 0.5s ease infinite alternate;
}

@keyframes wk-bounce {
	from { transform: translateY(0); }
	to { transform: translateY(-10px); }
}

.wk-confetti {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
	z-index: 9999;
	overflow: hidden;
}

.wk-confetti-piece {
	position: absolute;
	top: -20px;
	width: 10px;
	height: 10px;
	opacity: 0.8;
	animation: wk-fall linear forwards;
}

@keyframes wk-fall {
	0% {
		transform: translateY(0) rotate(0deg);
		opacity: 1;
	}
	100% {
		transform: translateY(100vh) rotate(720deg);
		opacity: 0;
	}
}

.wk-preset-select {
	padding: 5px 10px;
	font-size: 14px;
	border: 1px solid #ccc;
	border-radius: 4px;
	background: #fff;
	cursor: pointer;
}

@media (max-width: 480px) {
	.wortknacker-wrapper {
		padding: clamp(5px, 2vw, 15px);
		max-width: 100%;
	}

	.wk-grid {
		max-width: calc(100vw - 20px);
		gap: 4px;
		margin: 10px auto;
	}

	.wk-keyboard {
		max-width: 100%;
		margin: 8px auto 0 auto;
		padding: 0 4px;
	}

	.wk-key {
		height: 44px;
		font-size: clamp(10px, 3.5vw, 13px);
	}

	.wk-key-wide {
		font-size: clamp(9px, 3vw, 11px);
	}

	.wk-message {
		top: 120px;
		font-size: clamp(13px, 4vw, 16px);
		padding: 10px 16px;
		max-width: 90%;
		width: max-content;
	}

	.wk-modal-content {
		padding: clamp(15px, 5vw, 30px) clamp(15px, 5vw, 40px);
		margin: 10px;
		max-width: calc(100vw - 20px);
	}

	.wk-modal-content h2 {
		font-size: clamp(20px, 6vw, 28px);
	}

	.wk-modal-content p {
		font-size: clamp(14px, 4vw, 18px);
	}

	.wk-badge-icon {
		font-size: clamp(20px, 6vw, 28px);
	}

	.wk-badge-desc {
		font-size: clamp(14px, 4vw, 20px);
	}

	.wk-mascot {
		font-size: clamp(36px, 10vw, 48px);
	}

	.wk-controls {
		flex-wrap: wrap;
		gap: 6px;
	}

	.wk-controls select {
		font-size: clamp(12px, 3vw, 14px);
		max-width: 120px;
	}

	.wortknacker-game-area {
		min-height: 350px;
	}
}
}
