/* --- M3 DESIGN TOKENS --- */
:root {
    /* Barevná paleta: Jemná růžová (Dusty Rose) */
    --md-sys-color-primary: #9c4146;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #ffdadb;
    --md-sys-color-on-primary-container: #40000a;
    
    --md-sys-color-surface: #fff8f6;
    --md-sys-color-surface-container: #fceae9; /* Barva karet */
    --md-sys-color-on-surface: #231919;
    --md-sys-color-on-surface-variant: #534344;
    
    --md-elevation-level-3: 0px 4px 8px 3px rgba(0, 0, 0, 0.1);
    
    /* Tvary */
    --shape-corner-medium: 16px;
    --shape-corner-large: 28px;
    --shape-corner-full: 100px;
}

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

body {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- HORNÍ LIŠTA --- */
.top-bar {
    width: 100%;
    max-width: 1200px;
    padding: 64px 24px 40px;
    text-align: center;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
    color: var(--md-sys-color-primary);
}

.icon-logo { font-size: 32px; }

h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: var(--md-sys-color-on-surface);
}

.subtitle {
    font-size: 1rem;
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 400;
}

/* --- MŘÍŽKA --- */
main {
    width: 100%;
    max-width: 1000px;
    padding: 0 24px 60px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* --- KARTA --- */
.card {
    background-color: var(--md-sys-color-surface-container);
    border-radius: var(--shape-corner-medium);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.0, 0, 1.0);
    border: 1px solid transparent;
}

.card:hover {
    background-color: var(--md-sys-color-primary-container);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.card:active {
    transform: scale(0.98);
}

.card-icon {
    font-size: 40px;
    color: var(--md-sys-color-primary);
}

.card-title {
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--md-sys-color-on-surface);
    text-align: center;
}

/* --- DIALOG (MODAL) --- */
.dialog-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.dialog-overlay.open { display: flex; opacity: 1; }

.dialog {
    background-color: var(--md-sys-color-surface);
    width: 90%;
    max-width: 400px;
    border-radius: var(--shape-corner-large);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: var(--md-elevation-level-3);
    transform: scale(0.9);
    transition: transform 0.2s cubic-bezier(0.2, 0.0, 0, 1.0);
}

.dialog-overlay.open .dialog { transform: scale(1); }

.dialog-icon-area {
    margin-bottom: 16px;
    color: var(--md-sys-color-primary);
}
.dialog-icon-area span { font-size: 32px; }

.dialog-headline {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--md-sys-color-on-surface);
    margin-bottom: 16px;
}

.dialog-content {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 24px;
    text-align: left;
    width: 100%;
    max-height: 50vh;
    overflow-y: auto;
    white-space: pre-wrap;
}

/* --- TLAČÍTKA --- */
.dialog-actions {
    display: flex;
    width: 100%;
    justify-content: flex-end;
    gap: 8px;
}

button {
    border: none;
    background: none;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 10px 24px;
    border-radius: var(--shape-corner-full);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-text {
    color: var(--md-sys-color-primary);
}
.btn-text:hover {
    background-color: var(--md-sys-color-surface-container);
}

.btn-tonal {
    background-color: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
}
.btn-tonal:hover {
    filter: brightness(0.95);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}