* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Calibri', Arial, sans-serif;
    background-color: #2a2a2a;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: #ffffff;
    padding: 0;
    margin: 0;
    overflow: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

html {
    height: 100%;
    overflow: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

.display-container {
    background-color: #193521;
    background-image: url('PI240x185.png');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: contain;
    border: 8px solid #1a1a1a;
    border-radius: 15px;
    padding: 15px 20px;
    width: 100%;
    max-width: 430px;
    height: 100vh;
    max-height: 100vh;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    transition: background-image 0.5s ease;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.display-container::-webkit-scrollbar {
    display: none;
}

/* Live Match Mode */
.display-container.live-match {
    background-image: url('verdao.png');
    background-size: cover;
    background-position: center top;
}

.display-container.past-match {
    opacity: 0.95;
}

.display-container.waiting-match {
    background-image: url('PItalia.png');
    background-size: contain;
}

.logo-container {
    position: absolute;
    top: 25px;
    left: 15px;
    z-index: 10;
}

.logo-link {
    display: block;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.logo-link:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.logo-link:active {
    transform: scale(0.98);
}

.app-logo {
    width: 85px;
    height: 80px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 8px 32px rgba(0, 0, 0, 0.2);
    display: block;
}

.share-container {
    position: absolute;
    top: calc(25px + env(safe-area-inset-top));
    right: calc(15px + env(safe-area-inset-right));
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 80px;
}

.share-button {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    padding: 0;
}

.share-button svg {
    width: 24px;
    height: 24px;
    color: #ffffff;
    transition: transform 0.2s ease;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

.share-button:active {
    transform: scale(0.95);
}

.share-button:hover svg {
    transform: scale(1.1);
}

.share-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    line-height: 1.2;
    max-width: 80px;
    width: 100%;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 5px;
    padding-bottom: 5px;
    margin-top: 45px;
}

.date {
    font-size: 24px;
    font-weight: normal;
    color: #ffffff;
    font-family: 'Calibri', Arial, sans-serif;
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.time {
    font-size: 72px;
    font-weight: 400;
    color: #ffffff;
    font-family: 'Digital-7 Mono', 'Courier New', 'Consolas', monospace;
    letter-spacing: 4px;
    text-align: center;
    width: 100%;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
}

.time-display {
    text-align: center;
    margin-bottom: 8px;
}

.teams {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 4px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.15);
}

.team {
    text-align: center;
    width: 100%;
}

.team-name {
    font-size: 44px;
    font-weight: bold;
    color: #ffffff;
    text-transform: capitalize;
    padding: 4px 10px;
    min-width: 160px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.team-name.multi-word {
    font-size: 32px;
    line-height: 1.15;
    max-width: 85%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: auto;
}

.team.away .team-name {
    color: #ffffff;
    font-weight: bold;
}

.vs {
    font-size: 36px;
    font-weight: normal;
    color: #ffffff;
    margin: 2px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.match-label {
    text-align: center;
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 5px;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: all 0.3s ease;
}

/* Live match label styling */
.live-match .match-label {
    color: #FFD700;
    font-weight: bold;
    font-size: 36px;
    text-shadow: 
        0 0 10px rgba(255, 215, 0, 0.8),
        0 0 20px rgba(255, 215, 0, 0.6),
        2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: pulse-live 2s ease-in-out infinite;
}

@keyframes pulse-live {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.85;
        transform: scale(1.05);
    }
}

.countdown-section {
    text-align: center;
    margin: 8px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.15);
}

.countdown-label {
    font-size: 26px;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.countdown {
    font-size: 34px;
    font-weight: normal;
    color: #ffffff;
    letter-spacing: 1px;
    font-family: 'Calibri', Arial, sans-serif;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.countdown span {
    color: #ffffff;
}

.info {
    text-align: center;
    margin: 8px 0 5px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.15);
}

.match-datetime {
    font-size: 40px;
    color: #ffffff;
    font-weight: normal;
    font-family: 'Calibri', Arial, sans-serif;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.venue-info {
    text-align: center;
    margin: 6px 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.15);
}

.venue {
    font-size: 32px;
    color: #ffffff;
    margin-bottom: 0px;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.league {
    display: none;
}

.channels {
    text-align: center;
    margin-top: 8px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.15);
}

.channels-label {
    font-size: 30px;
    color: #ffffff;
    margin-bottom: 6px;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.channels-list {
    font-size: 20px;
    color: #ffffff;
    line-height: 1.6;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.ai-disclaimer {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
    font-style: italic;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.6);
    line-height: 1.3;
}

/* Footer */
.footer {
    margin-top: 20px;
    padding: 12px 10px 10px 10px;
    text-align: center;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-link {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
    font-weight: normal;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.footer-link:hover {
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

.footer-link:active {
    color: #FFA500;
}

.footer-separator {
    margin: 0 8px;
    color: rgba(255, 255, 255, 0.5);
}

/* Responsive design - Optimized for iPhone 14 Pro Max and similar */
@media (max-width: 430px) {
    .display-container {
        border-radius: 0;
        border: none;
        min-height: 100vh;
        max-width: 100%;
        padding: 12px 18px;
        justify-content: space-between;
    }
    
    .logo-container {
        top: 50px;
        left: 10px;
    }
    
    .app-logo {
        width: 72px;
        height: 72px;
    }
    
    .share-container {
        top: calc(50px + env(safe-area-inset-top));
        right: calc(10px + env(safe-area-inset-right));
        gap: 5px;
    }
    
    .share-button {
        width: 46px;
        height: 46px;
    }
    
    .share-button svg {
        width: 22px;
        height: 22px;
    }
    
    .share-label {
        font-size: 8px;
        max-width: 70px;
    }
    
    body {
        padding: 0;
    }
    
    .header {
        margin-top: 50px;
        margin-bottom: 8px;
    }
    
    .time {
        font-size: 80px;
    }
    
    .date {
        font-size: 25px;
    }
    
    .time-display {
        margin-bottom: 8px;
    }
    
    .match-label {
        font-size: 29px;
        margin-bottom: 6px;
    }
    
    .teams {
        gap: 4px;
        margin: 6px 0;
        padding: 8px;
    }
    
    .team-name {
        font-size: 38px;
        padding: 3px 10px;
    }
    
    .team-name.multi-word {
        font-size: 28px;
        line-height: 1.15;
    }
    
    .vs {
        font-size: 34px;
        margin: 2px 0;
    }
    
    .countdown-section {
        margin: 10px 0;
        padding: 12px;
    }
    
    .countdown-label {
        font-size: 24px;
    }
    
    .countdown {
        font-size: 30px;
    }
    
    .info {
        margin: 10px 0 6px 0;
        padding: 10px;
    }
    
    .match-datetime {
        font-size: 38px;
    }
    
    .venue-info {
        margin: 8px 0;
        padding: 10px;
    }
    
    .venue {
        font-size: 30px;
    }
    
    .channels {
        margin-top: 10px;
        padding: 10px;
    }
    
    .channels-label, .channels-list {
        font-size: 19px;
        line-height: 1.5;
    }
    
    .ai-disclaimer {
        font-size: 8px;
        margin-top: 6px;
    }
    
    .footer {
        margin-top: 18px;
        padding: 12px 10px 10px 10px;
        font-size: 13px;
    }
    
    .footer-separator {
        margin: 0 7px;
    }
}

@media (min-width: 431px) {
    .display-container {
        min-height: auto;
        max-height: 90vh;
    }
}

@media (max-width: 390px) {
    .logo-container {
        top: 6px;
        left: 6px;
    }
    
    .app-logo {
        width: 60px;
        height: 60px;
    }
    
    .share-container {
        top: calc(6px + env(safe-area-inset-top));
        right: calc(6px + env(safe-area-inset-right));
        gap: 4px;
    }
    
    .share-button {
        width: 40px;
        height: 40px;
    }
    
    .share-button svg {
        width: 20px;
        height: 20px;
    }
    
    .share-label {
        font-size: 7px;
        max-width: 60px;
    }
    
    .header {
        margin-top: 18px;
    }
    
    .time {
        font-size: 54px;
    }
    
    .date {
        font-size: 22px;
    }
    
    .match-label {
        font-size: 26px;
    }
    
    .team-name {
        font-size: 34px;
        padding: 2px 8px;
    }
    
    .team-name.multi-word {
        font-size: 26px;
        line-height: 1.15;
    }
    
    .vs {
        font-size: 30px;
        margin: 2px 0;
    }
    
    .countdown-section {
        margin: 5px 0;
        padding: 10px;
    }
    
    .countdown-item {
        margin: 0 4px;
    }
    
    .countdown-value {
        font-size: 26px;
    }
    
    .countdown-label {
        font-size: 20px;
    }
    
    .countdown {
        font-size: 27px;
    }
    
    .info {
        margin: 5px 0 3px 0;
        padding: 8px;
    }
    
    .match-datetime {
        font-size: 34px;
    }
    
    .venue-info {
        margin: 4px 0;
        padding: 8px;
    }
    
    .venue {
        font-size: 27px;
    }
    
    .channels {
        margin-top: 5px;
        padding: 8px;
    }
    
    .channels-label, .channels-list {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .ai-disclaimer {
        font-size: 7px;
        margin-top: 5px;
    }
    
    .footer {
        margin-top: 12px;
        padding: 8px 6px 6px 6px;
        font-size: 11px;
    }
    
    .footer-separator {
        margin: 0 5px;
    }
}

/* iPhone SE and smaller devices (375px and below) */
@media (max-width: 375px) {
    .display-container {
        padding: 10px 15px;
        border: 5px solid #1a1a1a;
    }
    
    .logo-container {
        top: 5px;
        left: 5px;
    }
    
    .app-logo {
        width: 50px;
        height: 50px;
    }
    
    .share-container {
        top: calc(5px + env(safe-area-inset-top));
        right: calc(5px + env(safe-area-inset-right));
        gap: 3px;
    }
    
    .share-button {
        width: 38px;
        height: 38px;
    }
    
    .share-button svg {
        width: 18px;
        height: 18px;
    }
    
    .share-label {
        font-size: 6px;
        max-width: 55px;
    }
    
    .header {
        margin-top: 12px;
        margin-bottom: 3px;
        padding-bottom: 3px;
    }
    
    .time {
        font-size: 48px;
        letter-spacing: 2px;
    }
    
    .date {
        font-size: 19px;
        margin-bottom: 3px;
    }
    
    .match-label {
        font-size: 22px;
        margin-bottom: 4px;
    }
    
    .teams {
        gap: 4px;
        margin: 4px 0;
        padding: 6px;
    }
    
    .team-name {
        font-size: 30px;
        padding: 2px 6px;
        min-width: 130px;
    }
    
    .team-name.multi-word {
        font-size: 24px;
        line-height: 1.15;
        min-width: auto;
    }
    
    .vs {
        font-size: 26px;
        margin: 1px 0;
    }
    
    .countdown-section {
        margin: 4px 0;
        padding: 8px;
    }
    
    .countdown-label {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .countdown {
        font-size: 23px;
        letter-spacing: 0.5px;
    }
    
    .info {
        margin: 4px 0 2px 0;
        padding: 6px;
    }
    
    .match-datetime {
        font-size: 28px;
    }
    
    .venue-info {
        margin: 3px 0;
        padding: 6px;
    }
    
    .venue {
        font-size: 23px;
    }
    
    .channels {
        margin-top: 4px;
        padding: 6px;
    }
    
    .channels-label, .channels-list {
        font-size: 14px;
        line-height: 1.3;
    }
    
    .ai-disclaimer {
        font-size: 6px;
        margin-top: 3px;
    }
    
    .footer {
        margin-top: 8px;
        padding: 6px 4px 4px 4px;
        font-size: 9px;
    }
    
    .footer-separator {
        margin: 0 4px;
    }
}

/* Instructions page */
html.instructions-page,
body.instructions-page {
    height: auto;
    min-height: 100%;
    overflow: auto;
}

body.instructions-page {
    align-items: flex-start;
    padding: 80px 32px 0;
}

.instructions-container {
    background-color: #193521;
    border: 6px solid #1a1a1a;
    border-radius: 14px;
    padding: 18px 20px 22px 20px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    color: #ffffff;
}

.instructions-title {
    font-size: 28px;
    text-align: center;
    margin-bottom: 12px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.instructions-section {
    margin-top: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.instructions-section h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

.instructions-section ol {
    padding-left: 18px;
}

.instructions-section li {
    margin-bottom: 6px;
    line-height: 1.4;
}

.instructions-footer {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
}

.instructions-footer a {
    color: #ffffff;
}

@media (max-width: 430px) {
    body.instructions-page {
        padding: 60px 16px 0;
    }

    .instructions-container {
        border-radius: 0;
        border: none;
        padding: 16px;
        max-width: 100%;
    }

    .instructions-title {
        font-size: 24px;
    }

    .instructions-section h2 {
        font-size: 18px;
    }
}
