@import "play.css";

/* タワーフィル専用 of CSS変数追加 */
:root {
    --stock-cell-size: 16px; /* さらに90%に縮小 */
}

/* 盤面に置かれたピースの数字を1.2倍に拡大 */
.cell.placed .val-container {
    font-size: 1.2rem;
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* 9x9固定のグリッド表示 (タワーフィルは常に9x9) */
.grid {
    grid-template-columns: repeat(9, var(--cell-size));
    grid-template-rows: repeat(9, var(--cell-size));
}

/* タワーフィルのセル文字サイズ調整 (ピースが重なるため小さめ) */
.cell {
    font-size: 0.85rem;
}

/* ピース置き場のピース内の数字の大きさを縮小（90%化） */
.piece-cell {
    font-size: 0.65rem !important;
}

/* 3x3ブロック境界 (垂直線: ::before) - タワーフィル専用 */
.cell[data-col="2"]::before,
.cell[data-col="5"]::before {
    content: '';
    position: absolute;
    top: 0;
    right: -2px;
    width: 3px;
    height: 100%;
    background-color: #78909c;
    z-index: 10;
    pointer-events: none;
}

/* 3x3ブロック境界 (水平線: ::after) - タワーフィル専用 */
.cell[data-row="2"]::after,
.cell[data-row="5"]::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 3px;
    background-color: #78909c;
    z-index: 10;
    pointer-events: none;
}

/* ③ 回転ゾーン & ストック */
.stock-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: -15px;
    padding: 2px 0;
    box-sizing: border-box;
}

.stock-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: -1px;
}

.stock-header {
    display: flex;
    gap: 2px;
    background: rgba(255, 255, 255, 0.85);
    padding: 3px 6px;
    border-radius: 6px 6px 0 0;
    box-shadow: none;
    border: 2px solid var(--border);
    border-bottom: none;
    margin-bottom: -2px;
    z-index: 10;
    position: relative;
    align-items: center;
}

.stock-divider {
    width: 1.5px;
    height: 14px;
    background-color: var(--border);
    opacity: 0.6;
    margin: 0 4px;
}

.stock-action-btn {
    background: transparent;
    border: none;
    color: #00838f;
    font-size: 0.65rem;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: bold;
    white-space: nowrap;
}

.stock-action-btn:active {
    background: rgba(0, 172, 193, 0.1);
    transform: scale(0.95);
}

.rotate-zone {
    width: 35%;
    height: 34px;
    background-color: transparent;
    border: 1px dashed rgba(0, 229, 255, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: transform 0.2s;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='40' viewBox='0 0 200 40'%3E%3Cpolyline points='180,4 196,4 196,36 24,36' fill='none' stroke='%230288d1' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M28,32 L20,36 L28,40 Z' fill='%230288d1'/%3E%3Cpolyline points='20,36 4,36 4,4 176,4' fill='none' stroke='%2343a047' stroke-width='4' stroke-linejoin='round'/%3E%3Cpath d='M172,8 L180,4 L172,0 Z' fill='%2343a047'/%3E%3C/svg%3E");
    background-size: 100% 100%;
}

.rotate-zone.flash-active {
    background-color: #e3f2fd;
    transform: scale(1.03);
}

.rotate-hint {
    font-size: 0.8rem;
    color: #37474f;
    font-weight: 700;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 5;
}

.stock-area {
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 4px 0 !important;
    margin-top: -11px;
    min-height: 280px !important;
    max-height: 380px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 8px;
    border-radius: 4px;
}

.piece-stock {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, var(--stock-cell-size));
    grid-auto-rows: var(--stock-cell-size);
    gap: 0;
    min-height: 300px !important;
    height: auto !important;
    width: 100%;
    margin: 0 auto !important;
    align-items: start;
    justify-content: start;
    padding-bottom: 20px;
}

.piece-container {
    position: relative;
    touch-action: none;
}