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

body {
    font-family: 'SF Pro Text', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1e1e1e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #ffffff;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

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

.header {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
}

.header a {
    color: #007aff;
    text-decoration: none;
    font-weight: 600;
}

.header a:hover {
    text-decoration: underline;
}

.header img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.container {
    background: #2d2d2d;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 600px;
    width: 100%;
    padding: 40px;
    border: 1px solid #3d3d3d;
}

h1 {
    color: #ffffff;
    margin-bottom: 10px;
    text-align: center;
    font-size: 2em;
    font-weight: 600;
}

.subtitle {
    color: #cccccc;
    text-align: center;
    margin-bottom: 30px;
    font-size: 0.95em;
}

.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.95em;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid #555555;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: #3d3d3d;
    color: #ffffff;
}

input:focus, select:focus {
    outline: none;
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.2);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

button {
    flex: 1;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-family: inherit;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button[type="submit"] {
    background: linear-gradient(135deg, #007aff 0%, #0056cc 100%);
    color: white;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.3);
}

button[type="reset"] {
    background: #555555;
    color: #ffffff;
}

button[type="reset"]:hover {
    background: #666666;
}

.loading {
    display: none;
    text-align: center;
    color: #ffffff;
    margin-top: 20px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 3px solid #555555;
    border-top: 3px solid #007aff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.result {
    margin-top: 40px;
    padding: 25px;
    background: #3d3d3d;
    border-radius: 12px;
    border-left: 5px solid #007aff;
    display: none;
}

.result.active {
    display: block;
    animation: slideIn 0.5s ease-out;
}

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

.result-header {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.champion-tag {
    background: #007aff;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.lane-tag {
    background: #5ac8fa;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
}

.vs {
    font-weight: bold;
    color: #ffffff;
    font-size: 1.1em;
}

.result-content {
    color: #cccccc;
    line-height: 1.8;
    font-size: 0.95em;
}

.result-content h3 {
    color: #ffffff;
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

body.modal-open {
    overflow: hidden;
}

.advice-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease-out;
    padding: 20px;
}

.advice-modal-overlay.fade-out {
    animation: fadeOut 0.2s forwards;
}

.advice-modal {
    max-height: 85vh;
    display: flex;
    flex-direction: column; /* Para que header + content sean verticales */
    background: linear-gradient(160deg, #2a2f45 0%, #1d2236 100%);
    border: 1px solid rgba(122, 189, 255, 0.35);
    border-radius: 16px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
    padding: 24px;
    position: relative;
    animation: modalPop 0.24s ease-out;
    overflow: hidden;
}

.advice-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    flex: none;
    width: auto;
    background: #ff4d6d;
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 999px;
    font-size: 0.9em;
}

.advice-modal-close:hover {
    background: #ff3358;
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(255, 77, 109, 0.3);
}

.advice-modal-header {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-right: 94px;
}

.advice-modal-content {
    color: #e6ebf5;
    line-height: 1.8;
    font-size: 0.98em;
    overflow-y: auto;
    flex: 1;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.advice-modal-content::-webkit-scrollbar {
    display: none;
}

.advice-modal-content h1,
.advice-modal-content h2,
.advice-modal-content h3,
.advice-modal-content h4 {
    color: #ffffff;
    margin: 14px 0 8px;
}

.advice-modal-content ul,
.advice-modal-content ol {
    margin-left: 20px;
}

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

@keyframes modalPop {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.error {
    background: #3d1c1c;
    color: #ff6b6b;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    border-left: 5px solid #ff6b6b;
    display: none;
}

.error.active {
    display: block;
}

.historial {
    margin-top: 24px;
    padding: 20px;
    border: 1px solid #3d3d3d;
    border-radius: 12px;
    background: #262626;
}

.historial-title {
    font-size: 1.1em;
    margin-bottom: 12px;
    color: #ffffff;
    display: none;
}

.historial-item {
    padding: 14px;
    border-radius: 10px;
    background: #313131;
    border: 1px solid #3e3e3e;
    cursor: pointer;
}

.historial-item + .historial-item {
    margin-top: 10px;
}

.historial-head {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.historial-advice {
    color: #d2d2d2;
    line-height: 1.6;
    font-size: 0.93em;
}

.historial-empty {
    color: #a8a8a8;
    font-size: 0.92em;
}

.login-form {
    text-align: center;
    margin-top: 30px;
}

.google-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    background: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.google-login-btn:hover {
    background: #3367d6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.google-icon {
    width: 20px;
    height: 20px;
}

#logoutBtn.logout-btn {
    background: none;
    border: none;
    color: #ff0000;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    padding: 0;
    margin: 0;
    vertical-align: baseline;
}

#logoutBtn.logout-btn:hover {
    color: #ff0000;
    transform: none;
    box-shadow: none;
}
