/* Ultimate Tower - Modern CSS Design */

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #0f172a;
    --bg-light: #1e293b;
    --bg-lighter: #334155;
    --text-color: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-color);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    position: relative;
}

.game-container {
    max-width: 1400px;
}

/* Tower Background Animation */
.tower-background {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    opacity: 0.05;
    overflow: hidden;
    pointer-events: none;
}

.tower-line {
    position: absolute;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, transparent, var(--primary-color), transparent);
    animation: towerPulse 3s ease-in-out infinite;
}

.tower-line:nth-child(1) {
    left: 20%;
    animation-delay: 0s;
}

.tower-line:nth-child(2) {
    left: 50%;
    animation-delay: 1s;
}

.tower-line:nth-child(3) {
    left: 80%;
    animation-delay: 2s;
}

@keyframes towerPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scaleY(1);
    }
    50% {
        opacity: 1;
        transform: scaleY(1.1);
    }
}

.content-wrapper {
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.3);
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Cards */
.setup-card,
.game-link-card,
.master-card,
.history-card,
.task-card,
.error-card,
.victory-card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.setup-card h2,
.game-link-card h2,
.master-card h3,
.history-card h3 {
    margin-bottom: 20px;
    color: var(--text-color);
}

/* Form Groups */
.form-group {
    margin-bottom: 30px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1rem;
}

.props-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    font-style: italic;
}

/* Difficulty Buttons */
.difficulty-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.btn-difficulty {
    flex: 1;
    min-width: 150px;
    padding: 20px;
    background: var(--bg-lighter);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.btn-difficulty .icon {
    font-size: 2rem;
}

.btn-difficulty:hover {
    background: rgba(139, 92, 246, 0.35);
    border-color: #a78bfa;
    transform: translateY(-2px);
}

.btn-difficulty.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* Props List */
.props-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.prop-item {
    display: flex;
    align-items: center;
}

.prop-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.prop-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 12px;
    background: var(--bg-lighter);
    border-radius: 10px;
    flex: 1;
    transition: all 0.2s ease;
}

.prop-item label:hover {
    background: rgba(139, 92, 246, 0.35);
}

.prop-icon {
    font-size: 1.5rem;
}

/* Game Rules */
.game-rules {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(168, 85, 247, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
}

.game-rules h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.game-rules .rules-subtitle {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-lighter);
    border-radius: 10px;
    margin-bottom: 10px;
}

.rule-item:last-child {
    margin-bottom: 0;
}

.rule-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.rule-text {
    flex: 1;
    color: var(--text-color);
    font-size: 1.15rem;
    line-height: 1.5;
    font-weight: 500;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.3rem;
}

.btn-success {
    flex: 1;
    padding: 16px 32px;
    background: var(--success-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-warning {
    flex: 1;
    padding: 16px 32px;
    background: var(--warning-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

.btn-danger {
    flex: 1;
    padding: 16px 32px;
    background: var(--danger-color);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

.btn-excellent {
    flex: 1;
    padding: 16px 32px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

.btn-excellent:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
}

.btn-success:disabled,
.btn-warning:disabled,
.btn-danger:disabled,
.btn-excellent:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

/* Link Container */
.link-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
}

.link-container input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-size: 1rem;
}

.btn-copy {
    padding: 12px 24px;
    background: var(--bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-copy:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-copy.copied {
    background: var(--success-color);
    border-color: var(--success-color);
}

/* Game Header */
.game-header {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.game-info h1 {
    font-size: 2rem;
    margin-bottom: 15px;
}

.home-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 15px;
    padding: 8px 16px;
    background: var(--bg-lighter);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.home-link:hover {
    color: var(--primary-light);
    background: var(--bg-lighter);
    transform: translateX(-3px);
}

.game-stats {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 1.3rem;
}

/* Master URL Container */
.master-url-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    padding: 10px 15px;
    background: var(--bg-lighter);
    border-radius: 10px;
    font-size: 0.85rem;
}

.master-url-label {
    color: var(--text-muted);
    white-space: nowrap;
}

.master-url-input {
    flex: 1;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-family: 'Courier New', monospace;
    min-width: 0;
}

.master-url-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.btn-copy-url {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.btn-copy-url:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-copy-url:active {
    transform: translateY(0);
}

.btn-copy-url .copy-icon {
    font-size: 1rem;
}

/* Game Layout - Tower on Right Side */
.game-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.tower-sidebar {
    width: 140px;
    flex-shrink: 0;
}

/* Tower Visual - Vertical Display */
.tower-visual {
    display: flex;
    gap: 12px;
    align-items: stretch;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 15px;
    padding: 15px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 20px;
}

.tower-progress {
    flex: 1;
    height: 500px;
    background: var(--bg-lighter);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.3);
}

.tower-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, var(--primary-dark), var(--primary-light));
    transition: height 0.8s ease;
    box-shadow: 0 -5px 20px rgba(99, 102, 241, 0.5);
}

.tower-marker {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2rem;
    transition: bottom 0.8s ease;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.5));
    z-index: 2;
}

.tower-victory {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(255, 237, 78, 0.3));
    color: #ffd700;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1rem;
    text-align: center;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
    border: 2px solid rgba(255, 170, 0, 0.5);
    opacity: 0.7;
    transition: all 0.5s ease;
    margin-bottom: 15px;
}

/* When victory is reached */
.tower-victory.victory-reached {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
    border: 3px solid #ffaa00;
    opacity: 1;
    animation: victoryPulse 1.5s ease-in-out infinite;
}

@keyframes victoryPulse {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 4px 15px rgba(255, 215, 0, 0.6), 0 0 30px rgba(255, 215, 0, 0.4);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 6px 20px rgba(255, 215, 0, 0.8), 0 0 40px rgba(255, 215, 0, 0.6);
    }
}

.floor-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5px 0;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
}

/* Tower Sidebar Stats */
.tower-sidebar .game-stats {
    margin-top: 15px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 15px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1rem;
}

.tower-sidebar .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.tower-sidebar .stat-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-light);
}

/* Task Card */
.task-waiting {
    text-align: center;
    padding: 40px 20px;
}

.task-waiting h2 {
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.task-active {
    animation: slideIn 0.5s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.task-header h3 {
    font-size: 1.5rem;
}

.task-steps {
    display: flex;
    gap: 10px;
}

.steps-badge,
.floor-badge {
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.steps-badge {
    background: var(--success-color);
    color: white;
}

.floor-badge {
    background: var(--primary-color);
    color: white;
}

.task-content {
    background: var(--bg-lighter);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
}

.task-image {
    width: 100%;
    max-width: 800px;
    height: auto;
    max-height: 600px;
    object-fit: contain;
    border-radius: 15px;
    margin: 0 auto 25px;
    display: block;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border: 2px solid var(--border-color);
}

.task-name {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--primary-light);
}

.task-difficulty {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 12px;
    padding: 6px 14px;
    border-radius: 20px;
    display: inline-block;
    vertical-align: middle;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.task-difficulty.difficulty-easy {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 2px solid #34d399;
}

.task-difficulty.difficulty-normal {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    border: 2px solid #fbbf24;
}

.task-difficulty.difficulty-hard {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: 2px solid #f87171;
}

.task-description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 15px;
    color: var(--text-color);
    opacity: 0.9;
}

.task-props {
    color: var(--text-muted);
    margin-top: 10px;
}

.task-info {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Master View */
.current-task {
    background: var(--bg-lighter);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.judge-buttons h3 {
    margin-bottom: 15px;
}

.judge-buttons {
    margin-bottom: 15px;
}

.master-waiting {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
    font-style: italic;
}

/* Final task choice (master at floor 30) */
.final-choice-section {
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 24px;
    padding-bottom: 44px;
    background: var(--bg-lighter);
    border-radius: 12px;
    border: 1px solid var(--primary-color);
    text-align: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.final-choice-section h3 {
    margin-bottom: 18px;
    color: var(--text-color);
}

.final-choice-hint {
    margin-top: 15px;
    font-size: 1.3em;
    color: var(--text-muted);
}

.final-tasks-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.final-task-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 18px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    text-align: center;
    width: 100%;
    min-width: 0;
}

.final-task-card:hover {
    border-color: var(--primary-light);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.final-task-card-img-wrap {
    margin: -18px -18px 14px -18px;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
    background: var(--bg-lighter);
}

.final-task-card-img {
    width: 100%;
    height: 168px;
    object-fit: cover;
    display: block;
}

.final-task-card h4 {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: var(--text-color);
    line-height: 1.3;
}

.final-task-card .final-task-desc {
    font-size: 1.02em;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.final-task-card .btn-choose-final {
    width: 100%;
    padding: 12px;
    font-size: 1.14em;
}

/* History */
.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    background: var(--bg-lighter);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    position: relative;
}

.history-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-weight: 600;
}

.history-floor {
    color: var(--primary-light);
}

.history-steps {
    color: var(--success-color);
}

.history-result {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 5px;
    font-weight: 600;
    font-size: 0.85em;
    margin-top: 8px;
}

.history-result-excellent {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.history-result-perfect {
    background: var(--success-color);
    color: white;
}

.history-result-acceptable {
    background: var(--warning-color);
    color: white;
}

.history-result-failed {
    background: var(--danger-color);
    color: white;
}

.history-result-pending {
    background: var(--bg-light);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.history-task {
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: 30px;
    font-style: italic;
}

/* Victory Screen */
.victory-card {
    text-align: center;
    padding: 60px 30px;
    animation: victoryPop 0.6s ease;
}

@keyframes victoryPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.victory-title {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--success-color), var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.victory-text {
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: var(--text-muted);
}

.victory-stats {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-bottom: 40px;
}

.victory-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.victory-stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-light);
}

.victory-stat-label {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Loading & Error States */
.loading-state {
    text-align: center;
    padding: 100px 20px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--bg-lighter);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.error-card {
    text-align: center;
    padding: 60px 30px;
}

.error-card h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

/* Feedback Message */
.feedback-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.feedback-message.show {
    opacity: 1;
    transform: translateX(0);
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-lighter);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .difficulty-buttons {
        flex-direction: column;
    }
    
    .btn-difficulty {
        min-width: 100%;
    }
    
    .game-layout {
        flex-direction: column-reverse;
    }
    
    .tower-sidebar {
        width: 100%;
    }
    
    .tower-visual {
        position: static;
        flex-direction: column-reverse;
        height: auto;
    }
    
    .tower-progress {
        height: 180px;
    }
    
    .task-image {
        max-width: 100%;
    }
    
    .floor-labels {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .game-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .victory-stats {
        flex-direction: column;
        gap: 30px;
    }
    
    .link-container {
        flex-direction: column;
    }
    
    .props-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .timer-display {
        font-size: 3rem;
    }
    
    .timer-display.player-timer {
        font-size: 2.5rem;
    }
    
    .btn-timer {
        font-size: 1rem;
        padding: 14px 30px;
    }
}

@media (max-width: 480px) {
    .props-list {
        grid-template-columns: 1fr;
    }
}

/* Last Rating Display */
.last-rating {
    background: var(--bg-lighter);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    text-align: center;
    animation: ratingFadeIn 0.5s ease;
}

@keyframes ratingFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rating-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
}

.rating-icon.rating-excellent {
    animation: ratingSparkle 0.8s ease;
}

.rating-icon.rating-perfect {
    animation: ratingBounce 0.6s ease;
}

.rating-icon.rating-acceptable {
    animation: ratingPulse 0.6s ease;
}

.rating-icon.rating-failed {
    animation: ratingShake 0.6s ease;
}

@keyframes ratingSparkle {
    0%, 100% {
        transform: scale(1) rotate(0deg);
    }
    25% {
        transform: scale(1.15) rotate(-5deg);
    }
    50% {
        transform: scale(1.25) rotate(0deg);
    }
    75% {
        transform: scale(1.15) rotate(5deg);
    }
}

@keyframes ratingBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

@keyframes ratingPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes ratingShake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-10px);
    }
    75% {
        transform: translateX(10px);
    }
}

.rating-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-color);
}

.rating-excellent .rating-text {
    color: #8b5cf6;
}

.rating-perfect .rating-text {
    color: var(--success-color);
}

.rating-acceptable .rating-text {
    color: var(--warning-color);
}

.rating-failed .rating-text {
    color: var(--danger-color);
}

/* Timer Section */
.task-timer-section {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(79, 70, 229, 0.1));
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    text-align: center;
}

.timer-display {
    font-size: 4rem;
    font-weight: 800;
    color: var(--primary-light);
    font-family: 'Courier New', monospace;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
    transition: all 0.3s ease;
}

.timer-display.player-timer {
    font-size: 3.5rem;
}

.timer-display.timer-warning {
    color: var(--warning-color);
    animation: timerPulse 1s ease-in-out infinite;
}

.timer-display.timer-complete {
    color: var(--danger-color);
    animation: timerComplete 0.5s ease;
}

@keyframes timerPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
    }
    50% {
        transform: scale(1.05);
        text-shadow: 0 0 30px rgba(245, 158, 11, 0.8);
    }
}

@keyframes timerComplete {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.btn-timer {
    padding: 16px 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-timer:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.btn-timer:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.timer-status {
    margin-top: 15px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 1rem;
}

