.gmk-tool-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #10b981; --p-text: #0f172a; width: 100%; max-width: 900px; margin: 0 auto; background: var(--p-bg); border-radius: 24px; padding: 32px; border: 1px solid var(--p-border); box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05); display: flex; flex-direction: column; align-items: center; }
.gmk-header-main { font-size: 1.5rem; font-weight: 600; color: var(--p-text); margin-bottom: 8px; display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; }
.gmk-badge { background: #d1fae5; color: #047857; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; font-weight: 500; }
.gmk-subtitle { color: #64748b; font-size: 0.95rem; padding-bottom: 16px; border-bottom: 1px solid var(--p-border); margin-bottom: 24px; text-align: center; width: 100%; }

@media (max-width: 768px) { .gmk-tool-wrapper { padding: 20px; border-radius: 16px; } }

.gmk-mode-bar { display: flex; justify-content: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.gmk-mode-btn { background: #f1f5f9; border: 1px solid #cbd5e1; padding: 10px 24px; font-size: 1rem; font-weight: 600; border-radius: 30px; cursor: pointer; color: #475569; transition: 0.2s; display: flex; align-items: center; gap: 8px; }
.gmk-mode-btn:hover { background: #e2e8f0; }
.gmk-mode-btn.active { background: var(--p-primary); color: white; border-color: var(--p-primary); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }

.gmk-status-panel { background: #f8fafc; border-radius: 16px; padding: 12px 24px; margin-bottom: 24px; text-align: center; border: 1px solid var(--p-border); width: 100%; max-width: 500px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 80px; }
.gmk-status-text { font-size: 1.2rem; font-weight: 700; color: var(--p-text); line-height: 1.4; display: flex; align-items: center; gap: 8px; }
.gmk-turn-icon { width: 24px; height: 24px; border-radius: 50%; display: inline-block; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.gmk-turn-black { background: radial-gradient(circle at 30% 30%, #475569, #000000); }
.gmk-turn-white { background: radial-gradient(circle at 30% 30%, #ffffff, #e2e8f0); border: 1px solid #cbd5e1; }

.gmk-board-container { padding: 16px; background: #dcb37b; border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,0.15), inset 0 0 20px rgba(139, 90, 43, 0.3); margin-bottom: 24px; border: 4px solid #b28247; position: relative; width: 100%; max-width: 550px;}
.gmk-board { display: grid; grid-template-columns: repeat(15, 1fr); grid-template-rows: repeat(15, 1fr); width: 100%; aspect-ratio: 1/1; background: transparent; border: 1px solid #a37238; position: relative; }
.gmk-cell { position: relative; cursor: pointer; border-right: 1px solid #ba8c53; border-bottom: 1px solid #ba8c53; display: flex; align-items: center; justify-content: center; }
.gmk-cell::after { content: ''; position: absolute; width: 100%; height: 100%; }
.gmk-cell:hover::after { background: rgba(0,0,0,0.1); }

.gmk-piece { width: 85%; height: 85%; border-radius: 50%; position: absolute; z-index: 10; box-shadow: 0 3px 6px rgba(0,0,0,0.4); animation: dropIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275); pointer-events: none;}
.gmk-piece.black { background: radial-gradient(circle at 30% 30%, #4b5563 10%, #000000 80%); }
.gmk-piece.white { background: radial-gradient(circle at 30% 30%, #ffffff 10%, #d1d5db 80%); }
@keyframes dropIn { 0% { transform: scale(0.5); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.gmk-piece.last-move::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 25%; height: 25%; background: #ef4444; border-radius: 50%; box-shadow: 0 0 4px rgba(239, 68, 68, 0.8); }

.gmk-controls { display: flex; gap: 16px; width: 100%; max-width: 500px; }
.gmk-btn { flex: 1; padding: 14px 0; border: none; border-radius: 12px; font-weight: bold; font-size: 1.1rem; cursor: pointer; transition: 0.2s; display: flex; align-items: center; justify-content: center; gap: 8px; }
.gmk-btn-reset { background: #f1f5f9; color: #475569; border: 1px solid #cbd5e1; }
.gmk-btn-reset:hover { background: #e2e8f0; }
.gmk-btn-undo { background: #0f172a; color: white; box-shadow: 0 4px 10px rgba(15, 23, 42, 0.2); }
.gmk-btn-undo:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(15, 23, 42, 0.3); }
.gmk-btn-undo:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

[data-theme="dark"] .gmk-tool-wrapper { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .gmk-status-panel { background: #0f172a; border-color: #475569; }
[data-theme="dark"] .gmk-status-text { color: #f8fafc; }
[data-theme="dark"] .gmk-mode-btn { background: #0f172a; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .gmk-mode-btn.active { background: var(--p-primary); color: white; border-color: var(--p-primary); }
[data-theme="dark"] .gmk-board-container { background: #334155; border-color: #1e293b; box-shadow: 0 10px 25px rgba(0,0,0,0.5); }
[data-theme="dark"] .gmk-board { border-color: #475569; }
[data-theme="dark"] .gmk-cell { border-right-color: #475569; border-bottom-color: #475569; }
[data-theme="dark"] .gmk-btn-reset { background: #0f172a; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .gmk-btn-reset:hover { background: #1e293b; }
[data-theme="dark"] .gmk-btn-undo { background: var(--p-primary); }