@import url('./tokens.css');

:root {
    --bg-color: var(--bg-base);
    --panel-bg: var(--bg-surface);
    --panel-border: var(--border-default);
    --primary: var(--pa-green);
    --primary-glow: var(--pa-green-glow);
    --text-main: var(--text-primary);
    --text-dim: var(--text-secondary);
    --team-red: var(--pa-danger);
    --team-blue: var(--pa-blue);
    --danger: var(--pa-danger);
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    background: radial-gradient(circle at top right, var(--bg-elevated), var(--bg-base));
}

/* Top Menu */
.top-menu {
    height: 80px;
    background: var(--panel-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 20;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.topbar-center {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    position: relative;
}

.logo h1 {
    font-weight: 300;
    font-size: 24px;
    letter-spacing: 1px;
}

.logo strong {
    font-weight: 800;
    color: var(--pa-green);
    text-shadow: 0 0 10px var(--pa-green-glow);
}

.team-header-logo {
    height: 40px;
    margin-left: 190px;
    filter: drop-shadow(0 0 5px rgba(0,0,0,0.5));
    border-radius: 4px;
}

.menu-actions {
    display: flex;
    gap: 10px;
}

.menu-actions button, .action-btn {
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    transition: var(--trans-base);
}

.menu-actions button:hover, .action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--pa-green);
    color: var(--pa-green);
    transform: translateY(-1px);
}

.menu-actions select, .field-selector select, .speed-control select {
    display: none;
}

.field-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}
.field-selector label, .speed-control label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}
.field-selector select {
    background: rgba(0,0,0,0.5);
}

.main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Glassmorphism sidebar */
.sidebar {
    width: 320px;
    background: var(--panel-bg);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--panel-border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    z-index: 100;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    overflow-y: auto;
    overflow-x: hidden; /* Hide horizontal scroll to prevent tooltip clipping */
}

/* Sidebar Resizer */
.resizer {
    width: 4px;
    background: var(--panel-border);
    cursor: col-resize;
    transition: background 0.2s;
    z-index: 100;
}
.resizer:hover, .resizer.dragging {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.tool-section h3 {
    font-family: var(--font-display);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    font-weight: 700;
}

.plays-sidebar {
    width: 300px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    overflow-y: auto;
}

.plays-sidebar h3 {
    text-transform: uppercase;
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 12px;
    letter-spacing: 1px;
}

.play-item-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--panel-border);
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: white;
    width: 100%;
}

.play-item-btn:hover {
    background: rgba(255,255,255,0.15);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.play-item-btn .play-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.play-item-btn .play-time {
    color: var(--text-dim);
    font-size: 11px;
}

.play-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 14px;
    padding: 0 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-delete-btn:hover {
    color: var(--danger);
    transform: scale(1.1);
}

.tool-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-grid button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-main);
    width: 44px; /* Bigger buttons as requested */
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-grid button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.15);
}

.tool-grid button:active, .action-btn:active {
    transform: scale(0.95);
}

.sidebar-input {
    background: rgba(255,255,255,0.05); /* Same as other menus */
    color: white;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
}

.sidebar-input[type="text"] {
    cursor: text;
}

.sidebar-input:hover, .sidebar-input:focus {
    background: rgba(255,255,255,0.15); /* Match menu hover */
}

input[type="color"].sidebar-input::-webkit-color-swatch-wrapper {
    padding: 0;
}
input[type="color"].sidebar-input::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

/* Tooltip styles - DISABLED (using JavaScript system in RugbyAnimator.html) */
/* These are kept for reference but not used - see TooltipManager in RugbyAnimator.html */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover {
    z-index: 10000; /* Bring the entire button and its tooltip to the front */
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--bg-overlay) !important;
    color: var(--pa-green);
    padding: 10px 16px;
    border-radius: var(--radius-md);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: var(--font-display);
    white-space: nowrap;
    width: max-content;
    max-width: 280px;
    opacity: 0 !important; /* Disabled - using JS tooltips */
    pointer-events: none;
    transition: var(--trans-base);
    z-index: 999999;
    border: 1px solid var(--pa-green);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
}

[data-tooltip]:hover::after {
    opacity: 0 !important; /* Disabled - using JS tooltips */
    transform: translateX(-50%) translateY(0);
}

/* Leaning Tooltips - DISABLED (using JavaScript system) */
.tip-right::after {
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    opacity: 0 !important;
}
.tip-right:hover::after {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 0 !important;
}

.tip-left::after {
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    opacity: 0 !important;
}
.tip-left:hover::after {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 0 !important;
}

/* Downward leaning tooltips - DISABLED (using JavaScript system) */
.tip-down::after {
    bottom: auto !important;
    top: calc(100% + 12px) !important;
    left: 50% !important;
    transform: translateX(-50%) translateY(-8px) !important;
    white-space: nowrap !important;
    max-width: 280px !important;
    opacity: 0 !important;
}
.tip-down:hover::after {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 0 !important;
}

/* Side-projecting tooltips (Right) - DISABLED (using JavaScript system) */
.tip-right-side::after {
    bottom: auto !important;
    top: 50% !important;
    left: calc(100% + 15px) !important;
    transform: translateY(-50%) translateX(-8px) !important;
    white-space: nowrap !important;
    max-width: none !important;
    opacity: 0 !important;
}
.tip-right-side:hover::after {
    transform: translateY(-50%) translateX(0) !important;
    opacity: 0 !important;
}

/* Fine-tuning for templates with labels - DISABLED (using JavaScript system) */
.tip-nudge-right::after {
    left: 50% !important;
    transform: translateX(-50%) translateY(8px) !important;
    white-space: nowrap !important;
    max-width: 280px !important;
    opacity: 0 !important;
}
.tip-nudge-right:hover::after {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 0 !important;
}

/* Right-leaning tooltips - DISABLED (using JavaScript system) */
.tip-right-lean::after {
    bottom: calc(100% + 12px) !important;
    left: 70% !important;
    transform: translateX(-50%) translateY(8px) !important;
    white-space: nowrap !important;
    max-width: 280px !important;
    opacity: 0 !important;
}
.tip-right-lean:hover::after {
    transform: translateX(-50%) translateY(0) !important;
    opacity: 0 !important;
}

.tool-grid button.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.2);
}

.tool-grid button.action-btn {
    grid-column: span 2;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
}
.tool-grid button.action-btn:hover {
    background: rgba(255,255,255,0.15);
}

.workspace {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #111827; /* Dark background behind canvas */
}

.canvas-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden; /* For panning */
    position: relative;
    cursor: grab;
}
.canvas-container:active {
    cursor: grabbing;
}

canvas {
    border-radius: 0;
    box-shadow: 0 0px 50px rgba(0,0,0,0.8);
    background-color: #2d5a27;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Timeline Panel */
.timeline-panel {
    min-height: 145px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-default);
    display: flex;
    flex-direction: column;
    padding: var(--space-4) var(--space-8);
    gap: var(--space-3);
    z-index: 10;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.speed-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.frame-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.keyframe-workflow-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 194, 124, 0.22);
    border-radius: 999px;
    background: rgba(0, 194, 124, 0.08);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.35;
}
.keyframe-workflow-hint i {
    color: var(--pa-green);
}
.keyframe-workflow-hint strong {
    color: var(--text-main);
}

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.2s, filter 0.2s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.icon-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.1);
}

.icon-btn.play-btn {
    background: var(--pa-green);
    color: var(--bg-base);
    box-shadow: var(--shadow-glow);
}
.icon-btn.play-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(0, 194, 124, 0.4);
}

#time-display {
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--pa-green);
    min-width: 80px;
    text-align: center;
}

.sync-hub-btn {
    display: none;
    padding: 4px 12px;
    font-size: 11px;
    height: 28px;
    border-radius: 4px;
    background: var(--pa-green);
    color: white;
    border: none;
    cursor: pointer;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin: 0 10px;
    transition: var(--trans-base);
}

.sync-hub-btn:hover {
    background: white;
    color: var(--pa-green);
    box-shadow: var(--shadow-glow);
}

.keyframe-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--panel-border);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.2s;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}
.keyframe-btn-primary {
    background: rgba(0, 194, 124, 0.16);
    border-color: rgba(0, 194, 124, 0.45);
    color: var(--pa-green);
}
.keyframe-btn:hover {
    background: var(--pa-green-subtle);
    border-color: var(--pa-green);
    color: var(--pa-green);
}
.keyframe-btn.danger {
    background: rgba(255, 77, 77, 0.2);
    border-color: var(--danger);
    color: #ffcccc;
}
.keyframe-btn.danger:hover {
    background: var(--danger);
    color: white;
}

.timeline-scrubber-container {
    width: 100%;
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
}

.timeline-frames {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.frame-marker {
    position: absolute;
    width: 5px;
    height: 14px;
    background: var(--primary);
    top: 50%;
    transform: translateY(-50%);
    border-radius: 999px;
    box-shadow: 0 0 5px var(--primary-glow);
}
.frame-marker.selected {
    background: #fff;
    height: 18px;
    box-shadow: 0 0 8px #fff;
}
.frame-marker.selected span {
    position: absolute;
    left: 50%;
    top: -24px;
    transform: translateX(-50%);
    background: var(--pa-green);
    color: #04130d;
    font-size: 10px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 999px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    z-index: 10;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--primary-glow);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-content {
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    width: 450px;
    box-shadow: var(--shadow-xl);
    position: relative;
}
.modal-content h2 {
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
}
.modal-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.modal-body select {
    background: rgba(0,0,0,0.5);
    color: white;
    border: 1px solid var(--panel-border);
    padding: 10px;
    border-radius: 6px;
    font-size: 14px;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}
.modal-footer button {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    border: 1px solid var(--panel-border);
}
.modal-footer button.tool-btn {
    background: rgba(255,255,255,0.05);
    color: white;
}
.modal-footer button.action-btn {
    background: var(--primary);
    color: black;
    border: none;
}

/* Polish details */
::selection {
    background: var(--primary);
    color: #000;
}

@keyframes pulse-glow {
    0% { box-shadow: 0 0 5px var(--primary-glow); }
    50% { box-shadow: 0 0 20px var(--primary-glow); }
    100% { box-shadow: 0 0 5px var(--primary-glow); }
}

.action-btn.export-active {
    animation: pulse-glow 1.5s infinite;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1e293b;
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    border: 1px solid var(--primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 9999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Custom Select / Dropdown Theming (Pro Re-theme) */
.custom-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-select-trigger {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-default);
    cursor: pointer;
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    padding: 10px 16px;
    transition: var(--trans-base);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 160px;
    position: relative;
    white-space: nowrap;
}

.custom-select-trigger::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-secondary);
    border-bottom: 2px solid var(--text-secondary);
    transform: rotate(45deg);
    transition: var(--trans-base);
    margin-left: 12px;
    margin-top: -4px;
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: var(--pa-green);
    background: var(--bg-hover);
}

.custom-select-wrapper.open .custom-select-trigger::after {
    transform: rotate(-135deg);
    margin-top: 4px;
    border-color: var(--pa-green);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    width: max-content;
    background-color: var(--bg-overlay);
    border: 1px solid var(--pa-green);
    border-radius: var(--radius-md);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--trans-base);
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Custom Scrollbar for dropdowns */
.custom-select-options::-webkit-scrollbar {
    width: 4px;
}
.custom-select-options::-webkit-scrollbar-track {
    background: transparent;
}
.custom-select-options::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 10px;
}
.custom-select-options::-webkit-scrollbar-thumb:hover {
    background: var(--pa-green);
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-select-option {
    padding: 12px 16px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: var(--trans-fast);
    font-family: var(--font-body);
}

.custom-select-option:hover {
    background: var(--pa-green-subtle);
    color: var(--pa-green);
}

.custom-select-option.selected {
    background: var(--pa-green);
    color: var(--bg-base);
    font-weight: 700;
}

/* Tactical Tag Chips */
.px-tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.px-tag-chip {
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
    font-weight: 600;
}

.px-tag-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
    color: white;
}

.px-tag-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: black;
    box-shadow: 0 0 10px var(--primary-glow);
}


/* Final Rugby Animator compact field polish */
html, body, #app { overflow: hidden !important; }
.main-layout, .workspace, .canvas-container { min-width: 0 !important; }
.canvas-container { padding: 0 !important; background: #2d5a27 !important; }
#tactical-canvas { border-radius: 0 !important; box-shadow: none !important; width: 100% !important; height: 100% !important; display: block !important; }
.plays-sidebar { overflow-y: auto !important; overflow-x: hidden !important; }
.saved-plays-container, .play-category-group, .play-item-btn { max-width: 100%; min-width: 0; }

/* Keyframe helper responsiveness */

@media (max-width: 900px) {
    .timeline-panel {
        min-height: 168px;
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
    .timeline-header {
        flex-wrap: wrap;
        gap: 10px;
    }
    .keyframe-workflow-hint {
        border-radius: 14px;
        align-items: flex-start;
    }
    .keyframe-btn span {
        display: none;
    }
}

/* =========================================================
   Rugby Animator tablet/small-screen guard
   Full editing requires desktop precision. On touch/smaller
   screens we keep saved-play review/playback available and
   prevent cramped editing controls from overlapping.
   ========================================================= */
.animator-device-warning {
    position: fixed;
    inset: 0;
    z-index: 5000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(3, 8, 18, 0.84);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.animator-device-warning.is-visible { display: flex; }

.animator-device-card {
    width: min(560px, 94vw);
    border: 1px solid rgba(0, 194, 124, 0.32);
    border-radius: 24px;
    padding: clamp(22px, 4vw, 34px);
    background: linear-gradient(145deg, rgba(12, 24, 42, 0.98), rgba(5, 11, 22, 0.98));
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), 0 0 38px rgba(0, 194, 124, 0.10);
    color: var(--text-main);
    text-align: left;
}

.animator-device-card h2 {
    margin: 0 0 12px;
    color: var(--primary);
    font-family: var(--font-display);
    font-size: clamp(1.35rem, 4vw, 2rem);
    line-height: 1.1;
}

.animator-device-card p {
    margin: 0 0 14px;
    color: var(--text-dim);
    line-height: 1.55;
    font-size: 0.95rem;
}

.animator-device-card ul {
    margin: 14px 0 20px;
    padding-left: 1.1rem;
    color: var(--text-dim);
    line-height: 1.55;
}

.animator-device-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.animator-device-actions .action-btn,
.animator-device-actions .tool-btn {
    width: auto;
    min-height: 42px;
    padding: 0 18px;
}

body.animator-view-only .canvas-container {
    cursor: default !important;
}
body.animator-view-only #tactical-canvas {
    pointer-events: none !important;
}
body.animator-view-only .sidebar,
body.animator-view-only #sidebar-resizer,
body.animator-view-only .frame-actions,
body.animator-view-only #btn-sync-hub,
body.animator-view-only .keyframe-workflow-hint,
body.animator-view-only .timeline-scrubber-container {
    display: none !important;
}
body.animator-view-only .timeline-panel {
    min-height: 86px;
    padding: 14px 18px;
}
body.animator-view-only .timeline-header {
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 1180px), (pointer: coarse) and (max-width: 1366px) {
    .top-menu {
        min-height: 82px;
        height: auto;
        padding: 10px 14px;
        gap: 10px;
        flex-wrap: wrap;
    }
    .topbar-right,
    .topbar-center,
    .menu-actions {
        min-width: 0 !important;
        flex-wrap: wrap !important;
    }
    .topbar-right { justify-content: flex-end; }
    .logo-header-img {
        height: 118px !important;
        margin-left: -26px !important;
        margin-top: -8px !important;
    }
    .main-layout { min-height: 0; }
    .plays-sidebar {
        width: min(260px, 32vw);
        padding: 12px 10px;
    }
    .timeline-controls { gap: 10px; flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 900px) {
    .animator-device-card { text-align: left; }
    .animator-device-actions { flex-direction: column; align-items: stretch; }
    .animator-device-actions .action-btn,
    .animator-device-actions .tool-btn { width: 100%; justify-content: center; }
    body.animator-view-only .plays-sidebar {
        width: min(240px, 40vw);
    }
}
