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

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

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(180deg, #0a0a1a 0%, #1a0a2e 50%, #0f0f23 100%);
    min-height: 100vh;
    color: #e8e8e8;
    position: relative;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    animation: twinkle 3s infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    from { text-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 0 0 40px rgba(255, 215, 0, 0.2); }
    to { text-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.3); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(10, 10, 26, 0.9);
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(138, 43, 226, 0.1) 0%, transparent 70%);
    pointer-events: none;
}

.title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    color: #ffd700;
    text-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.3);
    margin-bottom: 10px;
    animation: glow 2s ease-in-out infinite alternate;
    letter-spacing: 6px;
    word-break: keep-all;
}

.subtitle {
    font-size: 1rem;
    color: #a0a0a0;
    margin-bottom: 15px;
    padding: 0 10px;
    word-break: keep-all;
}

.header-runes {
    font-size: 1.1rem;
    color: #ffd700;
    opacity: 0.6;
    letter-spacing: 10px;
}

.main {
    position: relative;
    z-index: 1;
}

.intro-section {
    padding: 25px 0;
    animation: slideUp 0.8s ease-out;
}

.intro-section h2 {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 15px;
    color: #ffd700;
    word-break: keep-all;
}

.intro-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.intro-text {
    flex: 1;
    min-width: 220px;
}

.intro-text p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #d0d0d0;
}

.intro-text ul {
    list-style: none;
    margin: 12px 0;
}

.intro-text li {
    padding: 6px 0;
    padding-left: 18px;
    position: relative;
    color: #c0c0c0;
    font-size: 0.82rem;
}

.intro-text li::before {
    content: '✧';
    position: absolute;
    left: 0;
    color: #ffd700;
    font-size: 0.65rem;
}

.tarot-symbol {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.symbol-circle {
    width: 85px;
    height: 85px;
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 215, 0, 0.05);
    transition: all 0.3s ease;
}

.symbol-circle:hover {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
    transform: scale(1.05);
}

.symbol-circle.small {
    width: 70px;
    height: 70px;
}

.symbol-circle span:first-child {
    font-size: 0.7rem;
    color: #a0a0a0;
    margin-bottom: 3px;
    text-align: center;
}

.symbol-circle span:last-child {
    font-size: 1.4rem;
    color: #ffd700;
    font-weight: bold;
}

.basics-section {
    padding: 30px 0;
    background: rgba(10, 10, 26, 0.5);
}

.basics-section h2 {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
    color: #ffd700;
    word-break: keep-all;
}

.basics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.basics-card {
    background: rgba(42, 42, 74, 0.5);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.basics-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.3);
}

.basics-card.upright-card:hover {
    border-color: rgba(100, 200, 100, 0.5);
    box-shadow: 0 5px 30px rgba(100, 200, 100, 0.2);
}

.basics-card.reversed-card:hover {
    border-color: rgba(200, 100, 100, 0.5);
    box-shadow: 0 5px 30px rgba(200, 100, 100, 0.2);
}

.basics-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.basics-card h3 {
    color: #ffd700;
    margin-bottom: 10px;
    font-size: 1rem;
    word-break: keep-all;
}

.basics-card p {
    color: #d0d0d0;
    line-height: 1.5;
    margin-bottom: 10px;
    font-size: 0.85rem;
}

.basics-card ul {
    list-style: none;
}

.basics-card li {
    color: #c0c0c0;
    padding: 4px 0;
    padding-left: 15px;
    position: relative;
    font-size: 0.8rem;
}

.basics-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #ffd700;
}

.cards-section {
    padding: 30px 0;
}

.cards-section h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 8px;
    color: #ffd700;
    word-break: keep-all;
}

.section-desc {
    text-align: center;
    color: #a0a0a0;
    margin-bottom: 20px;
    padding: 0 10px;
    font-size: 0.85rem;
}

.cards-filter {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    color: #e8e8e8;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif SC', serif;
    font-size: 0.82rem;
}

.filter-btn:hover, .filter-btn.active {
    background: rgba(255, 215, 0, 0.2);
    border-color: #ffd700;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    max-width: 1000px;
    margin: 0 auto;
}

.tarot-card {
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.tarot-card:hover {
    transform: translateY(-3px);
    border-color: #ffd700;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.2);
}

.card-image {
    width: 100%;
    aspect-ratio: 3 / 4;
    background: linear-gradient(135deg, #3d3d5c, #2d2d4c);
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    position: relative;
    overflow: hidden;
}

.card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 40%, rgba(255, 215, 0, 0.1) 50%, transparent 60%);
    animation: shimmer 3s infinite;
}

.card-name {
    text-align: center;
    font-size: 0.82rem;
    color: #e8e8e8;
    font-weight: 600;
    word-break: keep-all;
}

.card-number {
    text-align: center;
    font-size: 0.7rem;
    color: #888;
    margin-top: 4px;
}

.reading-section {
    padding: 30px 0;
    background: rgba(10, 10, 26, 0.5);
    position: relative;
    z-index: 1;
}

.reading-section h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 8px;
    color: #ffd700;
    word-break: keep-all;
}

.spread-wrapper {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.spread-cards {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: nowrap;
}

.spread-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 0;
    max-width: 180px;
}

.spread-label {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-bottom: 8px;
    word-break: keep-all;
}

.spread-desc {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 12px;
    text-align: center;
    word-break: keep-all;
}

.card-slot {
    width: 100%;
    max-width: 160px;
    aspect-ratio: 3 / 4;
    perspective: 1000px;
}

.card-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #4a3f6b, #2d2547);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid #ffd700;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.card-back:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.3);
}

.card-back::before {
    content: '?';
    font-size: 3rem;
    color: #ffd700;
    opacity: 0.8;
}

.card-back::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px dashed rgba(255, 215, 0, 0.3);
    border-radius: 6px;
}

.revealed-card {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 3px solid #ffd700;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    padding: 8px;
}

.revealed-card .card-icon {
    font-size: 2.4rem;
    margin-bottom: 6px;
}

.revealed-card .card-title {
    font-size: 0.78rem;
    text-align: center;
    color: #e8e8e8;
    padding: 0 4px;
    word-break: keep-all;
}

.revealed-card .card-position {
    font-size: 0.65rem;
    color: #888;
    margin-top: 4px;
}

.reset-btn {
    display: block;
    margin: 15px auto 0;
    padding: 10px 30px;
    font-size: 0.9rem;
    background: linear-gradient(145deg, #ffd700, #daa520);
    border: none;
    border-radius: 25px;
    color: #1a1a2e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif SC', serif;
}

.reset-btn:hover {
    transform: scale(1.03);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

.reading-interpretation {
    background: rgba(26, 10, 46, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.reading-interpretation .placeholder-text {
    text-align: center;
    color: #888;
    font-style: italic;
    padding: 15px;
}

.interpretation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.interpretation-card {
    padding: 12px;
    background: rgba(42, 42, 74, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    text-align: center;
}

.interpretation-card .card-icon {
    font-size: 2rem;
    margin-bottom: 6px;
}

.interpretation-card h4 {
    color: #ffd700;
    margin-bottom: 6px;
    font-size: 0.9rem;
    word-break: keep-all;
}

.interpretation-card .card-name {
    color: #e8e8e8;
    font-size: 0.85rem;
    margin-bottom: 2px;
    text-align: center;
}

.interpretation-card .card-position {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 6px;
}

.interpretation-card .meaning {
    font-size: 0.8rem;
    color: #c0c0c0;
    line-height: 1.4;
    text-align: left;
}

.ai-section {
    padding: 30px 0;
    background: rgba(10, 10, 26, 0.5);
}

.ai-section h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 8px;
    color: #ffd700;
    word-break: keep-all;
}

.ai-container {
    display: flex;
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
}

.ai-sidebar {
    flex: 0 0 220px;
    background: rgba(42, 42, 74, 0.5);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.ai-wisdom-icon {
    font-size: 3rem;
    margin-bottom: 12px;
    animation: pulse 2s infinite;
}

.ai-sidebar h3 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 1rem;
    word-break: keep-all;
}

.ai-sidebar > p {
    color: #c0c0c0;
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.ai-tips {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    text-align: left;
}

.ai-tips h4 {
    color: #ffd700;
    margin-bottom: 12px;
    font-size: 0.9rem;
    word-break: keep-all;
}

.ai-tips ul {
    list-style: none;
}

.ai-tips li {
    color: #b0b0b0;
    font-size: 0.78rem;
    padding: 6px 0;
    padding-left: 12px;
    position: relative;
}

.ai-tips li::before {
    content: '✧';
    position: absolute;
    left: 0;
    color: #ffd700;
    font-size: 0.65rem;
}

.ai-chat {
    flex: 1;
    min-width: 280px;
    background: rgba(26, 10, 46, 0.6);
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 550px;
    width: 100%;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    -webkit-overflow-scrolling: touch;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 3px;
}

.message {
    display: flex;
    margin-bottom: 12px;
    animation: slideUp 0.3s ease;
}

.message-avatar {
    font-size: 1.4rem;
    margin-right: 8px;
    flex-shrink: 0;
}

.message-content {
    background: rgba(255, 255, 255, 0.1);
    padding: 14px 16px;
    border-radius: 12px;
    max-width: 85%;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.bot-message .message-content {
    background: rgba(255, 215, 0, 0.1);
    border-bottom-left-radius: 4px;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    margin-right: 0;
    margin-left: 8px;
}

.user-message .message-content {
    background: rgba(100, 100, 200, 0.2);
    border-bottom-right-radius: 4px;
}

.message-content p {
    margin-bottom: 8px;
    color: #d0d0d0;
    line-height: 1.5;
    font-size: 0.95rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.chat-input-area {
    display: flex;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    gap: 10px;
}

#userQuestion {
    flex: 1;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 22px;
    color: #e8e8e8;
    font-family: 'Noto Serif SC', serif;
    font-size: 0.95rem;
    min-width: 0;
}

#userQuestion:focus {
    outline: none;
    border-color: #ffd700;
}

#userQuestion:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#sendBtn {
    padding: 12px 22px;
    background: linear-gradient(145deg, #ffd700, #daa520);
    border: none;
    border-radius: 22px;
    color: #1a1a2e;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Noto Serif SC', serif;
    font-size: 0.95rem;
    flex-shrink: 0;
}

#sendBtn:hover:not(:disabled) {
    transform: scale(1.03);
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4);
}

#sendBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tips-section {
    padding: 30px 0;
}

.tips-section h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 20px;
    color: #ffd700;
    word-break: keep-all;
}

.tips-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.tip-card {
    background: rgba(42, 42, 74, 0.5);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.tip-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.3);
}

.tip-icon {
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.tip-card h3 {
    color: #ffd700;
    margin-bottom: 8px;
    font-size: 0.95rem;
    word-break: keep-all;
}

.tip-card p {
    color: #c0c0c0;
    font-size: 0.82rem;
    line-height: 1.5;
}

.footer {
    text-align: center;
    padding: 25px 20px;
    background: rgba(5, 5, 15, 0.9);
    border-top: 1px solid rgba(255, 215, 0, 0.2);
    position: relative;
    z-index: 1;
}

.footer p {
    color: #888;
    margin-bottom: 8px;
    font-size: 0.82rem;
    padding: 0 10px;
    word-break: keep-all;
}

.footer-note {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.1rem;
    color: #ffd700 !important;
    margin-top: 12px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    -webkit-overflow-scrolling: touch;
}

.modal-content {
    background: linear-gradient(145deg, #2a2a4a, #1a1a3a);
    margin: 5% auto;
    padding: 20px;
    border: 2px solid #ffd700;
    width: 90%;
    max-width: 450px;
    border-radius: 12px;
    position: relative;
    animation: modalIn 0.3s ease;
}

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

.close {
    color: #aaa;
    float: right;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.close:hover {
    color: #ffd700;
}

.modal-card {
    text-align: center;
    clear: both;
}

.modal-card .card-icon {
    font-size: 4rem;
    margin-bottom: 12px;
}

.modal-card .card-name {
    font-size: 1.3rem;
    color: #ffd700;
    margin-bottom: 6px;
    word-break: keep-all;
}

.modal-card .card-number {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 15px;
}

.modal-card h4 {
    color: #e8e8e8;
    margin-bottom: 10px;
    font-size: 1rem;
    word-break: keep-all;
}

.modal-card .meaning-text {
    color: #d0d0d0;
    line-height: 1.6;
    text-align: left;
    margin-bottom: 15px;
    font-size: 0.88rem;
}

.upright, .reversed {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 12px;
    border-radius: 6px;
    margin-bottom: 10px;
    text-align: left;
}

.upright h5, .reversed h5 {
    color: #ffd700;
    margin-bottom: 6px;
    font-size: 0.9rem;
    word-break: keep-all;
}

.upright p, .reversed p {
    color: #c0c0c0;
    font-size: 0.85rem;
    line-height: 1.5;
}

@media (max-width: 1024px) {
    .container { padding: 0 12px; }
    .title { font-size: 2.2rem; letter-spacing: 4px; }
    .ai-sidebar { flex: 0 0 200px; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
    .card-image { font-size: 2rem; }
}

@media (max-width: 768px) {
    .container { padding: 0 12px; }
    .title { font-size: 1.8rem; letter-spacing: 3px; }
    .subtitle { font-size: 0.9rem; }
    .header-runes { font-size: 0.9rem; letter-spacing: 8px; }
    .header { padding: 30px 12px; }
    .intro-section, .basics-section, .cards-section, .reading-section, .ai-section, .tips-section { padding: 25px 0; }
    .intro-section h2, .basics-section h2, .cards-section h2, .reading-section h2, .ai-section h2, .tips-section h2 { font-size: 1.2rem; }
    .intro-content { flex-direction: column; gap: 15px; }
    .intro-text { min-width: 0; width: 100%; }
    .tarot-symbol { flex-direction: row; gap: 10px; }
    .symbol-circle { width: 75px; height: 75px; }
    .symbol-circle.small { width: 65px; height: 65px; }
    .symbol-circle span:last-child { font-size: 1.2rem; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 10px; }
    .tarot-card { padding: 8px; }
    .card-image { font-size: 1.8rem; }
    .card-name { font-size: 0.75rem; }
    .card-number { font-size: 0.65rem; }
    .cards-filter { gap: 6px; }
    .filter-btn { padding: 5px 12px; font-size: 0.75rem; }
    .spread-cards { gap: 10px; }
    .spread-container { max-width: none; }
    .spread-label { font-size: 0.8rem; margin-bottom: 6px; }
    .spread-desc { font-size: 0.68rem; margin-bottom: 8px; }
    .card-slot { max-width: 130px; }
    .card-back::before { font-size: 2.4rem; }
    .revealed-card .card-icon { font-size: 1.8rem; }
    .revealed-card .card-title { font-size: 0.7rem; }
    .interpretation-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .reading-interpretation { padding: 15px; }
    .interpretation-card { padding: 10px; }
    .interpretation-card .card-icon { font-size: 1.6rem; }
    .interpretation-card h4 { font-size: 0.8rem; }
    .interpretation-card .card-name { font-size: 0.78rem; }
    .interpretation-card .card-position { font-size: 0.65rem; }
    .interpretation-card .meaning { font-size: 0.72rem; }
    .reset-btn { padding: 8px 25px; font-size: 0.85rem; }
    .ai-container { flex-direction: column; gap: 15px; }
    .ai-sidebar { flex: none; width: 100%; }
    .ai-chat { height: 600px; min-width: 0; width: 100%; }
    .chat-messages { padding: 20px; }
    .message-content { padding: 16px 20px; max-width: 90%; }
    .message-content p { font-size: 1rem; line-height: 1.6; }
    .message-avatar { font-size: 1.4rem; }
    .chat-input-area { padding: 16px; gap: 10px; }
    #userQuestion { padding: 14px 18px; font-size: 1rem; }
    #sendBtn { padding: 14px 24px; font-size: 1rem; }
    .tips-grid { grid-template-columns: repeat(2, 1fr); }
    .tip-card { padding: 14px 10px; }
    .tip-icon { font-size: 1.8rem; }
    .tip-card h3 { font-size: 0.9rem; }
    .tip-card p { font-size: 0.78rem; }
    .modal-content { margin: 8% auto; padding: 18px; width: 92%; }
    .modal-card .card-icon { font-size: 3.5rem; }
    .modal-card .card-name { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 10px; }
    .title { font-size: 1.4rem; letter-spacing: 2px; }
    .subtitle { font-size: 0.82rem; padding: 0 5px; }
    .header-runes { font-size: 0.75rem; letter-spacing: 5px; }
    .header { padding: 22px 10px; }
    .intro-section, .basics-section, .cards-section, .reading-section, .ai-section, .tips-section { padding: 20px 0; }
    .intro-section h2, .basics-section h2, .cards-section h2, .reading-section h2, .ai-section h2, .tips-section h2 { font-size: 1.15rem; margin-bottom: 15px; }
    .section-desc { font-size: 0.78rem; margin-bottom: 15px; }
    .intro-text p { font-size: 0.82rem; line-height: 1.5; margin-bottom: 10px; }
    .intro-text li { font-size: 0.78rem; padding: 5px 0 5px 16px; }
    .tarot-symbol { gap: 8px; }
    .symbol-circle { width: 65px; height: 65px; }
    .symbol-circle.small { width: 55px; height: 55px; }
    .symbol-circle span:first-child { font-size: 0.65rem; }
    .symbol-circle span:last-child { font-size: 1.1rem; }
    .basics-grid { grid-template-columns: 1fr; gap: 12px; }
    .basics-card { padding: 15px; }
    .basics-icon { font-size: 1.8rem; }
    .basics-card h3 { font-size: 1rem; }
    .basics-card p { font-size: 0.82rem; }
    .basics-card li { font-size: 0.78rem; }
    .cards-filter { gap: 5px; margin-bottom: 15px; }
    .filter-btn { padding: 5px 10px; font-size: 0.72rem; }
    .cards-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
    .tarot-card { padding: 6px; }
    .card-image { font-size: 1.4rem; margin-bottom: 5px; }
    .card-name { font-size: 0.68rem; }
    .card-number { font-size: 0.6rem; margin-top: 2px; }
    .spread-cards { flex-direction: row; gap: 5px; flex-wrap: nowrap; }
    .spread-container { min-width: 0; flex: 1; }
    .spread-label { font-size: 0.7rem; margin-bottom: 4px; }
    .spread-desc { font-size: 0.6rem; margin-bottom: 6px; display: none; }
    .card-slot { max-width: none; }
    .card-back::before { font-size: 1.8rem; }
    .card-back::after { top: 5px; left: 5px; right: 5px; bottom: 5px; }
    .revealed-card { padding: 5px; }
    .revealed-card .card-icon { font-size: 1.3rem; margin-bottom: 4px; }
    .revealed-card .card-title { font-size: 0.62rem; padding: 0 2px; }
    .revealed-card .card-position { font-size: 0.55rem; }
    .reading-interpretation { padding: 12px; }
    .interpretation-grid { grid-template-columns: 1fr; gap: 10px; }
    .interpretation-card { padding: 12px; }
    .interpretation-card .card-icon { font-size: 1.8rem; }
    .interpretation-card h4 { font-size: 0.9rem; }
    .interpretation-card .card-name { font-size: 0.82rem; }
    .interpretation-card .meaning { font-size: 0.82rem; }
    .reset-btn { padding: 8px 22px; font-size: 0.82rem; margin-top: 12px; }
    .ai-chat { height: 75vh; min-height: 600px; width: 100%; }
    .chat-messages { padding: 20px; }
    .message-content { padding: 18px 22px; max-width: 95%; }
    .message-content p { font-size: 1.1rem; line-height: 1.6; }
    .message-avatar { font-size: 1.6rem; margin-right: 10px; }
    .user-message .message-avatar { margin-left: 10px; }
    .chat-input-area { padding: 16px; gap: 10px; }
    #userQuestion { padding: 14px 18px; font-size: 1.05rem; }
    #sendBtn { padding: 14px 24px; font-size: 1rem; }
    .ai-sidebar { padding: 18px; }
    .ai-wisdom-icon { font-size: 2.8rem; }
    .ai-sidebar h3 { font-size: 1rem; }
    .ai-sidebar > p { font-size: 0.82rem; }
    .ai-tips { padding: 12px; }
    .ai-tips h4 { font-size: 0.9rem; }
    .ai-tips li { font-size: 0.78rem; }
    .tips-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .tip-card { padding: 12px 8px; }
    .tip-icon { font-size: 1.6rem; margin-bottom: 6px; }
    .tip-card h3 { font-size: 0.85rem; margin-bottom: 6px; }
    .tip-card p { font-size: 0.75rem; line-height: 1.4; }
    .footer { padding: 20px 12px; }
    .footer p { font-size: 0.78rem; }
    .footer-note { font-size: 1rem; }
    .modal-content { margin: 4% auto; padding: 12px; width: 94%; }
    .close { font-size: 22px; }
    .modal-card .card-icon { font-size: 3rem; margin-bottom: 8px; }
    .modal-card .card-name { font-size: 1.1rem; }
    .modal-card .card-number { font-size: 0.8rem; margin-bottom: 12px; }
    .modal-card h4 { font-size: 0.95rem; margin-bottom: 8px; }
    .modal-card .meaning-text { font-size: 0.82rem; line-height: 1.5; }
    .upright, .reversed { padding: 8px 10px; margin-bottom: 8px; }
    .upright h5, .reversed h5 { font-size: 0.85rem; }
    .upright p, .reversed p { font-size: 0.78rem; }
}

@media (max-width: 320px) {
    .title { font-size: 1.2rem; letter-spacing: 1px; }
    .cards-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .tips-grid { grid-template-columns: 1fr; }
    .spread-cards { gap: 3px; }
    .card-back::before { font-size: 1.5rem; }
    .revealed-card .card-icon { font-size: 1.1rem; }
    .revealed-card .card-title { font-size: 0.58rem; }
    .tarot-symbol { flex-direction: column; }
    .ai-chat { height: 70vh; min-height: 550px; }
}
