:root {
    --bg: #f6f7fb;
    --card: #ffffff;
    --muted: #4b5563;
    --accent: #6b21a8;
    --success: #16a34a;
    --danger: #dc2626;
    --border: #e6e9ef;
    --radius: 12px;
    --card-max-width: 900px;
    --card-min-height: 400px;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

html, body {
    height: 100%;
    margin: 0;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body {
    background: var(--bg);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 0;
    color: #111827;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.content-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--card-max-width);
    margin: 0 auto 0;
    padding: 5px 20px 5px 20px;
    box-sizing: border-box;
}

.card {
    position: relative;
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 5px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    height: 83vh;
    min-height: var(--card-min-height);
    max-height: 83vh;
    overflow-y: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    order: 1;
}



/* Custom Scrollbar Styles */
.card::-webkit-scrollbar {
    width: 8px;
}

.card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.card::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 10px;
}

.card::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.card-content {
    padding: 10px 32px 32px 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    min-height: min-content;
}

.card-content h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.1;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-content h2 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.card-content p {
    color: var(--muted);
    font-weight: 500;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

p.lead {
    font-size: 1.125rem;
    width: 90%;
    max-width: 800px;
    margin-top: 0;
    margin-bottom: 0.75rem;
    margin-left: auto;
    margin-right: auto;
}

/* Common Task Elements - Ensuring centering */
.card-content > *:not(h1):not(.lead) {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* Global Input Group Styling */
.input-group-parent {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px 0;
}

.input-group-left {
    width: 320px;
    flex-shrink: 0;
    text-align: left;
    padding-top: 10px;
}

.input-group-right {
    flex: 0 1 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

/* Vertical / Compact Form Styling */
.vertical-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 450px;
    margin: 0.5rem auto 0;
    width: 100%;
}

.horizontal-form {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 0.75rem auto;
    width: 100%;
    max-width: 600px;
}

.horizontal-form label {
    font-weight: 700;
    color: var(--foreground);
    white-space: nowrap;
    font-size: 0.95rem;
}

.horizontal-form input {
    max-width: 300px;
    margin-bottom: 0 !important;
}

.vertical-form .input-group {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    text-align: left;
}

.vertical-form label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--foreground);
    padding-left: 4px;
}

/* Global Form & Input Styling */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
    padding: 10px 12px;
    font-size: 15px;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    outline: none;
    transition: all 0.2s ease;
    background-color: white;
    width: 100%;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #9fb7ff;
    box-shadow: 0 4px 12px rgba(60, 120, 255, 0.08);
}

.input-group-right input, 
.input-group-right select {
    max-width: 300px;
}

/* Global Button Styling for Tasks */
.card-content button:not(.nav-btn):not(.tasks-overview-btn) {
    padding: 10px 20px;
    font-size: 1rem;
    color: #fff;
    background-color: var(--accent);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.card-content button:not(.nav-btn):not(.tasks-overview-btn):hover {
    background-color: #5a35a8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 33, 168, 0.2);
}

.card-content button:not(.nav-btn):not(.tasks-overview-btn):active {
    transform: translateY(0);
}

.card-content button:disabled,
.card-content button:not(.nav-btn):not(.tasks-overview-btn):disabled {
    background-color: #e2e8f0;
    color: #94a3b8;
    border: 1px solid #cbd5e1;
    cursor: not-allowed;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.7;
    pointer-events: none;
}

/* Standardized Data Table Styling */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 1rem 0;
}

.data-table {
    width: 100%;
    margin: 1rem auto;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.data-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding: 10px 16px;
    text-align: center;
    border-bottom: 2px solid #f1f5f9;
}

.data-table td {
    padding: 10px 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.95rem;
    color: #1e293b;
    font-weight: 500;
    vertical-align: middle;
    text-align: center;
}

.data-table tr:hover td {
    background-color: #f8fafc;
}

/* Compact variation for small summary tables */
.data-table.compact {
    max-width: 600px;
    width: auto;
    min-width: 300px;
}

.data-table th.sortable {
    cursor: pointer;
    position: relative;
    padding-right: 30px;
}

.data-table th.sortable::after {
    content: '↕';
    position: absolute;
    right: 12px;
    opacity: 0.5;
    font-size: 0.8rem;
}

.field-chip {
    background: #f5f3ff;
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.8rem;
    display: inline-block;
    border: 1px solid #ddd6fe;
}

/* Interactive Elements */
.iframe-container {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 2rem 0;
}

.iframe-container iframe {
    border: 2px solid var(--border);
    border-radius: 8px;
    background: white;
}

.draggable {
    background: var(--accent);
    color: white;
    padding: 15px;
    border-radius: 8px;
    cursor: move;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.draggable:active {
    transform: scale(1.05);
}

.dropzone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    background: #f8fafc;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.dropzone.hover {
    background: #e0e7ff;
    border-color: var(--accent);
}

/* Drag and Drop Styling */
.container-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin: 2.5rem auto;
    width: 100%;
}

.container {
    width: 200px;
    height: 200px;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    transition: all 0.3s ease;
    color: #64748b;
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    text-align: center;
}

.draggable {
    width: 140px;
    height: 140px;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    user-select: none;
}

.draggable:active {
    cursor: grabbing;
    transform: scale(0.95);
}

/* Common Drag and Drop Layout */
.drag-container {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin: 2.5rem auto;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

.drop-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2.5rem auto;
    align-items: center;
    width: 100%;
}

.dropzone, .drop-zone {
    width: 300px;
    height: 300px;
    border: 3px dashed #cbd5e1;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #94a3b8;
    font-weight: 600;
    text-align: center;
    padding: 10px;
    box-sizing: border-box;
}

.dropzone.over, .drop-zone.over {
    border-color: var(--accent);
    background: #f5f3ff;
    transform: scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.draggable-img {
    width: 240px;
    height: auto;
    border-radius: 16px;
    cursor: grab;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 4px solid white;
}

.draggable-img:active {
    cursor: grabbing;
    transform: scale(0.98);
}

.drag-drop-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
    margin: 2.5rem auto;
    align-items: center;
    width: 100%;
}

.drag-drop-images img {
    cursor: grab;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 4px solid white;
    background: white;
}

.drag-drop-images img:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.drag-drop-images img:active {
    cursor: grabbing;
    transform: scale(0.98);
}

/* Whiteboard Component Styling */
#whiteboard {
    width: 100%;
    max-width: 600px;
    height: 300px;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 20px;
    margin: 2rem auto;
    display: block;
    cursor: crosshair;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    touch-action: none;
}

/* Advanced Components Styling */
#signature-pad {
    width: 100%;
    max-width: 600px;
    height: 300px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    margin: 2rem auto;
    cursor: crosshair;
    display: block;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    touch-action: none;
}

/* QR Code Display */
.qr-container {
    width: 280px;
    height: 280px;
    margin: 2.5rem auto;
    background: white;
    padding: 25px;
    border-radius: 20px;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

#qr {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
}

/* Analog Clock Styling */
.clock {
    width: 260px;
    height: 260px;
    border: 12px solid #1e293b;
    border-radius: 50%;
    margin: 3rem auto;
    position: relative;
    background: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
                inset 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.clock::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-conic-gradient(from 0deg, #e2e8f0 0deg 1deg, transparent 1deg 30deg);
    border-radius: 50%;
}

.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    background: #1e293b;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    z-index: 10;
    transition: transform 0.5s cubic-bezier(0.4, 2.08, 0.55, 0.44);
}

.hour {
    width: 8px;
    height: 65px;
    margin-left: -4px;
}

.minute {
    width: 5px;
    height: 95px;
    margin-left: -2.5px;
}

.second {
    width: 2px;
    height: 110px;
    margin-left: -1px;
    background: #ef4444;
    z-index: 15;
}

.center-point {
    width: 14px;
    height: 14px;
    background: #1e293b;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 20;
    border: 2px solid white;
}

/* Geometric Shapes Styling */
.shape-button {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 25px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    box-sizing: border-box;
}

.shape-button:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.shape {
    width: 60px;
    height: 60px;
    background: var(--accent);
    transition: transform 0.3s ease;
}

.shape-button:hover .shape {
    transform: scale(1.1);
}

.circle {
    border-radius: 50%;
}

.square {
    border-radius: 8px;
}

.triangle {
    background: transparent !important;
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid var(--accent);
}

.hexagon {
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

/* Resizable Element Styling */
#resizable {
    width: 200px;
    height: 200px;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 16px;
    margin: 2.5rem auto;
    position: relative;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    min-width: 50px;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#resizable::after {
    content: 'RESIZE ME';
    font-size: 0.75rem;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: 0.1em;
}

.resize-handle {
    width: 24px;
    height: 24px;
    background: var(--accent);
    position: absolute;
    right: 0;
    bottom: 0;
    cursor: nwse-resize;
    border-bottom-right-radius: 14px;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    transition: background 0.3s ease;
}

.resize-handle:hover {
    background: #5a35a8;
}

.size-display {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    margin: 1.5rem auto;
    text-align: center;
    background: #f8fafc;
    padding: 10px 24px;
    border-radius: 50px;
    width: fit-content;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Context Menu Challenge Styling */
#target-area {
    width: 100%;
    max-width: 400px;
    height: 200px;
    background: #f8fafc;
    border: 3px dashed #cbd5e1;
    border-radius: 24px;
    margin: 2.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #94a3b8;
    cursor: context-menu;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

#target-area:hover {
    border-color: var(--accent);
    background: #f5f3ff;
    color: var(--accent);
    transform: scale(1.01);
}

#context-menu {
    position: absolute;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 1000;
    min-width: 160px;
    padding: 6px 0;
    overflow: hidden;
}

#context-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

#context-menu li {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    font-weight: 500;
    transition: all 0.2s ease;
}

#context-menu li:hover {
    background: #f1f5f9;
    color: var(--accent);
    padding-left: 20px;
}

/* Audio / Icon Button Styling */
.icon-button {
    font-size: 2.5rem;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 2.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100px;
    height: 100px;
    background: #f5f3ff;
    border-radius: 50%;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: none;
    outline: none;
}

.icon-button:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--accent);
    color: white;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.icon-button:active {
    transform: scale(0.95);
}

.label-hint {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    text-align: center;
}

/* Wheel Spinner Styling */
.wheel-container {
    position: relative;
    width: 350px;
    height: 350px;
    margin: 2.5rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15),
                0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 25px solid #ef4444;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

#spinButton {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: #1e293b;
    color: white;
    border: 4px solid white;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 20;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

#spinButton:hover {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--accent);
    box-shadow: 0 6px 15px rgba(0,0,0,0.4);
}

#spinButton:active {
    transform: translate(-50%, -50%) scale(0.95);
}

/* Game Component Styling */
#gameCanvas {
    width: 100%;
    height: 300px;
    background: #f8fafc;
    border: 3px solid #e2e8f0;
    border-radius: 24px;
    margin: 1.5rem auto;
    display: block;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.05);
}

.game-instructions {
    background: #f8fafc;
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    font-size: 0.95rem;
    color: #475569;
    text-align: center;
    border: 1.5px solid #e2e8f0;
    line-height: 1.6;
}

.key {
    background: white;
    padding: 4px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--accent);
    box-shadow: 0 3px 0 #cbd5e1;
    margin: 0 4px;
    font-size: 0.9rem;
    display: inline-block;
}

.container.dropzone {
    border-color: var(--accent);
    background: #f5f3ff;
}

/* Image Hover & Overlay Styling */
.image-container {
    position: relative;
    width: 150px;
    height: 200px;
    margin: 2rem auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    background: #f1f5f9;
}

.images-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 2.5rem auto;
    width: 100%;
    align-items: center;
}

.images-container .image-container {
    width: 120px;
    height: 80px;
    margin: 0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.images-container .image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#flagImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.image-container:hover #flagImage {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(30, 41, 59, 0.7); /* Slate-800 with opacity */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

.image-overlay a {
    color: white !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 8px 16px;
    border: 2px solid white;
    border-radius: 6px;
    transition: all 0.2s;
    text-align: center;
}

.image-overlay a:hover {
    background: white;
    color: var(--accent) !important;
}

/* Rubik's Cube Styling */
#rubiks-cube {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 8px;
    margin: 2rem auto;
    width: fit-content;
    padding: 12px;
    background: #0f172a; /* Slate-900 */
    border-radius: 16px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.block {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.1);
}

.block:hover {
    transform: scale(0.96);
    filter: brightness(1.1);
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}

.block:active {
    transform: scale(0.9);
}

/* Iframe Styling */
.iframe-container {
    width: 100%;
    max-width: 600px;
    height: 150px;
    margin: 2rem auto;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    background: #f8fafc;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

#button-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* Item List / Chip Styling */
.item-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 0;
    list-style: none;
    margin: 2rem auto;
    width: 100%;
}

.item {
    background: #f8fafc;
    color: #475569;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1.5px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.item:hover {
    background: white;
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Scrollable Content (Terms & Conditions) */
.terms {
    height: 200px;
    overflow-y: scroll;
    padding: 1.25rem;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    background: #f8fafc;
    margin: 1rem auto;
    width: 100%;
    max-width: 600px;
    text-align: left;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.terms h2 {
    font-size: 1.1rem;
    color: var(--accent);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.terms h2:first-child {
    margin-top: 0;
}

.terms p {
    font-size: 0.95rem;
    color: #475569;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* Custom Scrollbar for .terms */
.terms::-webkit-scrollbar {
    width: 8px;
}

.terms::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.terms::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.terms::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sorting Challenges Styling (Numbers, Characters, Words) */
.number-boxes, .letter-boxes, .word-boxes, .input-boxes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin: 2.5rem auto;
    flex-wrap: wrap;
    width: 100%;
}

.number-box, .letter-box, .word-box {
    min-width: 64px;
    height: 64px;
    padding: 0 15px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.word-box {
    min-width: 130px;
}

.input-box input {
    width: 64px;
    height: 64px;
    text-align: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.word-boxes + .input-boxes .input-box input {
    width: 130px;
}

.input-box input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    outline: none;
    transform: translateY(-2px);
}

/* Progress Bar Styling */
#status {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
    text-align: center;
}

#progress-bar-container, .progress-container {
    width: 100%;
    max-width: 500px;
    height: 24px;
    background-color: #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 1.5rem auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

#progress-bar, .progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent) 0%, #a855f7 100%);
    transition: width 0.1s linear;
    border-radius: 12px;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Date Picker & Calendar Styling */
.date-picker-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
}

#calendar-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    fill: var(--accent);
    transition: transform 0.2s;
    flex-shrink: 0;
}

#calendar-icon:hover {
    transform: scale(1.1);
}

/* Dropdown & Autocomplete Styling */
.dropdown {
    position: absolute;
    background: white;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    margin-top: 5px;
}

.dropdown-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
    color: var(--foreground);
    text-align: left;
}

.dropdown-item:hover {
    background: #f1f5f9;
    color: var(--accent);
}

.dropdown-item:not(:last-child) {
    border-bottom: 1px solid #f1f5f9;
}

/* Tooltip & Rainbow Text Styling */
.rainbow-text {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(to right, #6366f1, #a855f7, #ec4899, #f43f5e, #eab308, #22c55e, #06b6d4, #6366f1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbow 3s linear infinite;
    display: inline-block;
    position: relative;
    cursor: pointer;
    padding: 10px 20px;
}

@keyframes rainbow {
    to { background-position: 200% center; }
}

.rainbow-text::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    -webkit-text-fill-color: initial;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

.rainbow-text:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip Arrow */
.rainbow-text::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    border: 8px solid transparent;
    border-top-color: #1e293b;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10;
}

.rainbow-text:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Modern Choice Selection (Radio & Checkbox) */
fieldset {
    border: none;
    padding: 0;
    margin: 0;
}

.radio-list, .checkbox-group, .radio-group {
    list-style: none;
    padding: 0;
    margin: 1.5rem auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.radio-item, .radio-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 180px;
    height: auto;
    min-height: 54px;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.radio-item:hover, .radio-list li:hover {
    background: white;
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Base Custom Input Style */
.radio-item input[type="radio"],
.radio-list li input[type="radio"],
.checkbox-group label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e1;
    margin: 0;
    cursor: pointer;
    display: grid;
    place-content: center;
    transition: all 0.2s ease;
    background-color: white;
    flex-shrink: 0;
}

/* Specific Shapes */
.radio-item input[type="radio"],
.radio-list li input[type="radio"] {
    border-radius: 50%;
}

.checkbox-group label input[type="checkbox"] {
    border-radius: 4px;
}

/* Selection Indicators */
.radio-item input[type="radio"]::before,
.radio-list li input[type="radio"]::before,
.checkbox-group label input[type="checkbox"]::before {
    content: "";
    transform: scale(0);
    transition: 120ms transform ease-in-out;
    background-color: var(--accent);
}

/* Radio Dot */
.radio-item input[type="radio"]::before,
.radio-list li input[type="radio"]::before {
    content: "";
    width: 100%;
    height: 100%;
    max-width: 10px;
    max-height: 10px;
    border-radius: 50%;
    background-color: var(--accent);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.radio-item input[type="radio"]:checked::before,
.radio-list li input[type="radio"]:checked::before {
    transform: scale(1);
}

.radio-item:has(input:checked) {
    background: #f5f3ff;
    border-color: var(--accent);
}

/* Checkbox Checkmark */
.checkbox-group label input[type="checkbox"]::before {
    content: "";
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.radio-item input[type="radio"]:checked,
.radio-list li input[type="radio"]:checked,
.checkbox-group label input[type="checkbox"]:checked {
    background-color: var(--accent);
    border-color: var(--accent);
}

/* Checkbox Checkmark (White on Purple) */
.checkbox-group label input[type="checkbox"]:checked::before {
    content: "";
    width: 12px;
    height: 12px;
    background-color: white;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(1);
}

/* Radio Circle (ensure no dot, just solid fill) */
.radio-item input[type="radio"]:checked::before {
    display: none;
}

.radio-item label, .radio-list li label, .radio-group label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--foreground);
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
}

@media (max-width: 600px) {
    .radio-item, .radio-list li {
        width: 100%;
    }
}

/* Navigation */
.card-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
    width: 100%;
    margin-bottom: 2px;
    padding-top: 0;
    order: 2;
}

.nav-btn {
    position: relative;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0f0f23 0%, #1a1a3e 100%);
    color: #00ffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 255, 255, 0.2);
    text-shadow: 0 0 8px rgba(0, 255, 255, 0.8);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-btn-prev {
    background: linear-gradient(135deg, #1a0f2e 0%, #2d1a4e 100%);
    color: #ff00ff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 0, 255, 0.2);
    text-shadow: 0 0 8px rgba(255, 0, 255, 0.8);
    clip-path: polygon(10px 0, 100% 0, 100% 100%, 10px 100%, 0 50%);
}

.nav-btn-next {
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0, 255, 255, 0.4);
}

.nav-btn-prev:hover {
    box-shadow: 0 6px 25px rgba(255, 0, 255, 0.4);
}

.nav-icon {
    font-size: 16px;
    font-weight: bold;
}

/* Standardized Validation Messages */
.message {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    margin: 1rem auto;
    width: 100%;
    max-width: 600px;
    animation: slideIn 0.3s ease-out;
    text-align: center;
    box-sizing: border-box;
}

.message.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.message.failure {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
    flex-direction: column;
    gap: 4px;
}

.message.warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fef3c7;
}

.message .detail {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 500;
    margin-top: 2px;
    display: block;
    word-break: break-all;
    overflow-wrap: anywhere;
}

@keyframes slideIn {
    from { transform: translateY(10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Odd One Out Challenge Styling */
/* Standard Odd One Out Grid */
.odd-one-out-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    justify-items: center;
    margin: 2.5rem auto;
    width: 100%;
    max-width: 500px;
}

.odd-one-out-grid button {
    width: 100%;
    min-width: 140px;
    min-height: 120px;
    padding: 20px 28px;
    border-radius: 20px;
    border: 3px solid #f0f0f0;
    background: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.odd-one-out-grid button:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: 0 20px 35px -8px rgba(0, 0, 0, 0.1);
    border-color: #4a90e2;
}

.odd-one-out-grid button:active {
    transform: translateY(-2px) scale(0.98);
}

.shape {
    width: 60px;
    height: 60px;
    background: #4a90e2;
}

.shape.circle {
    border-radius: 50%;
}

.shape.square {
    border-radius: 4px;
}

.shape.triangle {
    width: 0;
    height: 0;
    background: transparent;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 60px solid #4a90e2;
}

.shape.hexagon {
    width: 60px;
    height: 35px;
    background: #4a90e2;
    position: relative;
}

.shape.hexagon::before,
.shape.hexagon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
}

.shape.hexagon::before {
    bottom: 100%;
    border-bottom: 17.5px solid #4a90e2;
}

.shape.hexagon::after {
    top: 100%;
    border-top: 17.5px solid #4a90e2;
}

.odd-one-out-grid.text-variant button {
    font-size: 2.5rem;
    font-weight: 800;
    color: #4a90e2;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

.odd-one-out-grid.audio-variant button {
    font-size: 3rem;
    color: #4a90e2;
}

.play-icon {
    transition: transform 0.3s ease;
}

.odd-one-out-grid.audio-variant button:hover .play-icon {
    transform: scale(1.2);
}




/* Math variant: styled boxes with accent background */
.odd-one-out-grid.math-variant button {
    background: #f8fafc;
    color: #1e293b;
    border: 2px solid #e2e8f0;
    text-shadow: none;
    font-size: 1.15rem;
    font-weight: 700;
    min-width: 160px;
}

.odd-one-out-grid.math-variant button:hover {
    background: #f5f3ff;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 20px 30px -5px rgba(107, 33, 168, 0.15);
}

/* Task List Styles */
.task-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    width: 100%;
}

.task-list li {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-list li:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.task-list a {
    display: block;
    padding: 0.75rem 0.5rem;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .card-content {
        padding: 20px;
    }

    .card-content h1 {
        font-size: 1.75rem;
    }

    .task-list {
        grid-template-columns: repeat(2, 1fr);
    }

    .card-nav {
        position: fixed;
        bottom: 20px;
        left: 20px;
        right: 20px;
        background: rgba(255, 255, 255, 0.9);
        backdrop-filter: blur(10px);
        padding: 15px;
        border-radius: 12px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.15);
        z-index: 100;
        margin: 0;
    }

    .content-wrapper {
        padding-bottom: 80px;
    }
}

@media (max-width: 480px) {
    .task-list {
        grid-template-columns: 1fr;
    }
}
