:root {
    --bg: #ffffff;
    --card-bg: #f8f8f8;
    --text: #000000;
    --sub-text: #666666;
    --accent: #000000;
    --btn-text: #ffffff;
    --neon: #99FF00;
    --yellow: #ffea00;
    --border: #efefef;
    --chip-bg: #f0f0f0;
    --legal-text: #B0B0B0;
    --trust-color: #2d7a00;
    --btn-shadow: rgba(0, 0, 0, 0.12);
}

body.dark-mode {
    --bg: #000000;
    --card-bg: #121212;
    --text: #EAEAEA;
    --sub-text: #A8A8A8;
    --accent: #99FF00;
    --btn-text: #000000;
    --neon: #99FF00;
    --border: #262626;
    --chip-bg: #1A1A1A;
    --legal-text: #B0B0B0;
    --trust-color: #99FF00;
    --btn-shadow: rgba(153, 255, 0, 0.2);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    overflow: hidden;
    height: 100svh;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.4s ease;
    height: 100svh;
    display: flex;
    justify-content: center;
    overflow: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

body::-webkit-scrollbar {
    display: none;
}

.app-container {
    width: 100%;
    max-width: 420px;
    height: 100svh;
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    padding-top: env(safe-area-inset-top);
    position: relative;
    z-index: 1;
}

/* TOP 10 GRID */
.main {
    flex-grow: 1;
    overflow-y: auto;
    padding-bottom: 60px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.main::-webkit-scrollbar {
    display: none;
}

.top10-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.ticket {
    background: #fff;
    border-radius: 20px;
    display: flex;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.05);
    height: 160px;
    color: #333;
    transition: transform 0.3s ease;
}

.ticket:hover {
    transform: translateY(-5px);
}

body.dark-mode .ticket {
    background: #1a1a1a;
    color: #eee;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    border: 1px solid #333;
}

.ticket-rank {
    position: absolute;
    top: -10px;
    left: -10px;
    font-size: 52px;
    font-weight: 950;
    font-style: italic;
    color: var(--neon);
    z-index: 20;
    text-shadow: 
        2px 2px 0px #000,
        -1px -1px 0px #000,
        1px -1px 0px #000,
        -1px 1px 0px #000,
        1px 1px 0px #000;
    line-height: 1;
    pointer-events: none;
    font-family: "Arial Black", Gadget, sans-serif;
}

.ticket-content-wrapper {
    display: flex;
    width: 100%;
    height: 100%;
}

.ticket-poster {
    width: 120px;
    height: 160px;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
}

.ticket-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-hint {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s;
}

.ticket-poster:hover .play-hint {
    opacity: 1;
}

.ticket-info {
    flex-grow: 1;
    padding: 12px 15px 12px 18px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.ticket-title {
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 4px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ticket-title a {
    text-decoration: none;
    color: inherit;
}

.ticket-title a:hover {
    text-decoration: underline;
    color: var(--accent);
}

.ticket-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 700;
}

.star-icon {
    color: #ffcc00;
}

/* Trailer Styles */
.trailer-area {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 30;
    background: #000;
}

.trailer-area iframe {
    width: 100%;
    height: 100%;
}

.close-trailer {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    transition: background 0.2s;
}

.close-trailer:hover {
    background: rgba(255,255,255,0.4);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--bg);
}

.logo {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -1px;
    cursor: pointer;
    color: var(--text);
    display: inline-block;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.2s ease;
    transform-origin: left center;
    user-select: none;
    -webkit-user-select: none;
}

.logo:hover {
    transform: scale(1.08) translateY(-1px);
    text-shadow:
        0 0 8px rgba(153, 255, 0, 0.9),
        0 0 20px rgba(153, 255, 0, 0.5),
        0 0 40px rgba(153, 255, 0, 0.25);
    color: var(--text);
}

.logo.clicked {
    transform: scale(0.96) translateY(1px);
    text-shadow:
        0 0 12px rgba(153, 255, 0, 1),
        0 0 28px rgba(153, 255, 0, 0.7),
        0 0 50px rgba(153, 255, 0, 0.35);
    transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), text-shadow 0.1s ease;
}

.controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    font-weight: 800;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.top10-header-btn {
    text-decoration: none;
    color: #f3ce13;
    border: 1.5px solid #f3ce13;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 900;
    transition: all 0.2s;
    white-space: nowrap;
}

.top10-header-btn:hover {
    background-color: #f3ce13;
    color: #000;
}

.top10-header-btn:active {
    transform: scale(0.95);
}

/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

.lang-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--card-bg);
    min-width: 160px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    border-radius: 16px;
    z-index: 1000;
    margin-top: 10px;
    border: 1px solid var(--border);
    overflow-y: visible !important;
    max-height: none !important;
    height: auto !important;
    animation: dropdownFade 0.2s ease;
}

.lang-menu::-webkit-scrollbar {
    display: none;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.lang-menu.show {
    display: block;
}

.lang-item {
    padding: 6px 16px !important;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lang-item span {
    font-size: 20px;
}

.lang-item:hover {
    background-color: rgba(153, 255, 0, 0.08);
    color: var(--accent);
}

.lang-item.active {
    color: var(--accent);
    background-color: rgba(153, 255, 0, 0.1);
}

body.dark-mode .lang-item.active {
    background-color: rgba(153, 255, 0, 0.05);
}

/* RTL Support */
[dir="rtl"] .lang-menu {
    right: auto;
    left: 0;
}

[dir="rtl"] .lang-item {
    flex-direction: row;
    text-align: right;
}

/* Person Link Styles */
.person-link {
    text-decoration: none;
    color: inherit;
}
.person-link:hover {
    text-decoration: underline;
}

/* Mobile Pinpoint Fix */
@media (max-width: 768px) {
    .top10-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .ticket {
        height: auto !important;
        min-height: 180px;
    }
    .ticket-poster {
        width: 120px !important;
        height: 180px !important;
        border-radius: 8px;
    }
    .ticket-poster img {
        object-fit: cover !important;
    }
    .ticket-info {
        padding: 16px !important;
    }
    .ticket-title {
        font-size: 16px;
    }
}
