body {
    margin: 0;
    padding: 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #1a1a1a;
    color: #f0f0f0;
    display: flex;
    flex-direction: column;
    align-items: center;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

header {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-align: center;
    margin-bottom: 8px;
    color: #fff;
}

.byline {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 40px;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.byline a { color: #0077cc; text-decoration: none; font-weight: 600; transition: color 0.2s; }
.byline a:hover { color: #00bbff; }

/* ===== TEAM ROW ===== */
.team-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    margin-bottom: 30px;
}

.input-group { display: flex; flex-direction: column; text-align: center; }

.input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    color: #888;
}

.input-group input {
    padding: 14px;
    font-size: 1.1rem;
    font-family: inherit;
    border-radius: 12px;
    border: 1px solid #444;
    background: #252525;
    color: white;
    text-align: center;
    width: 260px;
    transition: border-color 0.2s;
}

.input-group input:focus { outline: none; border-color: #0077cc; }

.vs { font-size: 1.2rem; font-weight: 900; color: #444; padding-top: 28px; }

/* ===== ADVANCED MODE TOGGLE ===== */
.toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    padding: 16px 24px;
    background: #252525;
    border-radius: 12px;
    border: 1px solid #333;
}

.toggle-container label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ccc;
    cursor: pointer;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #444;
    border-radius: 26px;
    transition: background 0.3s;
}

.toggle-slider:before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #0077cc;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

/* ===== COURT PANEL ===== */
.panel-container { width: 100%; display: flex; justify-content: center; margin-bottom: 30px; }

.court-panel {
    width: 90%;
    max-width: 900px;
    background: #222;
    border: 1px solid #333;
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
    gap: 20px;
}

.panel-header {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 10px;
}

#add-block-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    background-color: #0077cc;
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

#add-block-btn:hover { background-color: #0088ee; }

/* ===== START TRIAL BUTTON ===== */
.start-trial-container {
    margin-top: 20px;
}

#start-trial-btn {
    padding: 18px 48px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    background: #00aa55;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 170, 85, 0.3);
}

#start-trial-btn:hover {
    background: #00bb66;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 170, 85, 0.4);
}

/* ===== EDIT PANEL ===== */
.block-edit-panel {
    background: #2a2a2a;
    padding: 24px;
    border-radius: 20px;
    border: 1px solid #0077cc;
    margin: 8px 0 16px 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transform-origin: top;
    animation: expandPanel 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes expandPanel {
    from { opacity: 0; transform: scaleY(0.95); margin-bottom: -50px; }
    to { opacity: 1; transform: scaleY(1); margin-bottom: 16px; }
}

.block-edit-panel h3 { margin: 0; font-size: 1.1rem; color: #fff; }
.block-edit-panel.hidden { display: none; }

.edit-fields { display: flex; gap: 16px; flex-wrap: wrap; }

.edit-fields label { 
    flex: 1;
    min-width: 150px;
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    font-size: 0.75rem; 
    font-weight: 700; 
    color: #888; 
    text-transform: uppercase; 
}

.edit-fields input, 
.edit-fields select { 
    padding: 12px; 
    background: #1a1a1a; 
    border: 1px solid #444; 
    color: white; 
    border-radius: 10px; 
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
}

.edit-fields select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    padding-right: 36px;
}

.edit-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 4px; }

#save-block-btn { background: #0077cc; color: white; font-weight: 600; border: none; padding: 12px; border-radius: 8px; cursor: pointer; }
#cancel-edit-btn { background: #333; color: #999; font-weight: 600; border: none; padding: 12px; border-radius: 8px; cursor: pointer; }

/* ===== BLOCK CARDS ===== */
.block-list { width: 100%; display: flex; flex-direction: column; gap: 12px; }

.block-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2a2a2a;
    padding: 18px 24px;
    border-radius: 16px;
    border: 1px solid #333;
    cursor: grab;
    max-height: 200px;
    overflow: hidden;
    transition: 
        transform 0.2s cubic-bezier(0.2, 0, 0, 1), 
        background 0.2s, 
        opacity 0.2s,
        max-height 0.4s ease,
        margin 0.4s ease,
        padding 0.4s ease;
    animation: blockIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes blockIn {
    from { opacity: 0; transform: translateY(15px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.block-card.removing {
    transform: scale(0.9);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-color: transparent;
    pointer-events: none;
}

.block-card.dragging {
    opacity: 0.3;
    filter: grayscale(1);
}

.block-placeholder {
    border: 2px dashed #0077cc;
    background: rgba(0, 119, 204, 0.05);
    border-radius: 16px;
    height: 62px;
    width: 100%;
    pointer-events: none;
}

.block-main-content { display: flex; flex: 1; align-items: center; }
.block-main-content::before { content: "⠿"; margin-right: 18px; color: #555; font-size: 1.1rem; }

/* Remove unused team badge styles */
.link-icon { color: #00bbff; margin-right: 12px; display: flex; align-items: center; opacity: 0.8; }
.block-name { flex: 1; font-size: 1.05rem; font-weight: 600; display: flex; align-items: center; }

.block-time { 
    font-size: 1.1rem; 
    font-family: 'JetBrains Mono', monospace; 
    font-weight: 600; 
    width: 80px; 
    text-align: right; 
    margin-right: 24px; 
    color: #00bbff; 
}

.block-controls { display: flex; align-items: center; justify-content: center; }

.block-delete {
    background: transparent; border: none; color: #555;
    padding: 8px; border-radius: 8px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s;
}

.block-delete:hover { color: #ff4444; background: rgba(255, 68, 68, 0.1); }