@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

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

:root {
    --white:   #ffffff;
    --bg:      #f7f7f9;
    --surface: #ffffff;
    --border:  #e8e8ed;
    --border2: #d4d4db;
    --text:    #0f0f14;
    --text2:   #5a5a6e;
    --text3:   #9898aa;
    --accent:  #3b5bdb;
    --accent2: #4c6ef5;
    --accent-bg: rgba(59, 91, 219, 0.06);
    --green:   #12b76a;
    --green-bg: rgba(18, 183, 106, 0.07);
    --red:     #e84545;
    --red-bg:  rgba(232, 69, 69, 0.07);
    --radius:  14px;
    --radius-sm: 8px;
    --shadow:  0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08), 0 8px 32px rgba(0,0,0,0.06);
    --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}
.logo-mark {
    width: 36px; height: 36px;
    background: var(--text);
    color: white;
    border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.logo-text {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-toggle {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: 0.5px;
}
.lang-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-bg);
}
.lang-icon { font-size: 13px; }

.tg-badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #0088cc10;
    border: 1px solid #0088cc22;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #0088cc;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.tg-badge:hover { background: #0088cc18; }

.main {
    flex: 1;
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.hero { text-align: center; margin-bottom: 36px; }
.hero-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--accent-bg);
    border: 1px solid rgba(59,91,219,0.15);
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 16px;
}
.hero-title {
    font-size: clamp(28px, 5vw, 38px);
    font-weight: 700;
    letter-spacing: -0.8px;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 12px;
}
.hero-accent {
    background: linear-gradient(135deg, var(--accent), #7048e8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 15px;
    color: var(--text2);
    max-width: 360px;
    margin: 0 auto 24px;
    line-height: 1.6;
}
.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 12px 24px;
    box-shadow: var(--shadow);
}
.hstat { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.hstat-val {
    font-family: 'DM Mono', monospace;
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
    line-height: 1;
}
.hstat-key {
    font-size: 10px;
    color: var(--text3);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hstat-div { width: 1px; height: 28px; background: var(--border); }

.tabs {
    display: flex;
    gap: 2px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
    position: relative;
    box-shadow: var(--shadow);
}
.tab {
    flex: 1;
    padding: 9px 16px;
    background: none;
    border: none;
    border-radius: 9px;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
    z-index: 1;
    white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active {
    color: var(--text);
    font-weight: 600;
    background: var(--bg);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    animation: panelIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel.hidden { display: none; }

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

.field-group { margin-bottom: 18px; }
.field-label {
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text2);
    margin-bottom: 7px;
    letter-spacing: 0.2px;
}

.input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    appearance: none;
}
.input::placeholder { color: var(--text3); }
.input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(59,91,219,0.1);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }

.file-drop {
    border: 1.5px dashed var(--border2);
    border-radius: var(--radius-sm);
    background: var(--bg);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}
.file-drop:hover, .file-drop.drag-over {
    border-color: var(--accent);
    background: var(--accent-bg);
}
.file-drop.has-file {
    border-style: solid;
    border-color: var(--green);
    background: var(--green-bg);
}
.file-drop-icon {
    width: 40px; height: 40px;
    background: var(--border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 10px;
    color: var(--text2);
    transition: all var(--transition);
}
.file-drop:hover .file-drop-icon,
.file-drop.drag-over .file-drop-icon { background: var(--accent-bg); color: var(--accent); }
.file-drop.has-file .file-drop-icon  { background: var(--green-bg); color: var(--green); }
.file-drop-text {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text2);
    margin-bottom: 3px;
}
.file-drop.has-file .file-drop-text  { color: var(--green); }
.file-drop-sub { font-size: 12px; color: var(--text3); }

.platform-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}
.plat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 6px 9px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
    position: relative;
}
.plat:hover {
    border-color: var(--accent);
    background: var(--accent-bg);
    transform: translateY(-1px);
}
.plat.active {
    border-color: var(--accent);
    background: var(--accent-bg);
    box-shadow: 0 0 0 2px rgba(59,91,219,0.12);
}
.plat.active::after {
    content: '';
    position: absolute;
    top: 5px; right: 5px;
    width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
}
.plat-ico { font-size: 18px; line-height: 1; }
.plat-nm  { font-size: 9.5px; font-weight: 600; color: var(--text2); }
.plat.active .plat-nm { color: var(--accent); }

.btn-primary {
    width: 100%;
    padding: 12px 20px;
    background: var(--text);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: -0.1px;
    margin-top: 4px;
}
.btn-primary:hover:not(:disabled) {
    background: #1a1a2e;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.error-msg {
    display: none;
    padding: 10px 13px;
    background: var(--red-bg);
    border: 1px solid rgba(232,69,69,0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--red);
    margin-bottom: 14px;
    animation: slideIn 0.15s ease;
}
.error-msg.show { display: block; }

.progress-wrap {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    animation: slideIn 0.15s ease;
}
.progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 14px;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #7048e8);
    border-radius: 4px;
    width: 0%;
    transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-steps {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.pstep {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    color: var(--text3);
    transition: color var(--transition);
}
.pstep-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--border2);
    flex-shrink: 0;
    transition: all var(--transition);
}
.pstep.active { color: var(--accent); }
.pstep.active .pstep-dot { background: var(--accent); box-shadow: 0 0 0 3px rgba(59,91,219,0.2); }
.pstep.done   { color: var(--green); }
.pstep.done .pstep-dot { background: var(--green); }

.result-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--green-bg);
    border: 1px solid rgba(18,183,106,0.2);
    border-radius: 10px;
    margin-top: 14px;
    animation: slideIn 0.2s ease;
}
.result-icon {
    width: 32px; height: 32px;
    background: var(--green);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.result-body { flex: 1; min-width: 0; }
.result-label { font-size: 10.5px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.result-url {
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    text-decoration: none;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.result-url:hover { text-decoration: underline; }
.result-meta { font-size: 11.5px; color: var(--text3); margin-top: 1px; }
.result-open {
    flex-shrink: 0;
    padding: 6px 12px;
    background: var(--green);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
}
.result-open:hover { background: #0ea55e; }

.stars-row {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}
.star-btn {
    flex: 1;
    min-width: 42px;
    padding: 10px 4px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 9px;
    color: var(--text3);
    cursor: pointer;
    font-size: 14px;
    transition: all var(--transition);
    text-align: center;
    font-family: inherit;
}
.star-btn:hover, .star-btn.active {
    border-color: #f59f00;
    background: #fff9e6;
    color: #f59f00;
    transform: translateY(-1px);
}

.toast {
    position: fixed;
    bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text);
    color: var(--white);
    padding: 10px 20px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    z-index: 9999;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 7px;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success::before { content: '✓'; color: var(--green); font-weight: 700; }
.toast.error::before   { content: '✕'; color: var(--red);   font-weight: 700; }

.footer {
    text-align: center;
    padding: 20px;
    font-size: 12.5px;
    color: var(--text3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid var(--border);
    background: var(--white);
}
.footer a { color: var(--text2); text-decoration: none; font-weight: 500; }
.footer a:hover { color: var(--accent); }

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

@media (max-width: 480px) {
    .header { padding: 0 16px; }
    .main { padding: 28px 14px 48px; }
    .hero-title { font-size: 26px; }
    .panel { padding: 18px; }
    .platform-grid { grid-template-columns: repeat(4, 1fr); gap: 5px; }
    .plat-ico { font-size: 16px; }
    .plat-nm { font-size: 8.5px; }
    .tg-badge { display: none; }
    .hero-stats { gap: 14px; padding: 10px 18px; }
    .hstat-val { font-size: 14px; }
}
@media (max-width: 360px) {
    .platform-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; }
    .plat { padding: 8px 3px 7px; }
}
