:root {
    --primary-purple: #46178f;
    --primary-blue: #45a3e5;
    --kp-red: #ff3355;
    --kp-blue: #45a3e5;
    --kp-yellow: #ffc00a;
    --kp-green: #66bf39;
    --bg-color: #f2f2f2;
    --text-color: #333;
    --card-bg: rgba(255, 255, 255, 0.95);
    --font-main: 'Montserrat', sans-serif;
    --radius-soft: 16px;
    --radius-pill: 50px;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border_box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--primary-purple);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 20%);
    backdrop-filter: blur(10px);
}

.main-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: var(--radius-soft);
    box-shadow: var(--shadow-soft);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.logo {
    font-weight: 900;
    font-size: 2.8rem;
    margin-bottom: 2rem;
    color: var(--primary-purple);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

input {
    width: 100%;
    padding: 15px;
    margin: 12px 0;
    border: 2px solid #e0e0e0;
    border-radius: var(--radius-pill);
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

input:focus {
    border-color: var(--primary-purple);
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(70, 23, 143, 0.1);
    outline: none;
}

button {
    width: 100%;
    padding: 15px;
    margin-top: 15px;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-3px);
    filter: brightness(110%);
}

button:active {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--text-color);
    color: #fff;
    box-shadow: 0 6px 0 #1a1a1a;
}

.btn-primary:active {
    box-shadow: 0 2px 0 #1a1a1a;
}

.btn-secondary {
    background-color: var(--primary-blue);
    color: #fff;
    box-shadow: 0 6px 0 #2a7ab0;
}

.btn-secondary:active {
    box-shadow: 0 2px 0 #2a7ab0;
}

.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toggle-link {
    display: block;
    margin-top: 20px;
    color: var(--primary-purple);
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.toggle-link:hover {
    color: var(--kp-blue);
    text-decoration: underline;
}

/* Shapes for Game */
.shape-btn {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    transition: transform 0.1s;
}

.shape-btn:active {
    transform: scale(0.95);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.bg-red {
    background-color: var(--kp-red);
}

.bg-blue {
    background-color: var(--kp-blue);
}

.bg-yellow {
    background-color: var(--kp-yellow);
}

.bg-green {
    background-color: var(--kp-green);
}

/* Utility */
.fs-large {
    font-size: 3rem;
    font-weight: 900;
}

.text-white {
    color: #fff;
}

.w-100 {
    width: 100%;
}

.h-100 {
    height: 100%;
}


/* Modern Dashboard & Editor Additions */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    flex: 1;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.stat-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-purple);
}

.stat-label {
    font-size: 0.9rem;
    color: #666;
    font-weight: 600;
}

.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.quiz-card-modern {
    background: white;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.quiz-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.quiz-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--kp-red), var(--kp-blue), var(--kp-yellow), var(--kp-green));
}

.qc-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
    color: #333;
}

.qc-meta {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 20px;
}

.qc-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.qc-btn {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.qc-play {
    background: var(--kp-green);
    color: white;
}

.qc-edit {
    background: var(--kp-blue);
    color: white;
}

.qc-del {
    background: #fee;
    color: var(--kp-red);
}

.qc-del:hover {
    background: var(--kp-red);
    color: white;
}

/* Editor Specifics */
.editor-header {
    background: white;
    padding: 20px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
}

.editor-input-group {
    margin-bottom: 15px;
    text-align: left;
}

.editor-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.editor-field {
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
}

.editor-field:focus {
    border-color: var(--primary-purple);
    outline: none;
}

.question-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.q-card-edit {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.q-preview {
    display: flex;
    align-items: center;
    gap: 15px;
}

.q-num {
    background: #f0f0f0;
    color: #333;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}

/* Modern Form for New Question */
.new-q-form {
    background: white;
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-top: 30px;
}

.ans-input-wrapper {
    position: relative;
    padding: 40px 20px 20px;
    /* Space for radio top-right */
    border-radius: 8px;
    transition: transform 0.2s;
}

.ans-input-wrapper:focus-within {
    transform: scale(1.02);
    z-index: 2;
}

.ans-radio {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 25px;
    height: 25px;
    cursor: pointer;
    accent-color: white;
}

.ans-field {
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    padding: 10px;
    border-radius: 4px;
    font-weight: 700;
    color: #333 !important;
    /* Force readable text */
}

/* Fix text colors and backgrounds */
.bg-red .ans-radio {
    accent-color: white;
}