:root {
    --primary-color: #c92a2a;
    /* Torii Red */
    --secondary-color: #fdfdf5;
    /* Washi White */
    --accent-color: #dfa62a;
    /* Gold */
    --text-color: #2b2b2b;
    /* Sumi Ink */
    --border-color: #eedcb3;
    --wood-texture: #8b5a2b;
    --font-main: "Shippori Mincho", serif;
    --font-accent: "Yuji Syuku", serif;
}

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

body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.8;
    /* Shrine Photo Background */
    background-image: url('shrine_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
}

/* Wagara (Japanese Pattern) Overlay - Asanoha (Hemp Leaf) effect using gradients */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;

    /* Blending the pattern with the photo */
    background-color: rgba(253, 253, 245, 0.7);
    /* Washi white tint */
    background-image:
        linear-gradient(30deg, #eedcb3 12%, transparent 12.5%, transparent 87%, #eedcb3 87.5%, #eedcb3),
        linear-gradient(150deg, #eedcb3 12%, transparent 12.5%, transparent 87%, #eedcb3 87.5%, #eedcb3),
        linear-gradient(30deg, #eedcb3 12%, transparent 12.5%, transparent 87%, #eedcb3 87.5%, #eedcb3),
        linear-gradient(150deg, #eedcb3 12%, transparent 12.5%, transparent 87%, #eedcb3 87.5%, #eedcb3),
        linear-gradient(60deg, rgba(238, 220, 179, 0.5) 25%, transparent 25.5%, transparent 75%, rgba(238, 220, 179, 0.5) 75%, rgba(238, 220, 179, 0.5)),
        linear-gradient(60deg, rgba(238, 220, 179, 0.5) 25%, transparent 25.5%, transparent 75%, rgba(238, 220, 179, 0.5) 75%, rgba(238, 220, 179, 0.5));
    background-size: 40px 70px;
    background-position: 0 0, 0 0, 20px 35px, 20px 35px, 0 0, 20px 35px;
    opacity: 0.6;
    /* Adjust visibility of the pattern over the image */
    pointer-events: none;
}

header {
    position: relative;
    text-align: center;
    padding: 4rem 1rem;
    border-bottom: 4px solid var(--primary-color);
    background-color: #fff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

/* Shimenawa (Sacred Rope) styling detail */
header::after {
    content: "";
    display: block;
    width: 100%;
    height: 20px;
    background: repeating-linear-gradient(45deg,
            #f3e5ab,
            #f3e5ab 10px,
            #d4c486 10px,
            #d4c486 20px);
    position: absolute;
    top: 0;
    left: 0;
    border-bottom: 2px solid #8b5a2b;
}

h1 {
    font-family: var(--font-accent);
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    letter-spacing: 0.2em;
    text-shadow: 2px 2px 0px rgba(200, 40, 40, 0.1);
}

.subtitle {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 2rem;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.shrine-frame {
    border: 2px solid var(--primary-color);
    padding: 3rem;
    background-color: #fff;
    position: relative;
    margin: 2rem 0;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

/* Decorative corners */
.shrine-frame::before,
.shrine-frame::after {
    content: " ";
    position: absolute;
    width: 40px;
    height: 40px;
    border: 4px solid var(--accent-color);
    transition: all 0.3s ease;
}

.shrine-frame::before {
    top: -10px;
    left: -10px;
    border-right: none;
    border-bottom: none;
}

.shrine-frame::after {
    bottom: -10px;
    right: -10px;
    border-left: none;
    border-top: none;
}

.section-title {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--text-color);
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 2rem;
}

.section-title::before,
.section-title::after {
    content: "◆";
    color: var(--primary-color);
    margin: 0 10px;
    font-size: 1.2rem;
    vertical-align: middle;
}

.sticker-preview {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.ema-plaque {
    width: 200px;
    height: 140px;
    background-color: #f4d09d;
    /* Wood color */
    border: 2px solid #8b5a2b;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 100%, 0 100%, 0 10%);
    /* Ema shape approximation */
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

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

/* Red string for Ema */
.ema-plaque::before {
    content: "";
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #333 30%, transparent 40%);
    z-index: 2;
}

.ema-content {
    text-align: center;
    font-weight: bold;
    color: #5d3a1a;
}

.btn-container {
    text-align: center;
    margin-top: 3rem;
}

.omamori-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    font-size: 1.5rem;
    padding: 1.2rem 3rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(201, 42, 42, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid var(--accent-color);
}

.omamori-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201, 42, 42, 0.6);
    background-color: #d63333;
}

.omamori-btn span {
    position: relative;
    z-index: 2;
    font-family: var(--font-accent);
}

/* Mizuhiki knot effect */
.mizuhiki {
    width: 100px;
    height: 20px;
    margin: 0 auto 1rem;
    background: repeating-linear-gradient(90deg,
            var(--primary-color),
            var(--primary-color) 2px,
            white 2px,
            white 4px);
    border-radius: 10px;
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: #333;
    color: #aaa;
    font-size: 0.9rem;
    margin-top: 4rem;
    border-top: 5px solid var(--accent-color);
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .shrine-frame {
        padding: 1.5rem;
    }
}