
@font-face {
    font-family: "Vazir";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/vazir-matn/Vazirmatn-Regular.ttf") format("turetype"),
        url("fonts/vazir-matn/Vazir.eot") format("eot"),
        url("fonts/vazir-matn/Vazir.woff") format("woff"),
        url("fonts/vazir-matn/Vazirmatn-Regular.woff2") format("woff2");
}
@font-face {
    font-family: "Vazir";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/vazir-matn/Vazirmatn-Bold.ttf") format("turetype"),
        url("fonts/vazir-matn/Vazirmatn-Bold.woff2") format("woff2");
}
@font-face {
    font-family: "Vazir";
    font-style: normal;
    font-weight: 900;
    font-display: swap;
    src: url("fonts/vazir-matn/Vazirmatn-ExtraBold.ttf") format("turetype"),
        url("fonts/vazir-matn/Vazirmatn-ExtraBold.woff2") format("woff2");
}
@font-face {
    font-family: "Vazir";
    font-display: block;
    font-weight: normal;
    src: url("fonts/vazir-matn/Vazir-FD-WOL.ttf") format("turetype"),
        url("fonts/vazir-matn/Vazir-FD-WOL.eot") format("eot"),
        url("fonts/vazir-matn/Vazir-FD-WOL.woff") format("woff"),
        url("fonts/vazir-matn/Vazir-FD-WOL.woff2") format("woff2");
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1f3a 0%, #2d3561 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl;
    overflow-x: hidden;
    position: relative;
}

.logout-button {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: rgba(255, 77, 109, 0.8);
    color: #ffffff;
    border: 1px solid rgba(255, 77, 109, 0.3);
    border-radius: 10px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.logout-button:hover {
    background: rgba(255, 77, 109, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 77, 109, 0.4);
}

.logout-button:active {
    transform: translateY(0);
}

.container {
    display: flex;
    max-width: 1200px;
    width: 100%;
    gap: 60px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    box-sizing: border-box;
}

/* Form Section (Left in RTL) */
.form-section {
    flex: 1;
    min-width: 350px;
    max-width: 400px;
    color: white;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    padding-right: 10px;
}

.main-title {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 20px;
    color: #ffffff;
    text-align: right;
    word-wrap: break-word;
}

.chances-display {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.chances-label {
    color: #e0e0e0;
    font-size: 14px;
    margin-left: 8px;
}

.chances-count {
    color: #ffffff;
    font-size: 18px;
    font-weight: bold;
    background: linear-gradient(135deg, #6b7fd7 0%, #5a6bc7 100%);
    padding: 4px 12px;
    border-radius: 8px;
    display: inline-block;
}

.won-prizes-section {
    margin-top: 30px;
    width: 100%;
    flex-shrink: 0;
}

.won-prizes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.won-prizes-title {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 15px;
    text-align: right;
}


.gift-ticket {
    width: 100%;
}

.gift-card {
    background: linear-gradient(135deg, #ff6b9d 0%, #c44569 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.gift-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.gift-ticket-desc {
    position: relative;
    z-index: 1;
    color: #ffffff;
}

.gift-ticket-desc span {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 8px;
    display: inline-block;
}

.gift-ticket-desc h1 {
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    color: #ffffff;
    text-align: right;
}

.gift-ticket-desc p {
    font-size: 14px;
    margin: 8px 0;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
    line-height: 1.6;
}

.gift-ticket-desc p.text-secondary {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 10px;
    text-align: left;
}

.instructions {
    font-size: 16px;
    color: #e0e0e0;
    margin-bottom: 40px;
    line-height: 1.6;
    text-align: right;
    word-wrap: break-word;
}

.gift-icon, .smile-icon {
    font-size: 18px;
    margin-right: 5px;
}

.game-form {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 15px 50px 15px 15px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #ffffff;
    font-size: 16px;
    color: #333333;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    outline: none;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    direction: rtl;
    text-align: right;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.input-wrapper input::placeholder {
    color: #999999;
    font-family: 'Vazir', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.input-wrapper-error input {
    border: 1px solid #ff0000;
}

.input-wrapper-error input::placeholder {
    color: #ff0000;
}

.input-wrapper input:focus {
    box-shadow: 0 0 0 3px rgba(107, 127, 215, 0.3);
}

.input-wrapper-error input:focus {
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.2);
}

.input-icon {
    position: absolute;
    right: 15px;
    left: auto;
    font-size: 20px;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.input-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.input-icon-red {
    color: #ff0000;
}

.input-icon-red svg {
    stroke: #ff0000;
}

.input-icon-gray {
    color: #999999;
}

.input-icon-gray svg {
    stroke: #999999;
}

.error-message {
    font-size: 12px;
    color: #ff0000;
    text-align: right;
    display: flex;
    align-items: center;
    gap: 5px;
}

.error-message::before {
    content: '●';
    color: #ff0000;
    font-size: 8px;
}

/* جلوگیری از overflow در موبایل */
#phoneDisplay {
    word-break: break-all;
    display: inline-block;
}

.start-button {
    padding: 18px 30px;
    background: linear-gradient(135deg, #6b7fd7 0%, #5a6bc7 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    width: 100%;
}

.start-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #7a8fe7 0%, #6a7bd7 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(107, 127, 215, 0.4);
}

.start-button:active:not(:disabled) {
    transform: translateY(0);
}

.start-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Wheel Section (Right in RTL) */
.wheel-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: sticky;
    top: 20px;
    min-width: 400px;
    width: 100%;
    box-sizing: border-box;
    align-self: flex-start;
}

/* Landin-like wheel layout */
.wheel-wrapper {
    position: relative;
    width: 398px;
    height: 478px;
}

.wheel-canvas_wrapper {
    position: absolute;
    /* Wheel circle area inside wheel-circle2.svg */
    left: 24.9px;
    top: 24.3px;
    width: 348px;
    height: 348px;
    z-index: 2;
}

.wheelOfFortune {
    width: 348px;
    height: 348px;
    transform: rotate(-1.5708rad);
    transform-origin: 50% 50%;
    display: block;
}

.wheel-circle {
    position: absolute;
    left: 0;
    top: 0;
    width: 398px;
    height: 478px;
    z-index: 1; /* behind canvas */
    pointer-events: none;
}

.wheel-light {
    position: absolute;
    /*
      This GIF is meant to sit on the circular wheel area only (NOT the stand).
      So it must match the 348x348 circle box (same as canvas wrapper).
    */
    left: 24.9px;
    top: 24.3px;
    width: 348px;
    height: 348px;
    z-index: 3; /* above canvas */
    pointer-events: none;
}

.wheel-arrow {
    position: absolute;
    left: 198.9px;
    /* Match Landin sizing/placement (43x37) so the tip sits on the wheel rim */
    top: 37px;
    transform: translateX(-50%);
    width: 43px;
    height: 37px;
    z-index: 4;
    pointer-events: none;
}

.wheel-middle__circle {
    position: absolute;
    left: 198.9px;
    top: 198.3px;
    transform: translate(-50%, -50%);
    width: 45px;
    height: 45px;
    z-index: 5;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 968px) {
    body {
        padding: 15px;
    }
    
    .container {
        flex-direction: column-reverse;
        gap: 30px;
        width: 100%;
        max-width: 100%;
    }
    
    .form-section {
        max-width: 100%;
        min-width: auto;
        width: 100%;
    }
    
    .wheel-section {
        min-width: auto;
        width: 100%;
        display: grid;
        place-items: center;
        position: relative;
        top: 0;
        align-self: auto;
    }
    
    .form-section {
        max-height: none;
        overflow-y: visible;
    }
    
    .won-prizes-list {
        /* بدون محدودیت ارتفاع - کل صفحه اسکرول می‌شود */
    }
    
    .wheel-wrapper {
        transform: scale(0.9);
        transform-origin: top center;
        will-change: transform;
    }
    
    .main-title {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .instructions {
        font-size: 14px;
        margin-bottom: 30px;
    }
    
    .input-wrapper input {
        padding: 12px 45px 12px 12px;
        font-size: 15px;
    }
    
    .input-icon {
        right: 12px;
    }
    
    .start-button {
        padding: 15px 25px;
        font-size: 16px;
    }
    
    .game-form {
        gap: 20px;
    }
    
    .chances-display {
        padding: 10px 15px;
        margin-bottom: 15px;
    }
    
    .chances-label {
        font-size: 13px;
    }
    
    .chances-count {
        font-size: 16px;
        padding: 3px 10px;
    }
    
    .won-prizes-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .gift-card {
        padding: 15px;
    }
    
    .gift-ticket-desc h1 {
        font-size: 16px;
    }
    
    .gift-ticket-desc p {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    .container {
        gap: 25px;
    }
    
    .wheel-section {
        max-height: 380px;
        display: grid;
        place-items: center;
    }
    
    .wheel-wrapper {
        transform: scale(0.8);
        transform-origin: top center;
        will-change: transform;
    }
    
    .main-title {
        font-size: 24px;
        margin-bottom: 12px;
    }
    
    .instructions {
        font-size: 13px;
        margin-bottom: 25px;
    }
    
    .input-wrapper input {
        padding: 12px 40px 12px 12px;
        font-size: 14px;
    }
    
    .input-icon {
        right: 12px;
        width: 18px;
        height: 18px;
    }
    
    .start-button {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .game-form {
        gap: 18px;
    }
    
    .chances-display {
        padding: 8px 12px;
        margin-bottom: 12px;
    }
    
    .chances-label {
        font-size: 12px;
    }
    
    .chances-count {
        font-size: 15px;
        padding: 3px 8px;
    }
    
    .won-prizes-title {
        font-size: 16px;
        margin-bottom: 10px;
    }
    
    .gift-card {
        padding: 12px;
    }
    
    .gift-ticket-desc h1 {
        font-size: 15px;
    }
    
    .gift-ticket-desc p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        gap: 20px;
    }
    
    .wheel-section {
        display: grid;
        place-items: center;
    }
    
    .wheel-wrapper {
        transform: scale(0.7);
        transform-origin: top center;
        will-change: transform;
    }
    
    .main-title {
        font-size: 20px;
        margin-bottom: 12px;
    }
    
    .instructions {
        font-size: 12px;
        margin-bottom: 20px;
        line-height: 1.5;
    }
    
    .gift-icon, .smile-icon {
        font-size: 16px;
    }
    
    .game-form {
        gap: 16px;
    }
    
    .input-group {
        gap: 6px;
    }
    
    .input-wrapper input {
        padding: 11px 35px 11px 11px;
        font-size: 14px;
        border-radius: 10px;
    }
    
    .input-icon {
        right: 11px;
        width: 18px;
        height: 18px;
    }
    
    .start-button {
        padding: 12px 18px;
        font-size: 14px;
        border-radius: 10px;
        margin-top: 8px;
    }
    
    .error-message {
        font-size: 11px;
    }
    
    .chances-display {
        padding: 8px 10px;
        margin-bottom: 10px;
    }
    
    .chances-label {
        font-size: 11px;
    }
    
    .chances-count {
        font-size: 14px;
        padding: 2px 8px;
    }
    
    .won-prizes-title {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .gift-card {
        padding: 10px;
    }
    
    .gift-ticket-desc span {
        font-size: 12px;
        padding: 4px 8px;
    }
    
    .gift-ticket-desc h1 {
        font-size: 14px;
        margin: 8px 0;
    }
    
    .gift-ticket-desc p {
        font-size: 11px;
        margin: 6px 0;
    }
    
    .logout-button {
        top: 8px;
        left: 8px;
        padding: 7px 14px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .logout-button {
        top: 8px;
        left: 8px;
        padding: 7px 14px;
        font-size: 12px;
    }
}

@media (max-width: 360px) {
    body {
        padding: 8px;
    }
    
    .container {
        gap: 18px;
    }
    
    .wheel-section {
        display: grid;
        place-items: center;
    }
    
    .wheel-wrapper {
        transform: scale(0.6);
        transform-origin: top center;
        will-change: transform;
    }
    
    .main-title {
        font-size: 18px;
        margin-bottom: 10px;
    }
    
    .instructions {
        font-size: 11px;
        margin-bottom: 18px;
    }
    
    .input-wrapper input {
        padding: 10px 30px 10px 10px;
        font-size: 13px;
    }
    
    .start-button {
        padding: 11px 16px;
        font-size: 13px;
    }
}

/* Winner Modal */
.winner-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.winner-modal-content {
    background: linear-gradient(135deg, #6b7fd7 0%, #5a6bc7 100%);
    padding: 50px 40px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.4s ease;
    direction: rtl;
    position: relative;
    z-index: 10;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .winner-modal-content {
        padding: 35px 25px;
        max-width: 95%;
        width: 95%;
    }
    
    .winner-title {
        font-size: 22px;
        margin-bottom: 12px;
    }
    
    .winner-message {
        font-size: 18px;
        padding: 12px;
        margin-bottom: 20px;
    }
    
    .winner-button {
        padding: 12px 30px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .winner-modal-content {
        padding: 25px 20px;
        border-radius: 15px;
        width: 95%;
    }
    
    .winner-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .winner-message {
        font-size: 16px;
        padding: 10px;
        margin-bottom: 18px;
        line-height: 1.6;
    }
    
    .winner-button {
        padding: 11px 25px;
        font-size: 15px;
        width: 100%;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Fireworks Canvas */
#fireworksCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    display: block;
}

.winner-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 15px;
}

.winner-message {
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.winner-button {
    padding: 15px 40px;
    background: #ffffff;
    color: #6b7fd7;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Vazir', Arial, Tahoma;
}

.winner-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.winner-button:active {
    transform: translateY(0);
}

/* =========================================================
   Status modal (glass) - errors / infos
   ========================================================= */
.status-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    box-sizing: border-box;
}

.status-modal-content {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 18px;
    box-shadow: 0 18px 60px rgba(0,0,0,0.55);
    padding: 22px 20px;
    text-align: center;
    color: #fff;
    position: relative;
    overflow: hidden;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .status-modal {
        padding: 15px;
    }
    
    .status-modal-content {
        max-width: 85%;
        padding: 20px 16px;
    }
    
    .status-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
        margin-bottom: 12px;
    }
    
    .status-title {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .status-message {
        font-size: 15px;
        padding: 10px;
        margin-bottom: 14px;
    }
    
    .status-button {
        padding: 11px 24px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .status-modal {
        padding: 10px;
    }
    
    .status-modal-content {
        padding: 18px 14px;
        border-radius: 15px;
        max-width: 85%;
    }
    
    .status-icon {
        width: 50px;
        height: 50px;
        font-size: 26px;
        margin-bottom: 10px;
    }
    
    .status-title {
        font-size: 16px;
        margin-bottom: 6px;
    }
    
    .status-message {
        font-size: 13px;
        padding: 10px;
        margin-bottom: 12px;
        line-height: 1.6;
    }
    
    .status-button {
        padding: 10px 20px;
        font-size: 13px;
        width: 100%;
    }
}

.status-modal-content::before {
    content: '';
    position: absolute;
    inset: -60px;
    background:
        radial-gradient(circle at 20% 10%, rgba(255, 77, 109, 0.35), transparent 55%),
        radial-gradient(circle at 85% 20%, rgba(107, 127, 215, 0.30), transparent 60%),
        radial-gradient(circle at 55% 90%, rgba(255, 215, 0, 0.18), transparent 60%);
    pointer-events: none;
    filter: blur(0px);
    opacity: 0.9;
}

.status-icon {
    width: 65px;
    height: 65px;
    border-radius: 18px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 900;
    color: #ffffff;
    background: rgba(255, 77, 109, 0.18);
    border: 1px solid rgba(255, 77, 109, 0.28);
    box-shadow: 0 12px 30px rgba(255, 77, 109, 0.18);
    position: relative;
    z-index: 1;
}

.status-title {
    font-size: 20px;
    font-weight: 900;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.status-message {
    font-size: 15px;
    line-height: 1.7;
    padding: 12px 12px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 12px;
    margin: 0 auto 16px;
    position: relative;
    z-index: 1;
    white-space: pre-line;
}

.status-button {
    padding: 12px 28px;
    background: #ffffff;
    color: #6b7fd7;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    font-family: 'Vazir', Arial, Tahoma;
    position: relative;
    z-index: 1;
}

.status-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}
