body {
    display: grid;
    grid-template-columns: minmax(4rem, 1fr) minmax(12rem, 32rem) minmax(4rem, 1fr);
    grid-template-rows: 1rem 2rem 1rem 1fr 8rem 1fr 1rem 2rem 1rem;
}

.dm body {
    background-color: var(--oled-safe-black);
    color: white;
}

.dm .progress::-moz-progress-bar        { background: var(--cryptee-4) !important; }
.dm .progress::-webkit-progress-bar     { background: var(--cryptee-4) !important; }
.dm .progress::-webkit-progress-value   { background: var(--cryptee-4) !important; }

#logo {
    grid-row: 2 / 3;
    grid-column: 1 / 2;
    object-fit: contain;
    width: 2rem;
    height: 2rem;
    margin-left: 1rem;
    opacity: 0.3;
    user-select: none;
}

.dm #logo {
    filter: invert(1);
}

main {
    grid-row: 5/6;
    grid-column: 2/3;
    overflow: hidden;

    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
    align-content: center;
    align-items: center;

    column-gap: 3rem;
    row-gap: 0;

    opacity: 1;
    transition: 0.5s opacity var(--cryptee-cb);
}

.appButton {
    margin-top: 0;
    background-color: #FFF;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 400;
    border-radius: 0.5rem;
    width: 4rem;
    height: 4rem;
    margin-bottom: 3rem;

    box-shadow: 0 0 0 2px rgba(0,0,0,0); 
    transition: 0.3s box-shadow var(--cryptee-cb);
}

.appButton img {
    height: 1rem;
    width: 1rem;
    object-fit: contain;
    padding: 1.5rem;
    float: left;
    user-select: none;
}

.appButton > span {
    display: block;
    line-height: 1.25rem;
    width: 6rem;
    padding-top: 5rem;
    margin: 0 -1rem;
}

footer {
    grid-column: 1/-1;
    grid-row: 6/7;
    padding: 0;
    
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 1rem;
}

.actionButton {
    display: grid;
    height: 3rem;
    grid-template-columns: 3rem 1fr;
    line-height: 3.25rem;
    overflow: hidden;
    width: 20.5rem;
    background-color: #FFF;
    border-radius: 0.5rem;

    opacity: 1;
    transform: translateY(0);
    transition-property: transform, opacity;
    transition-duration: 0.5s;
    transition-timing-function: var(--cryptee-cb);
    margin: 0 auto;
}

.actionButton img {
    width: 1rem;
    padding: 1rem;
}

.actionButton[app="upgrade"] {
    display: block;
    height: 8rem;
    position: relative;
    padding: 0.5rem 1rem 1rem 1rem;
    box-sizing: border-box;
    background-image: linear-gradient(-45deg, #003399 0%, #00194d 80%);
    color: #FFF;
}

.actionButton[app="upgrade"]::before {
    content: "";
    display: block;
    background-image: url("../assets/eu-color.svg");
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 2.65rem;
    height: 2.65rem;
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    opacity: 0;
    transform: rotate(15deg);
    transition: 0.5s opacity ease, 0.5s transform ease;
}

body[region="eu"] .actionButton[app="upgrade"]::before {
    transform: rotate(0deg);
    opacity: 1;
}

#upgrade-offer-text {
    white-space: break-spaces;
}

.actionButton[app="upgrade"] strong {
    position: absolute;
    right: 1rem;
    bottom: 0.75rem;
    line-height: 1rem;   
}

.actionButton[app="install"] img {
    transform: rotate(45deg);
    filter: invert(1);
}

.dm .actionButton[app="install"] img {
    filter: invert(0);
}

.actionButton[app="upgrade"] img,
.dm .appButton img {
    filter: invert(1);
}

.dm .appButton,
.dm .actionButton {
    background-color: var(--cryptee-0);
}

.actionButton:not(.willBeShown) {
    opacity: 0 !important;
    pointer-events: none !important;
    transform: translateY(1rem);
}

.actionButton:nth-child(1) { transition-delay: 0.075s; }
.actionButton:nth-child(2) { transition-delay: 0s; }

.callout {
    color: var(--cryptee-green);
    font-weight: bold;
    opacity: 1;
}

.callout:not(.show) { opacity: 0; }

#welcome {
    grid-row: -2 / -1;
    grid-column: 2 / -1;
    margin-top: -0.5rem;
    user-select: none;
}

b { 
    grid-row: -3 / -2;
    grid-column: 2 / 3;
    background-color: black;
    height: 1px;

    transform: translateX(0);
    transition: 0.5s transform var(--cryptee-cb);
}

.dm b {
    background-color: var(--cryptee-4);
}


#displayName {
    grid-row: 8/9;
    grid-column: 1/-1;
    padding-left: 1.5rem;
    color: var(--cryptee-2);
    user-select: none;
    text-transform: lowercase;

    width: calc(100% - 2.5rem);
    text-overflow: ellipsis;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    height: 1.5rem;
}

nav {
    grid-row: 2/3;
    grid-column: 2/4;
    display: flex;
    margin-left: auto;
    margin-right: 1.5rem;
}

.menuButton {
    margin-left: 2rem;
    margin-top: 0;
    display: block;
    line-height: 2rem;

    opacity: 0.4;
    transition: 0.15s opacity linear;
    color: #000;
}

.dm .menuButton {
    color: #FFF;
}

.menuButton:first-child {
    margin-left: 0;
}




/* -----------------------------
-------------------------------- 
 
PWA INSTALL TIP 
 
--------------------------------
----------------------------- */

#tips-install-pwa {
    height: 24rem;
}

#tips-install-pwa h3 { margin-top: 0; }

#tips-install-pwa small {
    text-align: justify;
    font-size: 0.876rem !important;
    line-height: 1.25rem !important;
}

#tips-install-pwa strong { 
    position: relative;
    margin: 0.5rem 0;
    display: block; 
    width: 100%;
}

#tips-install-pwa strong:first-of-type {
    margin-top: 0;
}

#tips-install-pwa #button-why {
    width: 100%;
    height: 17rem;
    background-color: var(--cryptee-4);
    border-radius: 0.5rem;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    
    padding: 0 2rem 4.5rem 2rem;
    transform: translateY(14rem);
    transition-duration: 0.7s;
    transition-property: transform, padding;
    transition-timing-function: var(--cryptee-cb);
}

#tips-install-pwa #button-why small {
    margin-top: 0 !important;
    line-height: 3.125rem !important;
    font-size: 0.8rem !important;
    user-select: none !important;
}

#tips-install-pwa #button-why p {
    text-align: justify;
}

#tips-install-pwa #button-why.open {
    padding-top: 1rem;
    transform: translateY(0);
}


/* -----------------------------
-------------------------------- 
 
IOS 17.4 (EU) HIDE INSTALL PWA BUTTON IF WE HAVE TO
p.s. FUCK YOU APPLE. 

--------------------------------
----------------------------- */

/* body[region="eu"].ios .actionButton[app='install'] { display: none !important; } */

/* -----------------------------
-------------------------------- 
 
NEWS
 
--------------------------------
----------------------------- */

#news-card {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100%;

    z-index: 3;

    max-height: 13.75rem;
    margin-top: auto;
}

#news-card div {
    max-width: 320px;
    height: 14rem;
    margin: 0 1.5rem 0 auto; 

    transform: translateY(0);
    transition: 0.7s transform var(--cryptee-cb);
    
    box-sizing: border-box;
    padding: 1.5rem 1.5rem 1rem 1.5rem;

    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 0rem 1rem rgba(0,0,0,0.2);
    background-color: #FFF;
    color: #000;

    display: grid;
    grid-template-columns: 1fr 1rem 1.5rem;
    grid-template-rows: 1.5rem 1fr 3.25rem;
}

#news-card button.close img {
    width: 1rem;
    height: 1rem;
    padding-left: 0.5rem;
}

#news-card button.close { 
    margin: 0;
    grid-column: 3/4;
    grid-row: 1/2;
    filter: invert(1);
}

#news-card a.more { 
    display: block;
    box-sizing: border-box;
    
    grid-column: 1/4;
    grid-row: 3/4;
    margin: 0 0 0 auto;
    
    text-align: right;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    height: 2.5rem;

    transform: translateY(0.75rem) translateX(0.75rem);
    transition: 0.85s transform var(--cryptee-cb);

    border-radius: 0.5rem;
    background-color: var(--cryptee-green);
    color: #FFF;
}

#news-card a.more i {
    margin-left: 0.5rem;
    line-height: 1.5rem;
}

#news-card a.more span {
    float: left;
    line-height: 1.5rem;
}

#news-card p {
    margin-top: 0;
    grid-column: 1/-1;
    grid-row: 2/3;
    text-transform: lowercase;
}

#news-card strong {
    display: block;
    grid-column: 1/2;
    grid-row: 1/2;
    
    line-height: 1.125rem;
    height: 1.125rem;
}

body:not(.show-news) #news-card { pointer-events: none !important; }
body:not(.show-news) #news-card div { transform: translateY(16rem); }
body:not(.show-news) #news-card a.more { transform: translateY(16rem)  translateX(0.75rem); }

body.show-news .actionButton { opacity: 0; transform: translateY(1rem); }

.newsButton { cursor: pointer; }
.newsButton:not([hash]) { opacity: 0.15; pointer-events: none; }


/* -----------------------------
-------------------------------- 
 
MEDIA QUERIES 
 
--------------------------------
----------------------------- */

@media (max-width : 448px) {
    
    #news-card {
        width: calc(100% - 1rem); max-width: 320px; 
    }

    #news-card div { 
        margin: auto; 
        border-radius: 1rem 0 0 0;
    }

    main {
        grid-column: 1/-1;
    }

}

@media (max-width : 374px) {

    body {
        grid-template-rows: 1rem 2rem 1rem 1fr 8rem 1fr 1rem 2rem 1rem;
    }

    .menuButton {
        margin-left: 1rem;
    }
}

@media (max-height : 768px) {
    body.show-news main b { transform: translateX(20rem); }
    body.show-news main { opacity: 0.7; }
}






/* -----------------------------
-------------------------------- 
 
IT'S A POINTER DEVICE,
ENABLE HOVERS 
 
--------------------------------
----------------------------- */

@media (-moz-touch-enabled: 0), (pointer:fine) {

    .appButton:hover {
        box-shadow: 0 0 0 2px rgba(0,0,0,1);
    } 
    
    .appButton[app="upgrade"]:hover {
        box-shadow: 0 0 0 2px rgba(21,132,60,1);
    }

    .menuButton:hover {
        opacity: 1;
    }

}



/* -----------------------------
-------------------------------- 
 
VIEW TRANSITIONS 
 
--------------------------------
----------------------------- */
/* #region VIEW TRANSITIONS */


@supports (view-transition-name: none) {

    @view-transition { navigation: auto; }
    
    ::view-transition-group(root) {
        animation-duration: 0.5s;
        animation-timing-function: ease-out;
        animation-direction: normal;
    }
    
}

/* #endregion VIEW TRANSITIONS */