.definition-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.back-link {
    display: inline-block;
    margin-bottom: 15px;
}

.definition-icon {
    width: 64px;
    height: 64px;
    border-radius: 12px;
}

.page-subtitle {
    color: #555;
    font-size: 15px;
    max-width: 480px;
    margin: 0;
    padding: 0 15px;
    text-align: center;
}

.more-link {
    color: #f5a623;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
}

.more-link:hover {
    text-decoration: underline;
}

.definition-section {
    text-align: left;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #ddd;
}

.definition-section:first-child {
    margin-top: 6px;
    padding-top: 8px;
}

.definition-section h2 {
    font-size: 24px;
    margin: 0 0 6px;
}

.definition-section h3 {
    margin: 12px 0 4px;
}

.definition-section ul {
    margin: 0 0 4px;
}

.definition-section li {
    margin-bottom: 2px;
}

.tagline {
    font-style: italic;
    color: gray;
    font-size: 16px;
}

.definition-example {
    text-align: center;
    margin-top: 6px;
}

.definition-example img {
    max-width: 200px;
    max-height: 150px;
    object-fit: contain;
    border-radius: 5px;
}

.definition-example video {
    max-width: 280px;
}

.example-caption {
    font-weight: bold;
    margin: 6px 0 0;
}

.header-row {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding: 10px 15px;
    min-height: 135px;
}

.controls-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-page-button {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f5a623;
    color: white;
    border: none;
    border-radius: 999px;
    padding: 10px 18px;
    font-size: 16px;
    font-weight: bold;
    font-family: inherit;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.45);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.share-page-button:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(245, 166, 35, 0.55);
}

.share-page-button:active {
    transform: scale(0.96);
}

.title-block {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.page-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 56px;
    font-weight: bold;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    color: inherit;
    font-family: inherit;
    white-space: nowrap;
}

.page-title #page-title-text {
    text-decoration: underline dotted;
    text-decoration-color: silver;
    text-underline-offset: 4px;
}

.page-title .info-link {
    width: 46px;
    height: 46px;
    margin-right: 0;
    border-radius: 50%;
    transition: transform 0.15s ease;
}

.page-title:hover .info-link {
    transform: scale(1.12);
}

.definition-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.definition-overlay[hidden] {
    display: none;
}

.definition-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.definition-modal {
    position: relative;
    background: white;
    width: min(680px, 92vw);
    height: min(85vh, 900px);
    border-radius: 14px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.definition-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    font-size: 17px;
    line-height: 1;
    color: #555;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.definition-close:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
}

.definition-close:active {
    transform: scale(0.96);
}

.definition-frame {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 900px) {
    .header-row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "title share"
            "controls controls";
        align-items: center;
        gap: 10px;
        min-height: 0;
    }

    .controls-stack {
        grid-area: controls;
        align-items: center;
        justify-self: center;
    }

    .title-block {
        grid-area: title;
        position: static;
        transform: none;
        justify-self: center;
    }

    .page-title {
        font-size: 32px;
    }

    .page-title .info-link {
        width: 28px;
        height: 28px;
    }

    .page-subtitle {
        font-size: 12px;
    }

    .share-page-button {
        grid-area: share;
        justify-self: end;
        margin-left: 0;
        padding: 6px 12px;
        font-size: 13px;
    }
}
