.edit-game-page {
    padding-top: 18px;
}

.edit-game-container {
    max-width: 1320px;
}

.edit-game-form {
    display: grid;
    gap: 28px;
}

.edit-game-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: stretch;
    padding: clamp(28px, 4vw, 46px);
    border: 1px solid #dde2f0;
    border-radius: 36px;
    background:
        radial-gradient(circle at 12% 18%, rgba(129, 124, 197, 0.18), transparent 32%),
        radial-gradient(circle at 92% 8%, rgba(196, 232, 219, 0.45), transparent 34%),
        linear-gradient(135deg, #ffffff 0%, #f7f8ff 100%);
    box-shadow: 0 24px 70px rgba(55, 61, 90, 0.1);
    overflow: hidden;
}

.edit-game-hero-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    min-width: 0;
}

.edit-game-return-link,
.edit-game-kicker,
.edit-game-hero-meta span,
.edit-game-sidebar-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border-radius: 999px;
    background: #ececf9;
    color: #615da2;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
}

.edit-game-return-link {
    margin-bottom: 16px;
    padding: 10px 15px;
    text-decoration: none;
    transition: transform 0.18s ease, background 0.18s ease;
}

.edit-game-return-link:hover {
    background: #e3e3f6;
    transform: translateY(-1px);
}

.edit-game-kicker,
.edit-game-sidebar-kicker {
    margin-bottom: 12px;
    padding: 8px 13px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.edit-game-hero h1 {
    margin: 0;
    max-width: 780px;
    color: #202232;
    font-size: clamp(3rem, 7vw, 5.6rem);
    line-height: 0.94;
    letter-spacing: -0.065em;
}

.edit-game-hero p {
    margin: 20px 0 0;
    max-width: 700px;
    color: #697089;
    font-size: 1.08rem;
    line-height: 1.65;
}

.edit-game-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.edit-game-hero-meta span {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid #dfe2f0;
    box-shadow: 0 10px 24px rgba(55, 61, 90, 0.06);
}

.edit-game-preview-card {
    display: grid;
    align-content: start;
    gap: 14px;
    min-width: 0;
    padding: 18px;
    border: 1px solid #dde2f0;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 20px 44px rgba(55, 61, 90, 0.08);
}

.edit-game-preview-card > span {
    color: #697089;
    font-weight: 800;
}

.edit-game-preview-card p {
    margin: 0;
    color: #697089;
    font-size: 0.95rem;
    line-height: 1.5;
}

.edit-game-image-preview {
    display: grid;
    place-items: center;
    min-height: 220px;
    overflow: hidden;
    border: 1px solid #dde2f0;
    border-radius: 24px;
    background: linear-gradient(135deg, #f5f6fc 0%, #ffffff 100%);
}

.edit-game-image-preview img {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
}

.edit-game-image-placeholder {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 30px;
    background: linear-gradient(135deg, #817cc5, #a09bdc);
    color: #ffffff;
    font-size: 2rem;
    font-weight: 900;
    box-shadow: 0 16px 30px rgba(129, 124, 197, 0.3);
}

.edit-game-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
}

.edit-game-main,
.edit-game-stack,
.edit-game-step-list,
.edit-game-sidebar {
    display: grid;
    gap: 18px;
}

.edit-game-panel,
.edit-game-sidebar-card {
    border: 1px solid #dde2f0;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 20px 54px rgba(55, 61, 90, 0.08);
}

.edit-game-panel {
    padding: clamp(22px, 3vw, 34px);
    border-radius: 30px;
}

.edit-game-panel-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.edit-game-panel-heading > span {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, #817cc5, #a09bdc);
    color: #ffffff;
    font-size: 0.95rem;
    font-weight: 900;
    box-shadow: 0 12px 24px rgba(129, 124, 197, 0.22);
}

.edit-game-panel-heading h2 {
    margin: 0;
    color: #202232;
    font-size: clamp(1.5rem, 3vw, 2.15rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.edit-game-panel-heading p {
    margin: 7px 0 0;
    max-width: 760px;
    color: #697089;
    line-height: 1.55;
}

.edit-game-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 22px;
}

.edit-game-field {
    display: block;
    min-width: 0;
}

.edit-game-field-full {
    grid-column: 1 / -1;
}

.edit-game-field label {
    display: block;
    margin-bottom: 9px;
    color: #242638;
    font-size: 0.96rem;
    font-weight: 850;
}

.edit-game-field small {
    display: block;
    margin-top: 8px;
    color: #697089;
    font-size: 0.91rem;
    line-height: 1.45;
}

.edit-game-field input,
.edit-game-field select,
.edit-game-field textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d8deee;
    border-radius: 20px;
    background: #f7f8fc;
    color: #242638;
    font-family: inherit;
    font-size: 1rem;
    padding: 15px 17px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.edit-game-form textarea {
    font-family: inherit;
}

.edit-game-field input,
.edit-game-field select {
    min-height: 58px;
}

.edit-game-field textarea {
    min-height: 126px;
    resize: vertical;
    line-height: 1.55;
}

#id_description,
#id_description_fr,
#id_learning_goal,
#id_setup_instructions,
#id_play_instructions {
    min-height: 150px;
}

.edit-game-field input:focus,
.edit-game-field select:focus,
.edit-game-field textarea:focus {
    outline: none;
    border-color: #817cc5;
    background: #ffffff;
    box-shadow: 0 0 0 5px rgba(129, 124, 197, 0.14);
}

.edit-game-errors {
    margin-top: 8px;
    padding: 10px 12px;
    border: 1px solid #f2c4c7;
    border-radius: 14px;
    background: #fff0f1;
    color: #a33a45;
    font-size: 0.92rem;
    line-height: 1.45;
}

.edit-game-errors-global {
    margin-bottom: -10px;
}

.edit-game-checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
}

.edit-game-checkbox-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid #dde2f0;
    border-radius: 18px;
    background: #f7f8fc;
    transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.edit-game-checkbox-item:has(input:checked) {
    border-color: rgba(129, 124, 197, 0.55);
    background: linear-gradient(135deg, rgba(129, 124, 197, 0.12), rgba(255, 255, 255, 0.9));
}

.edit-game-checkbox-item:hover {
    transform: translateY(-1px);
}

.edit-game-checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #817cc5;
}

.edit-game-checkbox-item label {
    margin: 0;
    color: #35384f;
    font-weight: 800;
    cursor: pointer;
}

.edit-game-step-card {
    padding: 18px;
    border: 1px solid #dde2f0;
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(129, 124, 197, 0.12), transparent 30%),
        #ffffff;
}

.edit-game-step-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e8f4;
}

.edit-game-step-banner strong {
    color: #242638;
    font-size: 1.04rem;
}

.edit-game-step-banner span {
    padding: 7px 11px;
    border-radius: 999px;
    background: #ececf9;
    color: #615da2;
    font-size: 0.82rem;
    font-weight: 800;
}

.edit-game-step-meta {
    display: grid;
    grid-template-columns: 0.7fr 1fr 0.85fr;
    gap: 14px;
    margin-bottom: 16px;
}

.edit-game-step-content {
    gap: 14px;
}

.edit-game-delete-step {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 14px;
    padding: 10px 13px;
    border-radius: 999px;
    background: #f4f4fa;
    color: #697089;
    font-weight: 800;
    cursor: pointer;
}

.edit-game-delete-step input {
    width: 17px;
    height: 17px;
    accent-color: #817cc5;
}

.edit-game-sidebar {
    position: static;
    gap: 18px;
    padding-bottom: 0;
}

.edit-game-sidebar-card {
    padding: 22px;
    border-radius: 28px;
}

.edit-game-quality-card {
    padding-bottom: 24px;
}

.edit-game-save-card h2 {
    margin: 0 0 8px;
    color: #202232;
    font-size: 1.45rem;
    letter-spacing: -0.03em;
}

.edit-game-save-card p {
    margin: 0 0 14px;
    color: #697089;
    line-height: 1.5;
}

.edit-game-save,
.edit-game-back {
    min-height: 54px;
    padding: 0 24px;
    border-radius: 999px;
    font-weight: 850;
    font-size: 1rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
    box-sizing: border-box;
    cursor: pointer;
}

.edit-game-save {
    width: 100%;
    border: 0;
    color: #ffffff;
    background: linear-gradient(135deg, #817cc5, #6f6acb);
    box-shadow: 0 14px 26px rgba(111, 106, 203, 0.28);
}

.edit-game-back {
    width: 100%;
    margin-top: 8px;
    border: 0;
    background: #ececf5;
    color: #5c5f8a;
}

.edit-game-save:hover,
.edit-game-back:hover {
    transform: translateY(-1px);
}

.edit-game-save:hover {
    box-shadow: 0 18px 32px rgba(111, 106, 203, 0.35);
}

.edit-game-back:hover {
    background: #e2e3f1;
}

.edit-game-jump-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 14px;
    color: #5c5f8a;
    font-weight: 800;
    text-decoration: none;
}

.edit-game-jump-list a:hover {
    background: #f0f1fa;
    color: #4f4a9d;
}

.edit-game-quality-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 11px 0;
    border-bottom: 1px solid #e5e8f4;
}

.edit-game-quality-row:last-child {
    border-bottom: 0;
    padding-bottom: 4px;
}

.edit-game-quality-row span {
    color: #697089;
    font-weight: 750;
}

.edit-game-quality-row strong {
    color: #202232;
    font-size: 1.15rem;
}

.edit-game-visual-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.edit-game-visual-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 132px;
    height: 132px;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(217, 106, 142, 0.12), transparent 40%),
        radial-gradient(circle at bottom left, rgba(106, 143, 212, 0.12), transparent 40%),
        linear-gradient(180deg, #fafbff 0%, #f1f3fb 100%);
    border: 1px dashed rgba(124, 121, 184, 0.32);
    overflow: hidden;
    font-size: 2.4rem;
}

.edit-game-visual-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #ffffff;
}

.edit-game-visual-input {
    display: grid;
    gap: 6px;
    min-width: 0;
}

@media (max-width: 640px) {
    .edit-game-visual-row {
        grid-template-columns: 1fr;
    }

    .edit-game-visual-thumb {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 1120px) {
    .edit-game-hero,
    .edit-game-workspace {
        grid-template-columns: 1fr;
    }

    .edit-game-preview-card {
        max-width: 520px;
    }

    .edit-game-sidebar {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .edit-game-save-card {
        grid-column: 1 / -1;
    }

    .edit-game-save-card .edit-game-save,
    .edit-game-save-card .edit-game-back {
        width: auto;
    }

    .edit-game-save-card .edit-game-back {
        margin-top: 0;
        margin-left: 10px;
    }

}

@media (max-width: 860px) {
    .edit-game-sidebar {
        grid-template-columns: 1fr;
    }

    .edit-game-grid,
    .edit-game-step-meta,
    .edit-game-step-content {
        grid-template-columns: 1fr;
    }

    .edit-game-field-full {
        grid-column: auto;
    }

    .edit-game-panel-heading {
        flex-direction: column;
    }
}

@media (max-width: 640px) {
    .edit-game-page {
        padding-top: 8px;
    }

    .edit-game-hero,
    .edit-game-panel,
    .edit-game-sidebar-card {
        border-radius: 24px;
    }

    .edit-game-hero h1 {
        font-size: clamp(2.6rem, 15vw, 4rem);
    }

    .edit-game-step-banner {
        align-items: flex-start;
        flex-direction: column;
    }

    .edit-game-save-card {
        align-items: stretch;
        flex-direction: column;
    }

    .edit-game-save-card .edit-game-save,
    .edit-game-save-card .edit-game-back {
        width: 100%;
        margin-left: 0;
    }
}

/* --- Language versions section --------------------------------------- */

.edit-game-translation-list {
    display: grid;
    gap: 22px;
}

.edit-game-translation-card {
    position: relative;
    padding: 22px clamp(20px, 2.4vw, 28px) 24px;
    border: 1px solid #dde2f0;
    border-radius: 26px;
    background:
        radial-gradient(circle at 100% 0%, rgba(129, 124, 197, 0.08), transparent 38%),
        #ffffff;
    box-shadow: 0 14px 36px rgba(55, 61, 90, 0.06);
}

.edit-game-translation-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 6px;
    border-radius: 26px 26px 0 0;
    background: linear-gradient(90deg, #817cc5, #c4e8db);
    opacity: 0.85;
}

.edit-game-translation-card-new {
    background:
        repeating-linear-gradient(135deg, rgba(129, 124, 197, 0.04) 0 12px, transparent 12px 24px),
        #ffffff;
    border-style: dashed;
    border-color: rgba(129, 124, 197, 0.5);
}

.edit-game-translation-card-new::before {
    background: linear-gradient(90deg, rgba(129, 124, 197, 0.55), rgba(196, 232, 219, 0.55));
}

.edit-game-translation-list .edit-game-translation-card + .edit-game-translation-card {
    margin-top: 4px;
}

.edit-game-translation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e8f4;
}

.edit-game-translation-headline {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.edit-game-translation-flag {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 18px;
    background: linear-gradient(135deg, #ececf9, #f6f7fd);
    border: 1px solid #dde2f0;
    font-size: 1.8rem;
    line-height: 1;
    flex: 0 0 auto;
}

.edit-game-translation-title-group {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.edit-game-translation-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ececf9;
    color: #615da2;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.edit-game-translation-title {
    color: #202232;
    font-size: 1.25rem;
    font-weight: 850;
    letter-spacing: -0.01em;
}

.edit-game-delete-translation {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: 999px;
    background: #f4f4fa;
    color: #697089;
    font-weight: 800;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
}

.edit-game-delete-translation:hover {
    background: #ffe3e6;
    color: #a33a45;
}

.edit-game-delete-translation input {
    width: 17px;
    height: 17px;
    accent-color: #d96a8e;
}

.edit-game-translation-language-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border-radius: 16px;
    background: #f7f8fc;
    border: 1px solid #e5e8f4;
}

.edit-game-translation-language-row label {
    margin: 0;
    color: #4f4a7d;
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: 0.01em;
}

.edit-game-translation-language-row select {
    border: 1px solid #d8deee;
    border-radius: 12px;
    background: #ffffff;
    color: #242638;
    font-family: inherit;
    font-size: 0.96rem;
    padding: 9px 12px;
    min-width: 180px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.edit-game-translation-language-row select:focus {
    outline: none;
    border-color: #817cc5;
    box-shadow: 0 0 0 4px rgba(129, 124, 197, 0.18);
}

.edit-game-translate-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 10px 16px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #817cc5, #6f6acb);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.92rem;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(111, 106, 203, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    font-family: inherit;
}

.edit-game-translate-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 14px 26px rgba(111, 106, 203, 0.28);
}

.edit-game-translate-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    box-shadow: none;
}

.edit-game-translate-button-icon {
    font-size: 1rem;
    line-height: 1;
}

.edit-game-translate-status {
    flex-basis: 100%;
    margin-top: 6px;
    font-size: 0.88rem;
    color: #697089;
}

.edit-game-translate-status.is-success {
    color: #2e7d57;
}

.edit-game-translate-status.is-error {
    color: #a33a45;
}

.edit-game-translation-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 6px;
    border: 1px solid rgba(129, 124, 197, 0.3);
    border-radius: 22px;
    background:
        radial-gradient(circle at 0% 0%, rgba(129, 124, 197, 0.16), transparent 55%),
        linear-gradient(135deg, #fbfbff 0%, #f4f3fb 100%);
}

.edit-game-translation-banner-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #817cc5, #a09bdc);
    color: #ffffff;
    font-size: 1.3rem;
    flex: 0 0 auto;
    box-shadow: 0 8px 18px rgba(129, 124, 197, 0.28);
}

.edit-game-translation-banner-copy strong {
    display: block;
    color: #202232;
    font-size: 1.02rem;
    margin-bottom: 2px;
}

.edit-game-translation-banner-copy p {
    margin: 0;
    color: #5c5f8a;
    font-size: 0.94rem;
    line-height: 1.5;
}

.edit-game-form-hint {
    margin: 4px 0 0;
    color: #697089;
    font-size: 0.94rem;
    line-height: 1.55;
}

/* --- Per-step translation editor ------------------------------------- */

.edit-game-step-translations {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px dashed #d8deee;
    display: grid;
    gap: 20px;
}

.edit-game-step-translations h3 {
    margin: 0;
    color: #202232;
    font-size: 1.3rem;
    letter-spacing: -0.01em;
}

.edit-game-step-translations > p {
    margin: -6px 0 0;
    color: #697089;
    line-height: 1.55;
}

.edit-game-step-translation-block {
    padding: 18px 20px 20px;
    border: 1px solid #dde2f0;
    border-radius: 22px;
    background: #ffffff;
    display: grid;
    gap: 14px;
}

.edit-game-step-translation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eef0f8;
    color: #242638;
    font-size: 1rem;
}

.edit-game-step-icon {
    padding: 4px 10px;
    border-radius: 999px;
    background: #ececf9;
    color: #615da2;
    font-size: 0.78rem;
    font-weight: 800;
}

.edit-game-step-translation-rows {
    display: grid;
    gap: 14px;
}

.edit-game-step-translation-row {
    padding: 14px;
    border: 1px solid #e5e8f4;
    border-radius: 18px;
    background: #f7f8fc;
}

.edit-game-step-translation-grid {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 14px 18px;
    align-items: start;
}

.edit-game-step-translation-grid .edit-game-field-full {
    grid-column: 1 / -1;
}

@media (max-width: 720px) {
    .edit-game-step-translation-grid {
        grid-template-columns: 1fr;
    }

    .edit-game-translation-card {
        padding: 20px 18px 22px;
    }

    .edit-game-translation-flag {
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }

    .edit-game-translation-title {
        font-size: 1.1rem;
    }
}
