.ttt-tool-wrapper { --p-bg: #ffffff; --p-border: #e2e8f0; --p-primary: #f59e0b; --p-text: #0f172a; width: 100%; max-width: 800px; 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; }
.ttt-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%; }
.ttt-badge { background: #fef3c7; color: #b45309; padding: 4px 12px; border-radius: 30px; font-size: 0.8rem; font-weight: 500; }
.ttt-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) { .ttt-tool-wrapper { padding: 20px; border-radius: 16px; } }

.ttt-mode-bar { display: flex; justify-content: center; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.ttt-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; }
.ttt-mode-btn:hover { background: #e2e8f0; }
.ttt-mode-btn.active { background: var(--p-primary); color: white; border-color: var(--p-primary); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }

.ttt-status-panel { background: #f8fafc; border-radius: 16px; padding: 16px 32px; margin-bottom: 32px; text-align: center; border: 1px solid var(--p-border); width: 100%; max-width: 400px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 90px; }
.ttt-status-text { font-size: 1.25rem; font-weight: 700; color: var(--p-text); line-height: 1.4; }

.ttt-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; background-color: #cbd5e1; padding: 16px; border-radius: 24px; margin-bottom: 32px; width: 100%; max-width: 400px; box-shadow: inset 0 4px 6px rgba(0,0,0,0.05); }
.ttt-cell { aspect-ratio: 1 / 1; background: #ffffff; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 4rem; font-weight: 900; font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif; cursor: pointer; transition: 0.15s; box-shadow: 0 6px 0 #94a3b8; color: #0f172a; }
.ttt-cell:active:not(.disabled-cell) { transform: translateY(6px); box-shadow: 0 0 0 #94a3b8; }
.ttt-cell.X { color: #f97316; text-shadow: 0 2px 4px rgba(249, 115, 22, 0.3); }
.ttt-cell.O { color: #0ea5e9; text-shadow: 0 2px 4px rgba(14, 165, 233, 0.3); }
.ttt-cell.disabled-cell { cursor: default; }

.ttt-reset-btn { background: #0f172a; border: none; width: 100%; max-width: 400px; padding: 16px 0; font-size: 1.2rem; font-weight: bold; border-radius: 16px; color: #ffffff; cursor: pointer; transition: 0.2s; box-shadow: 0 6px 0 #020617; display: flex; align-items: center; justify-content: center; gap: 8px; }
.ttt-reset-btn:active { transform: translateY(6px); box-shadow: 0 0 0 #020617; }

[data-theme="dark"] .ttt-tool-wrapper { background: #1e293b !important; border-color: #334155 !important; }
[data-theme="dark"] .ttt-status-panel { background: #0f172a; border-color: #475569; color: #f8fafc; }
[data-theme="dark"] .ttt-status-text { color: #f8fafc; }
[data-theme="dark"] .ttt-mode-btn { background: #0f172a; border-color: #475569; color: #cbd5e1; }
[data-theme="dark"] .ttt-mode-btn.active { background: var(--p-primary); color: white; border-color: var(--p-primary); }
[data-theme="dark"] .ttt-board { background-color: #0f172a; box-shadow: inset 0 4px 6px rgba(0,0,0,0.2); }
[data-theme="dark"] .ttt-cell { background: #1e293b; box-shadow: 0 6px 0 #020617; }
[data-theme="dark"] .ttt-cell:active:not(.disabled-cell) { box-shadow: 0 0 0 #020617; }
[data-theme="dark"] .ttt-reset-btn { background: var(--p-primary); box-shadow: 0 6px 0 #b45309; }
[data-theme="dark"] .ttt-reset-btn:active { box-shadow: 0 0 0 #b45309; }

@media (max-width: 500px) { .ttt-cell { font-size: 3.5rem; border-radius: 12px; } .ttt-board { gap: 12px; padding: 12px; border-radius: 20px; } }